Skip to content

Commit 2d3b64e

Browse files
authored
prune intermediate docker multi-stage build images during cleanup (#95)
* prune intermediate docker multi-stage build images during cleanup * removed remnants of isCLI, default is to use CLI always
1 parent 13fcb11 commit 2d3b64e

22 files changed

+100
-210
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/CLIDriver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void main(String[] args) {
5151
CommandLine.usage(cliDriver, System.out);
5252
System.exit(-1);
5353
} else {
54-
CommandResponse response = WLSCommandLine.call(cliDriver, true, args);
54+
CommandResponse response = WLSCommandLine.call(cliDriver, args);
5555
if (response != null) {
5656
if (response.getStatus() != 0) {
5757
String message = String.format("Response code: %d, message: %s", response.getStatus(),

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/WLSCommandFactory.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/WLSCommandLine.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111

1212
public class WLSCommandLine {
1313

14-
public static <C extends Callable<T>, T> T call(C callable, boolean isCLIMode, String... args) {
15-
return call(callable, System.out, System.err, CommandLine.Help.Ansi.AUTO, true, isCLIMode, args);
16-
}
17-
18-
// Turn CLIMode off if not provided
1914
public static <C extends Callable<T>, T> T call(C callable, String... args) {
20-
return call(callable, false, args);
15+
return call(callable, System.out, System.err, CommandLine.Help.Ansi.AUTO, true, args);
2116
}
2217

2318
/**
@@ -27,21 +22,16 @@ public static <C extends Callable<T>, T> T call(C callable, String... args) {
2722
* @param err error stream
2823
* @param ansi ANSI mode
2924
* @param ignoreCaseForEnums ignore case for Enums
30-
* @param isCLIMode true to use WLSCommandFactory
3125
* @param args command line arguments
3226
* @param <C> Callable class
3327
* @param <T> Callable Type
3428
* @return the result
3529
*/
3630
public static <C extends Callable<T>, T> T call(C callable, PrintStream out, PrintStream err,
3731
CommandLine.Help.Ansi ansi, boolean ignoreCaseForEnums,
38-
boolean isCLIMode, String... args) {
32+
String... args) {
3933
CommandLine cmd;
40-
if (isCLIMode) {
41-
cmd = new CommandLine(callable, new WLSCommandFactory());
42-
} else {
43-
cmd = new CommandLine(callable);
44-
}
34+
cmd = new CommandLine(callable);
4535
cmd.setCaseInsensitiveEnumValuesAllowed(ignoreCaseForEnums);
4636
cmd.setToggleBooleanFlags(false);
4737
cmd.setUnmatchedArgumentsAllowed(false);

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddEntry.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ public class AddEntry extends CacheOperation {
1717
public AddEntry() {
1818
}
1919

20-
public AddEntry(boolean isCLIMode) {
21-
super(isCLIMode);
22-
}
23-
2420
@Override
2521
public CommandResponse call() {
2622
if (!Utils.isEmptyString(key) && !Utils.isEmptyString(location)) {
@@ -37,9 +33,7 @@ public CommandResponse call() {
3733
return new CommandResponse(-1, "Command Failed");
3834
}
3935
}
40-
if (isCLIMode) {
41-
spec.commandLine().usage(System.out);
42-
}
36+
spec.commandLine().usage(System.out);
4337
return new CommandResponse(-1, "Invalid arguments. --key & --path required.");
4438
}
4539

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddInstallerEntry.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public class AddInstallerEntry extends CacheOperation {
2323
public AddInstallerEntry() {
2424
}
2525

26-
public AddInstallerEntry(boolean isCLIMode) {
27-
super(isCLIMode);
28-
}
29-
3026
@Override
3127
public CommandResponse call() {
3228
if (location != null && Files.isRegularFile(location) && !Utils.isEmptyString(version)) {

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/AddPatchEntry.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public class AddPatchEntry extends CacheOperation {
3030
public AddPatchEntry() {
3131
}
3232

33-
public AddPatchEntry(boolean isCLIMode) {
34-
super(isCLIMode);
35-
}
36-
3733
@Override
3834
public CommandResponse call() throws Exception {
3935

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheCLI.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,12 @@ public class CacheCLI implements Callable<CommandResponse> {
3434
public CacheCLI() {
3535
}
3636

37-
public CacheCLI(boolean isCLIMode) {
38-
this.isCLIMode = isCLIMode;
39-
}
40-
4137
@Override
4238
public CommandResponse call() {
43-
if (isCLIMode) {
44-
spec.commandLine().usage(System.out);
45-
}
39+
spec.commandLine().usage(System.out);
4640
return new CommandResponse(-1, "Invalid arguments");
4741
}
4842

49-
private boolean isCLIMode;
50-
5143
@Spec
5244
CommandSpec spec;
5345

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheOperation.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616

1717
public abstract class CacheOperation implements Callable<CommandResponse> {
1818

19-
boolean isCLIMode;
20-
21-
CacheOperation() {
22-
}
23-
24-
CacheOperation(boolean isCLIMode) {
25-
this.isCLIMode = isCLIMode;
26-
}
27-
2819
protected CacheStore cacheStore = new CacheStoreFactory().get();
2920

3021
@Unmatched

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/DeleteEntry.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ public class DeleteEntry extends CacheOperation {
2222
public DeleteEntry() {
2323
}
2424

25-
public DeleteEntry(boolean isCLIMode) {
26-
super(isCLIMode);
27-
}
28-
2925
@Override
3026
public CommandResponse call() {
3127
if (!Utils.isEmptyString(key)) {
@@ -47,9 +43,7 @@ public CommandResponse call() {
4743
}
4844
}
4945
}
50-
if (isCLIMode) {
51-
spec.commandLine().usage(System.out);
52-
}
46+
spec.commandLine().usage(System.out);
5347
return new CommandResponse(-1, "Invalid arguments. --key should correspond to a valid entry in cache");
5448
}
5549

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/GetCacheDir.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ public class GetCacheDir extends CacheOperation {
1515
public GetCacheDir() {
1616
}
1717

18-
public GetCacheDir(boolean isCLIMode) {
19-
super(isCLIMode);
20-
}
21-
2218
@Override
2319
public CommandResponse call() {
2420
String path = cacheStore.getCacheDir();
25-
if (isCLIMode) {
26-
System.out.println("Cache Dir: " + path);
27-
}
21+
System.out.println("Cache Dir: " + path);
2822
return new CommandResponse(0, "Cache Dir location: ", path);
2923
}
3024

0 commit comments

Comments
 (0)