Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(artifacts): Orca sends an an artifact to clouddriver #2121

Merged
merged 4 commits into from
Apr 5, 2018
Merged

feat(artifacts): Orca sends an an artifact to clouddriver #2121

merged 4 commits into from
Apr 5, 2018

Conversation

ezimanyi
Copy link
Contributor

@ezimanyi ezimanyi commented Apr 4, 2018

When a deploy description sets the image to deploy to an artifact, Orca should send the entire artifact to clouddriver, rather than just the name of the image.

When a deploy description sets the image to deploy to an artifact,
Orca should send the entire artifact to clouddriver, rather than
just the name of the image.
@ezimanyi ezimanyi requested a review from lwander April 4, 2018 20:59
if (!operation.image) {
throw new IllegalStateException("No image could be found in ${stage.context.region}.")
if (stage.context.imageSource == "artifact") {
operation.imageSource = "ARTIFACT"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This upper/lowercase conversion is a little odd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed---ideally we'd set upper-case constants in the pipeline definition in deck, but unfortunately deck sets these as lower-case. Given that we can't change that to upper-case without breaking existing pipelines or writing a pipeline migrator, for now leaving this as is.

operation.imageSource = "ARTIFACT"
operation.imageArtifact = getImageArtifact(stage)
} else {
operation.imageSource = "STRING"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is string the right noun? What about "legacy"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose 'STRING' because we're effectively giving clouddriver the image to deploy either as (1) a string that it needs to resolve in the current project or (2) an artifact. See https://github.com/spinnaker/clouddriver/blob/935e4d23c22f7832488ad9404b076baad6501560/clouddriver-google/src/main/groovy/com/netflix/spinnaker/clouddriver/google/deploy/description/BaseGoogleInstanceDescription.groovy#L46

It's also not completely clear this is legacy, as we'll go into the else block when manually starting a cluster and passing an image from the drop-down.


def artifactId = stageContext.imageArtifactId as String
if (artifactId == null) {
throw new IllegalStateException("Image source was set to artifact but no artifact was specified.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think IllegalArgumentException is a little more 'correct'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll change this

@ezimanyi ezimanyi merged commit 274420a into spinnaker:master Apr 5, 2018
@ezimanyi ezimanyi deleted the bake-artifact branch April 5, 2018 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants