-
Notifications
You must be signed in to change notification settings - Fork 807
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
Conversation
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.
if (!operation.image) { | ||
throw new IllegalStateException("No image could be found in ${stage.context.region}.") | ||
if (stage.context.imageSource == "artifact") { | ||
operation.imageSource = "ARTIFACT" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.") |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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
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.