-
Notifications
You must be signed in to change notification settings - Fork 656
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
Populate stemcell os when manifest contains only the name #2484
Merged
Conversation
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
Follow up to: #2475 The previous PR didn't handle diffs correctly so it showed that runtime configs were getting added/removed even though they weren't. This commit moves the OS population up into the manifest parsing so it can apply to both the deployment manifest and the diff manifest. This caused the DeploymentPlan Stemcell to start failing because it had a validation that both Name and OS shouldn't be specified. We moved that validation up to the ManifestValidator which seems like a more appropriate place for it anyway. We modified the manifest parsing to prefer Name over OS when resolving the stemcell version aliases. This is more consistent with how the DeploymentPlan Stemcell resolves Name and OS. It shouldn't be a behavioral change though since you can't specify both Name and OS. Signed-off-by: Joseph Palermo <joseph.palermo@broadcom.com>
jpalermo
force-pushed
the
pr_populate_stemcell_os_from_name
branch
from
January 3, 2024 23:41
e4ae743
to
0580332
Compare
beyhan
requested review from
a team,
aramprice and
ragaskar
and removed request for
a team
January 4, 2024 15:48
lnguyen
approved these changes
Jan 8, 2024
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.
LGTM
aramprice
approved these changes
Jan 8, 2024
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.
lgtm
jpalermo
added a commit
that referenced
this pull request
Jan 9, 2024
Although those changes worked for full deploys, the way that manifests get parsed when doing things such as recreates causes the jobs to trip over the "cannot specify both name and os for stemcell" validation. It would probably be possible to find some way to work around this, but the validation just isn't very useful anyway. This commit removes that validation, making it valid now to specify both name and os. When both are specified, name is given priority and os is ignored (as name has the os included in it anyway). It is now possible to make an invalid manifest, where the name and os don't actually match, but it will deploy anyway as long as the name is valid. This doesn't seem like a compelling reason to keep this validation around.
jpalermo
added a commit
that referenced
this pull request
Jan 9, 2024
Although those changes worked for full deploys, the way that manifests get parsed when doing things such as recreates causes the jobs to trip over the "cannot specify both name and os for stemcell" validation. It would probably be possible to find some way to work around this, but the validation just isn't very useful anyway. This commit removes that validation, making it valid now to specify both name and os. When both are specified, name is given priority and os is ignored (as name has the os included in it anyway). It is now possible to make an invalid manifest, where the name and os don't actually match, but it will deploy anyway as long as the name is valid. This doesn't seem like a compelling reason to keep this validation around.
jpalermo
added a commit
that referenced
this pull request
Jan 9, 2024
Although those changes worked for full deploys, the way that manifests get parsed when doing things such as recreates causes the jobs to trip over the "cannot specify both name and os for stemcell" validation. It would probably be possible to find some way to work around this, but the validation just isn't very useful anyway. This commit removes that validation, making it valid now to specify both name and os. When both are specified, name is given priority and os is ignored (as name has the os included in it anyway). It is now possible to make an invalid manifest, where the name and os don't actually match, but it will deploy anyway as long as the name is valid. This doesn't seem like a compelling reason to keep this validation around.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow up to: #2475
The previous PR didn't handle diffs correctly so it showed that runtime configs were getting added/removed even though they weren't.
This commit moves the OS population up into the manifest parsing so it can apply to both the deployment manifest and the diff manifest.
This caused the DeploymentPlan Stemcell to start failing because it had a validation that both Name and OS shouldn't be specified. We moved that validation up to the ManifestValidator which seems like a more appropriate place for it anyway.
We modified the manifest parsing to prefer Name over OS when resolving the stemcell version aliases. This is more consistent with how the DeploymentPlan Stemcell resolves Name and OS. It shouldn't be a behavioral change though since you can't specify both Name and OS.