Skip to content

Commit b58b503

Browse files
authored
Merge branch 'main' into fix/members-ignore
2 parents a3c291e + d955d8e commit b58b503

5 files changed

Lines changed: 24 additions & 47 deletions

File tree

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
python-version: '3.9'
3737
cache: 'pip'
3838
- name: Setup Gradle
39-
uses: gradle/actions/setup-gradle@v5
39+
uses: gradle/actions/setup-gradle@v6
4040
- name: setup go
4141
uses: actions/setup-go@v6
4242
with:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.github.guacsec</groupId>
77
<artifactId>trustify-da-java-client</artifactId>
8-
<version>0.0.14-SNAPSHOT</version>
8+
<version>0.0.15-SNAPSHOT</version>
99
<name>Trustify DA Java Client</name>
1010
<description>Trustify DA Java Client</description>
1111
<url>https://github.com/guacsec/trustify-da-java-client#readme</url>

src/main/java/io/github/guacsec/trustifyda/image/ImageUtils.java

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -467,47 +467,32 @@ static Operations.ProcessExecOutput execSkopeoInspect(ImageRef imageRef, boolean
467467
var configPath = Environment.get(TRUSTIFY_DA_SKOPEO_CONFIG_PATH, "");
468468
var daemonHost = Environment.get(TRUSTIFY_DA_IMAGE_SERVICE_ENDPOINT, "");
469469

470-
String[] cmd;
470+
var cmdList = new java.util.ArrayList<String>();
471+
cmdList.add(skopeo);
472+
cmdList.add("inspect");
473+
474+
if (!configPath.isEmpty()) {
475+
cmdList.add("--authfile");
476+
cmdList.add(configPath);
477+
}
478+
479+
if (!daemonHost.isEmpty()) {
480+
cmdList.add("--daemon-host");
481+
cmdList.add(daemonHost);
482+
}
483+
484+
if (raw) {
485+
cmdList.add("--raw");
486+
}
487+
471488
if (daemonHost.isEmpty()) {
472-
cmd =
473-
configPath.isEmpty()
474-
? new String[] {
475-
skopeo,
476-
"inspect",
477-
raw ? "--raw" : "",
478-
String.format("docker://%s", imageRef.getImage().getFullName())
479-
}
480-
: new String[] {
481-
skopeo,
482-
"inspect",
483-
"--authfile",
484-
configPath,
485-
raw ? "--raw" : "",
486-
String.format("docker://%s", imageRef.getImage().getFullName())
487-
};
489+
cmdList.add(String.format("docker://%s", imageRef.getImage().getFullName()));
488490
} else {
489-
cmd =
490-
configPath.isEmpty()
491-
? new String[] {
492-
skopeo,
493-
"inspect",
494-
"--daemon-host",
495-
daemonHost,
496-
raw ? "--raw" : "",
497-
String.format("docker-daemon:%s", imageRef.getImage().getFullName())
498-
}
499-
: new String[] {
500-
skopeo,
501-
"inspect",
502-
"--authfile",
503-
configPath,
504-
"--daemon-host",
505-
daemonHost,
506-
raw ? "--raw" : "",
507-
String.format("docker-daemon:%s", imageRef.getImage().getFullName())
508-
};
491+
cmdList.add(String.format("docker-daemon:%s", imageRef.getImage().getFullName()));
509492
}
510493

494+
String[] cmd = cmdList.toArray(new String[0]);
495+
511496
return Operations.runProcessGetFullOutput(null, cmd, null);
512497
}
513498

src/main/java/io/github/guacsec/trustifyda/utils/PythonControllerVirtualEnv.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void cleanEnvironment(boolean deleteEnvironment) {
9191
Files.deleteIfExists(envRequirements);
9292
String freezeOutput =
9393
Operations.runProcessGetOutput(pythonEnvironmentDir, pipBinaryLocation, "freeze");
94-
Files.createFile(envRequirements);
9594
Files.write(envRequirements, freezeOutput.getBytes());
9695
Operations.runProcessGetOutput(
9796
pythonEnvironmentDir, pipBinaryLocation, "uninstall", "-y", "-r", "requirements.txt");

src/test/java/io/github/guacsec/trustifyda/image/ImageUtilsTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ void test_get_image_digests_single() throws IOException {
229229
new String[] {
230230
"skopeo",
231231
"inspect",
232-
"",
233232
String.format("docker://%s", mockImageRef.getImage().getFullName())
234233
}),
235234
isNull()))
@@ -866,7 +865,6 @@ void test_exec_skopeo_inspect() {
866865
mockSkopeoConfig,
867866
"--daemon-host",
868867
mockSkopeoDaemon,
869-
"",
870868
String.format("docker-daemon:%s", mockImageRef.getImage().getFullName())
871869
}),
872870
isNull()))
@@ -898,7 +896,6 @@ void test_exec_skopeo_inspect_no_config() {
898896
"inspect",
899897
"--daemon-host",
900898
mockSkopeoDaemon,
901-
"",
902899
String.format("docker-daemon:%s", mockImageRef.getImage().getFullName())
903900
}),
904901
isNull()))
@@ -930,7 +927,6 @@ void test_exec_skopeo_inspect_no_daemon() {
930927
"inspect",
931928
"--authfile",
932929
mockSkopeoConfig,
933-
"",
934930
String.format("docker://%s", mockImageRef.getImage().getFullName())
935931
}),
936932
isNull()))
@@ -960,7 +956,6 @@ void test_exec_skopeo_inspect_no_config_no_daemon() {
960956
new String[] {
961957
"skopeo",
962958
"inspect",
963-
"",
964959
String.format("docker://%s", mockImageRef.getImage().getFullName())
965960
}),
966961
isNull()))
@@ -1062,7 +1057,6 @@ void test_get_single_image_digest() throws IOException {
10621057
new String[] {
10631058
"skopeo",
10641059
"inspect",
1065-
"",
10661060
String.format("docker://%s", mockImageRef.getImage().getFullName())
10671061
}),
10681062
isNull()))
@@ -1097,7 +1091,6 @@ void test_get_single_image_digest_empty() throws JsonProcessingException {
10971091
new String[] {
10981092
"skopeo",
10991093
"inspect",
1100-
"",
11011094
String.format("docker://%s", mockImageRef.getImage().getFullName())
11021095
}),
11031096
isNull()))

0 commit comments

Comments
 (0)