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

Write the user provided IG spec to state store instead of the full spec #14127

Merged
merged 3 commits into from
Aug 20, 2022

Conversation

olemarkus
Copy link
Member

With clusters, we write the input spec to the cluster store. The full spec is also uploaded, which is eventually used by nodeup.

With IGs, however, we write the full spec (after expanding and setting all defaults) to the cluster store. Further defaults are then done in places less appropriate such as during nodeup or during the building of nodeup config. The reason for this is probably that nodeup used the IG spec earlier, while now this isn't needed since nodeup only uses the nodeup config.

This PR writes the input spec to the cluster store, but it does validate the expanded cluster spec (before the not so appropriate expansion though!). This will allow us to move more expansions to populateInstanceGroupSpec without mutating the user input before storing it.

Some of the setup logic done in populateInstanceGroupSpec such as setting image and machine type has been moved to new_cluster.

Some of the mutation has been skipped as well (some node labels and the provider type), which is the cause of the create cluster golden output diffs. There should be no diffs to update cluster or nodeup configs though.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 16, 2022
@k8s-ci-robot k8s-ci-robot requested a review from rdrgmnzs August 16, 2022 07:33
@olemarkus olemarkus requested a review from justinsb August 16, 2022 07:33
@olemarkus
Copy link
Member Author

/retest

Comment on lines -552 to -567
if c.Image != "" {
for _, group := range instanceGroups {
group.Spec.Image = c.Image
}
}
if c.MasterImage != "" {
for _, group := range masters {
group.Spec.Image = c.MasterImage
}
}
if c.NodeImage != "" {
for _, group := range nodes {
group.Spec.Image = c.NodeImage
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Where was this logic moved?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any reference to NodeImage and I don't see Image being set first and MasterImage and NodeImage overriding it.

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/kubernetes/kops/pull/14127/files#diff-cf0e850db1e4461eab5d4dac860d20f2176b940f236e50825ae538ee23688a1eR396

It happens the other way around now. So if the image doesn't get set during IG creation, it gets set by the default logic.

But I think you are right about NodeImage not being respected. We may be missing a test case here. Let me try to add one.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 20, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8f20d22 into kubernetes:master Aug 20, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Aug 20, 2022
justinsb added a commit to justinsb/kops that referenced this pull request Feb 5, 2023
This restores the behaviour before kubernetes#14127, which wasn't documented /
intended.
justinsb added a commit to justinsb/kops that referenced this pull request Mar 9, 2023
This restores the behaviour before kubernetes#14127, which wasn't documented /
intended.
Shimiazoulai pushed a commit to spotinst/kubernetes-kops that referenced this pull request Jul 13, 2023
This restores the behaviour before kubernetes#14127, which wasn't documented /
intended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants