Skip to content

Commit

Permalink
#1583 remove --config from command string generation
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto.Franchini <ro.franchini@gmail.com>
  • Loading branch information
Roberto.Franchini committed May 8, 2023
1 parent 043a569 commit bb6be66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected <C> void useBuilder(ProjectPaths projectPaths, ImageConfiguration imag
BuildDirs buildDirs = new BuildDirs(projectPaths, imageConfig.getName());

Path configPath = getDockerStateDir(imageConfig.getBuildConfiguration(), buildDirs);
List<String> buildX = Arrays.asList("docker", "--config", configPath.toString(), "buildx");
List<String> buildX = Arrays.asList("docker", "buildx");

String builderName = createBuilder(configPath, buildX, imageConfig, buildDirs);
Path configJson = configPath.resolve("config.json");
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/fabric8/maven/docker/BuildMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ private void thenBuildxRun(String relativeConfigFile, String contextDir,
String configFile = relativeConfigFile != null ? getOsDependentBuild(projectBaseDirectory.toPath(), relativeConfigFile) : null;

List<String> cmds =
BuildXService.append(new ArrayList<>(), "docker", "--config", config, "buildx",
BuildXService.append(new ArrayList<>(), "docker", "buildx",
"create", "--driver", "docker-container", "--name", "maven");
if (configFile != null) {
BuildXService.append(cmds, "--config", configFile.replace('/', File.separatorChar));
}
Mockito.verify(exec).process(cmds);

if (nativePlatformIncluded) {
List<String> buildXLine = BuildXService.append(new ArrayList<>(), "docker", "--config", config, "buildx",
List<String> buildXLine = BuildXService.append(new ArrayList<>(), "docker", "buildx",
"build", "--progress=plain", "--builder", "maven",
"--platform", NATIVE_PLATFORM, "--tag", "example:latest", "--build-arg", "foo=bar");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,11 @@ private void thenBuildxImageHasBeenPushed(String providedBuilder, String relativ
String builderName = providedBuilder != null ? providedBuilder : "maven";

if (providedBuilder == null) {
Mockito.verify(exec).process(Arrays.asList("docker", "--config", config, "buildx", "create", "--driver", "docker-container", "--name", builderName));
Mockito.verify(exec).process(Arrays.asList("docker", "buildx", "create", "--driver", "docker-container", "--name", builderName));
}

List<String> cmds =
BuildXService.append(new ArrayList<>(), "docker", "--config", config, "buildx", "build",
BuildXService.append(new ArrayList<>(), "docker", "buildx", "build",
"--progress=plain", "--builder", builderName, "--platform",
"linux/amd64,linux/arm64", "--tag",
new ImageName(imageConfiguration.getName()).getFullName(registry));
Expand Down

0 comments on commit bb6be66

Please sign in to comment.