Skip to content

Commit d33c26a

Browse files
author
Nirmalyasen
committed
Most K8S deployments do not use the outputs in downstream stages. So, if it is not used
users can skip the output of the Deployment Manifest and Run Job (Manifest) stage by specifiying the attribute noOutput set to false in the stage json. This significantly reduces the execution context being saved in redis/databse or sent to the browser.
1 parent ca398bf commit d33c26a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/job/RunJobStage.java

+9
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616

1717
package com.netflix.spinnaker.orca.clouddriver.pipeline.job;
1818

19+
import static java.util.Collections.emptyMap;
20+
1921
import com.fasterxml.jackson.databind.ObjectMapper;
2022
import com.netflix.spinnaker.orca.api.pipeline.CancellableStage;
2123
import com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder;
24+
import com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder;
2225
import com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode;
2326
import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution;
2427
import com.netflix.spinnaker.orca.clouddriver.tasks.artifacts.ConsumeArtifactTask;
@@ -76,6 +79,12 @@ public void taskGraph(@Nonnull StageExecution stage, @Nonnull TaskNode.Builder b
7679
}
7780
}
7881

82+
public void afterStages(@Nonnull StageExecution stage, @Nonnull StageGraphBuilder graph) {
83+
if (stage.getContext().getOrDefault("noOutput", "false").toString().equals("true")) {
84+
stage.setOutputs(emptyMap());
85+
}
86+
}
87+
7988
@Override
8089
public Result cancel(StageExecution stage) {
8190
log.info(

orca-clouddriver/src/main/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/manifest/DeployManifestStage.java

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package com.netflix.spinnaker.orca.clouddriver.pipeline.manifest;
1919

2020
import static com.google.common.collect.ImmutableList.toImmutableList;
21+
import static java.util.Collections.emptyMap;
2122

2223
import com.google.common.collect.ImmutableList;
2324
import com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder;
@@ -80,6 +81,9 @@ public void afterStages(@Nonnull StageExecution stage, @Nonnull StageGraphBuilde
8081
// do nothing
8182
}
8283
}
84+
if (stage.getContext().getOrDefault("noOutput", "false").toString().equals("true")) {
85+
stage.setOutputs(emptyMap());
86+
}
8387
}
8488

8589
private void disableOldManifests(Map<String, Object> parentContext, StageGraphBuilder graph) {

0 commit comments

Comments
 (0)