Skip to content

Commit

Permalink
fix(pipelines): Pass resolveArtifacts = true to plan endpoint (#427) (#…
Browse files Browse the repository at this point in the history
…428)

Orca now requires callers to explicitly request artifact resolution
when calling '/plan' on a templated pipeline. We do want this
behavior when triggering from echo, so pass the flag.
  • Loading branch information
spinnakerbot authored and ezimanyi committed Jan 4, 2019
1 parent 05db3d9 commit 22a704d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public interface OrcaService {
@POST("/orchestrate")
Observable<TriggerResponse> trigger(@Body Pipeline pipeline);

@POST("/orchestrate")
Map plan(@Body Map pipelineConfig);
@POST("/plan")
Map plan(@Body Map pipelineConfig, @Query("resolveArtifacts") boolean resolveArtifacts);

@POST("/orchestrate")
Observable<TriggerResponse> trigger(@Body Pipeline pipeline, @Header(AuthenticatedRequest.SPINNAKER_USER) String runAsUser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void startPipeline(Pipeline pipeline) {
boolean propagateAuth = pipeline.getTrigger() != null && pipeline.getTrigger().isPropagateAuth();
log.debug("Planning templated pipeline {} before triggering", pipeline.getId());
pipeline = pipeline.withPlan(true);
Map resolvedPipelineMap = orca.plan(objectMapper.convertValue(pipeline, Map.class));
Map resolvedPipelineMap = orca.plan(objectMapper.convertValue(pipeline, Map.class), true);
pipeline = objectMapper.convertValue(resolvedPipelineMap, Pipeline.class);
if (propagateAuth) {
pipeline = pipeline.withTrigger(pipeline.getTrigger().atPropagateAuth(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PipelineInitiatorSpec extends Specification {

then:
1 * fiatStatus.isEnabled() >> { return true }
orcaCalls * orca.plan(_) >> pipelineMap
orcaCalls * orca.plan(_, true) >> pipelineMap
objectMapper.convertValue(pipelineMap, Pipeline.class) >> pipeline
1 * orca.trigger(_) >> empty()

Expand Down

0 comments on commit 22a704d

Please sign in to comment.