-
Notifications
You must be signed in to change notification settings - Fork 808
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(moniker): fix cluster if detail is set to empty via SpEL #1832
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 doesn't seem quite right ... the Moniker shouldn't have an invalid cluster in the first place.
Can we fix it at Moniker creation time vs. fixing it on read afterwards?
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 issue in question is triggered when a pipeline.json contains something like:
Unless we don't want to support an optional parameterized cluster detail, seems like something needs to happen after SpEL evaluation in orca.
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.
@lwander @andrewbackes Is it the expected behavior for
deck
to pre-construct a cluster of the formapplication-stack-details
?This happens in a deploy stage if you use a SPeL expression for details.
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.
@asher - Deck will not always constructs a cluster name of the form
app-stack-detail
. Only providers still using frigga follow that scheme. The otherNamers
treat cluster as a free form field. Like @ajordens pointed out, I think it would be safest to handle this when the moniker is created. Something like:There may be some unexpected behavior with this PR because users can still set the cluster value to whatever they want. Clouddriver does not reject cluster names that end in hyphen. But anything in Orca that uses the
monikerFromStage()
helper method will be stripping the hyphen. The monikers will not match. I'm not sure what all of the downstream consequences will be, but I think there will be some. TrafficGuard comes to mind.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.
@andrewbackes the example you give would work with this PR reverted, but to automatically create that would require deck to parse and modify user provided SPeL expressions when generating a moniker. I'm hesitant to go down that path.
Can we avoid pre-constructing
moniker.cluster
entirely if using frigga naming?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.
In the spirit of sharing information, here is a screenshot of the k8s v2 deploy wizard.
Disclaimer: This is an early draft and is will probably change a few times.
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.
My only concern is around Orca chopping off the hyphen but clouddriver not. Seems like that would be something very hard to debug if it ever came up for somebody. I'd prefer consistency.
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 manually edited my test redblack pipeline that contained the following (auto generated via the aws deploy wizard):
And removed the pre-generated cluster to get:
And, oops - got a NPE from
monikerFromStage()
thanks to this very PR. Fixed the NPE and everything worked as it would have pre-moniker with an emptyparameters.foo
.So, how about if instead of this PR, we modify deck to stop pre-constructing
moniker.cluster
in the form ofapplication-stack-details
? My test obviously wasn't exhaustive in confirming that there aren't dependencies on the presence of amoniker.cluster
ifmoniker
exists, but it feels like the right direction to go in.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.
Sorry i've been OOO - what you're suggesting sounds best to me asher, and this is the direction the k8s provider takes moniker.
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.
@asher - I think that sounds like a good approach.