Skip to content

Bug_fix: validate non-nil AzureMachine.Spec.Diagnostic when upgrading to v1beta1#2961

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
nawazkh:fix_upgrade_errors_diagonostics
Dec 22, 2022
Merged

Bug_fix: validate non-nil AzureMachine.Spec.Diagnostic when upgrading to v1beta1#2961
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
nawazkh:fix_upgrade_errors_diagonostics

Conversation

@nawazkh
Copy link
Copy Markdown
Member

@nawazkh nawazkh commented Dec 20, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2952

Special notes for your reviewer:

  • When upgrading from v1alpha4 -> v1beta1, AzureMachine CR gets updated upon cluster upgrade via the defaulter.
    This upgrade updates AzureMachine.Spec.Diagnostics to "Managed", matching the existing behavior as implemented in ✨ Enable VM boot diagnostics #901.
  • Without this fix, the validator webhook would not allow updating the AzureMachine.Spec.
  • This PR enables upgrading nil AzureMachine.Spec.Diagnostic to "Managed" and unblocks v1alpha4 -> v1beta1 upgrades.

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 20, 2022
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/test ls

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@nawazkh: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-azure-build
  • /test pull-cluster-api-provider-azure-ci-entrypoint
  • /test pull-cluster-api-provider-azure-e2e
  • /test pull-cluster-api-provider-azure-test
  • /test pull-cluster-api-provider-azure-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-azure-apidiff
  • /test pull-cluster-api-provider-azure-apiversion-upgrade
  • /test pull-cluster-api-provider-azure-capi-e2e
  • /test pull-cluster-api-provider-azure-conformance
  • /test pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-e2e-csi-migration
  • /test pull-cluster-api-provider-azure-e2e-exp
  • /test pull-cluster-api-provider-azure-e2e-optional
  • /test pull-cluster-api-provider-azure-e2e-workload-upgrade
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts-serial-slow

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-azure-apidiff
  • pull-cluster-api-provider-azure-build
  • pull-cluster-api-provider-azure-ci-entrypoint
  • pull-cluster-api-provider-azure-e2e
  • pull-cluster-api-provider-azure-test
  • pull-cluster-api-provider-azure-verify
Details

In response to this:

/test ls

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.

@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/test pull-cluster-api-provider-azure-apiversion-upgrade

@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/retest

1 similar comment
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/retest

@nawazkh nawazkh force-pushed the fix_upgrade_errors_diagonostics branch from d0419b0 to 4a85051 Compare December 20, 2022 23:18
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/retitle Bug_fix: validate non-nil AzureMachine.Spec.Diagnostic when upgrading to v1beta1

@k8s-ci-robot k8s-ci-robot changed the title WIP testing Bug_fix: validate non-nil AzureMachine.Spec.Diagnostic when upgrading to v1beta1 Dec 20, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 20, 2022
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 20, 2022

/test pull-cluster-api-provider-azure-apiversion-upgrade

@CecileRobertMichon
Copy link
Copy Markdown
Contributor

Thank you for fix @nawazkh, great investigation work 🕵️👏

Copy link
Copy Markdown
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2022
Copy link
Copy Markdown
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

Can we add a test case for oldMachine: nil and newMachine has Spec.Diagnostic to TestAzureMachine_ValidateUpdate?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 21, 2022
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 21, 2022

Can we add a test case for oldMachine: nil and newMachine has Spec.Diagnostic to TestAzureMachine_ValidateUpdate?

Added via commit 56d0cf0. Will be squashing the commits in a bit.

- when upgrading from v1alpha4 -> v1beta1, AzureMachine CRD gets updated upon cluster upgrade.
This upgrade updates AzureMachine.Spec.Diagnostics to "Managed", matching the existing behavior as implemented in kubernetes-sigs#901

- This PR enables upgrading nil AzureMachine.Spec.Diagnostic to "Managed" and unblocks v1alpha4 -> v1beta1 upgrades.
- adds test cases to test validateUpdate() in case of nil AzureMachine.Spec.Diagnostics
@nawazkh nawazkh force-pushed the fix_upgrade_errors_diagonostics branch from 56d0cf0 to d92ea9a Compare December 21, 2022 20:45
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 21, 2022

/test pull-cluster-api-provider-azure-apiversion-upgrade

@nawazkh nawazkh requested a review from mboersma December 21, 2022 22:29
@nawazkh nawazkh requested review from CecileRobertMichon and mboersma and removed request for CecileRobertMichon and mboersma December 21, 2022 22:29
Copy link
Copy Markdown
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks for the unit test additions! 💚

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 21, 2022
@CecileRobertMichon
Copy link
Copy Markdown
Contributor

/lgtm
/approve

Thank you @mboersma for reminding us to add tests 🙌

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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

The pull request process is described here

Details 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 21, 2022
@nawazkh
Copy link
Copy Markdown
Member Author

nawazkh commented Dec 22, 2022

/retest

@k8s-ci-robot k8s-ci-robot merged commit 27ff8d7 into kubernetes-sigs:main Dec 22, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Dec 22, 2022
@nawazkh nawazkh deleted the fix_upgrade_errors_diagonostics branch August 31, 2023 20:48
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

Non-nil default AzureMachine spec.diagnostics breaks v1alpha4 -> v1beta1 upgrade test

4 participants