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

Populate stemcell os when manifest contains only the name #2484

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

jpalermo
Copy link
Member

@jpalermo jpalermo commented Jan 3, 2024

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.

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 jpalermo force-pushed the pr_populate_stemcell_os_from_name branch from e4ae743 to 0580332 Compare January 3, 2024 23:41
@beyhan beyhan requested review from a team, aramprice and ragaskar and removed request for a team January 4, 2024 15:48
@jpalermo jpalermo requested a review from lnguyen January 8, 2024 18:08
Copy link
Member

@lnguyen lnguyen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@aramprice aramprice left a comment

Choose a reason for hiding this comment

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

lgtm

@jpalermo jpalermo merged commit cf2adba into main Jan 8, 2024
4 checks passed
@jpalermo jpalermo deleted the pr_populate_stemcell_os_from_name branch January 8, 2024 21:49
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
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants