Skip to content

Commit

Permalink
labels moved to ContainerConfig
Browse files Browse the repository at this point in the history
Signed-off-by: munishchouhan <[email protected]>
  • Loading branch information
munishchouhan committed Mar 15, 2024
1 parent 8cd4d1a commit 445b537
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/src/main/java/io/seqera/wave/cli/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
import org.slf4j.LoggerFactory;
import picocli.CommandLine;

import static io.seqera.wave.cli.util.Checkers.*;
import static io.seqera.wave.cli.util.Checkers.isEmpty;
import static io.seqera.wave.cli.util.Checkers.isEnvVar;
import static io.seqera.wave.cli.util.Checkers.isLabel;
import static io.seqera.wave.util.DockerHelper.addPackagesToSpackFile;
import static io.seqera.wave.util.DockerHelper.condaFileFromPackages;
import static io.seqera.wave.util.DockerHelper.condaFileFromPath;
Expand Down Expand Up @@ -396,14 +398,7 @@ protected Client client() {
}

protected SubmitContainerTokenRequest createRequest() {
Map<String, String> labels = null;
if(label!=null){
labels = new HashMap<>();
for(String singleLabel: label){
String[] singleLabelArray = singleLabel.split("=");
labels.put(singleLabelArray[0], singleLabelArray[1]);
}
}

return new SubmitContainerTokenRequest()
.withContainerImage(image)
.withContainerFile(containerFileBase64())
Expand All @@ -422,7 +417,6 @@ protected SubmitContainerTokenRequest createRequest() {
.withFreezeMode(freeze)
.withDryRun(dryRun)
.withContainerIncludes(includes)
.withLabels(labels)
;
}

Expand Down Expand Up @@ -577,6 +571,16 @@ protected ContainerConfig prepareConfig() {
if( size>=10 * _1MB )
throw new RuntimeException("Compressed container layers cannot exceed 10 MiB");

Map<String, String> labels = null;
if(label!=null){
labels = new HashMap<>();
for(String singleLabel: label){
String[] singleLabelArray = singleLabel.split("=");
labels.put(singleLabelArray[0], singleLabelArray[1]);
}
}

result.labels = labels;
// return the result
return !result.empty() ? result : null;
}
Expand Down

0 comments on commit 445b537

Please sign in to comment.