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

Update K8s version on Capi machine for in-place upgrades #7325

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

rahulbabu95
Copy link
Member

@rahulbabu95 rahulbabu95 commented Jan 18, 2024

Issue #, if available:
In-place upgrades directly upgrades the K8s components outside of the capi upgrade flow. This requires updating the K8s version on the capi objects once the in-place upgrade has been done to reflect the updated k8s version on the node. This change updates the K8s version on the capi machine once the nodeupgrader object has completed the upgrade on the node associated with the corresponding capi machine for the controlplane nodes.

Description of changes:

Testing (if applicable):
Manually tested with updating the KCP controller image with one that accommodates InPlace as upgrade strategy type.

Documentation added/planned (if applicable):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 18, 2024
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (f323b9f) 71.77% compared to head (9a8953c) 71.75%.
Report is 4 commits behind head on main.

Files Patch % Lines
controllers/controlplaneupgrade_controller.go 36.84% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7325      +/-   ##
==========================================
- Coverage   71.77%   71.75%   -0.03%     
==========================================
  Files         560      560              
  Lines       43495    43513      +18     
==========================================
+ Hits        31220    31223       +3     
- Misses      10556    10566      +10     
- Partials     1719     1724       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eks-distro-bot eks-distro-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 18, 2024
@rahulbabu95 rahulbabu95 force-pushed the inplace/update-capi-machine-version branch from 481607c to a518b9d Compare January 23, 2024 02:30
@eks-distro-bot eks-distro-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 23, 2024
Signed-off-by: Rahul Ganesh <[email protected]>
log.Info("Updating K8s version in machine", "Machine", machine.Name)
machine.Spec.Version = &nodeUpgrade.Spec.KubernetesVersion
if err := machinePatchHelper.Patch(ctx, machine); err != nil {
return fmt.Errorf("updating status for machine %s: %v", machine.Name, err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("updating status for machine %s: %v", machine.Name, err)
return fmt.Errorf("updating spec for machine %s: %v", machine.Name, err)

Right?

Signed-off-by: Rahul Ganesh <[email protected]>
Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

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

/lgtm
/woof

@eks-distro-bot
Copy link
Collaborator

@abhinavmpandey08: dog image

In response to this:

/lgtm
/woof

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rahulbabu95
Copy link
Member Author

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rahulbabu95

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

@rahulbabu95
Copy link
Member Author

/override codecov/patch

@eks-distro-bot
Copy link
Collaborator

@rahulbabu95: /override requires failed status contexts, check run or a prowjob name to operate on.
The following unknown contexts/checkruns were given:

  • codecov/patch

Only the following failed contexts/checkruns were expected:

  • eks-anywhere-cli-attribution-presubmit
  • eks-anywhere-cluster-controller-tooling-presubmit
  • eks-anywhere-e2e-presubmit
  • eks-anywhere-presubmit
  • lint
  • tide

If you are trying to override a checkrun that has a space in it, you must put a double quote on the context.

In response to this:

/override codecov/patch

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rahulbabu95 rahulbabu95 merged commit e616a36 into aws:main Jan 23, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants