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

fix(deploy): Gracefully handle missing artifacts #918

Merged
merged 2 commits into from
Apr 19, 2018
Merged

fix(deploy): Gracefully handle missing artifacts #918

merged 2 commits into from
Apr 19, 2018

Conversation

ezimanyi
Copy link
Contributor

When deploying a version of Spinnaker before Kayenta, the distributed GCE deployment currently throws an NPE.

When deploying a version of Spinnaker before Kayenta,
the distributed GCE deployment currently throws an NPE.
@ezimanyi ezimanyi requested a review from lwander April 18, 2018 21:41
@ezimanyi
Copy link
Contributor Author

With this change (and after re-generating some missing GCE images), I was able to successfully deploy both 1.6.0 and 1.6.1 using a distributed GCE setup.

return String.format("projects/%s/global/images/%s",
getGoogleImageProject(deploymentName),
String.join("-", "spinnaker", artifactName, version.replace(".", "-").replace(":", "-")));
if (version == null) {
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 this should be handled upstream from here. I realize this is where the exception will be thrown, but I think the deployer in charge of picking which services to create should be smarter about asking for "artifact ids" of services that can't be created.

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'm sort of torn on whether this should be handled here or upstream. I actually think that it's this function (or perhaps the downstream one getArtifactVersion) that's in the best position to know whether or not a given service should be built. Effectively, the question of whether a service should be built is answered by looking at whether it's in the BOM---which is what this function is doing to get the version to deploy. So I think it make sense that asking "what version of X should I deploy?" would return null if the answer is not to deploy X.

That being said, I agree that it's a bit silly that we still end up with an entry in endpoints.services for a service that's not being deployed...so maybe we should write a boolean serviceExists() that just checks if there's a version at all and short-circuit all the settings-building if it's false. Let me see what this last idea would look like.

@ezimanyi
Copy link
Contributor Author

Tested by doing the following deployments: LocalDebian, BakeDebian, Kubernetes (V1), Kubernetes (V2), Distributed GCE.

@ezimanyi
Copy link
Contributor Author

@lwander : Mind taking a look at this updated change?

@ezimanyi ezimanyi merged commit abb1c0e into spinnaker:master Apr 19, 2018
@ezimanyi ezimanyi deleted the gce-distributed-fixes branch April 19, 2018 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants