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

✨ Allow webhook changes to OpenStackCluster.Spec.Bastion #1070

Conversation

tobiasgiese
Copy link
Member

@tobiasgiese tobiasgiese commented Dec 4, 2021

What this PR does / why we need it:

This PR allows OpenStackCluster.Spec.Bastion to be updated (i.e., to be mutable).

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 #1054

Special notes for your reviewer:

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

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

Tobias Giese tobias.giese@daimler.com, Daimler TSS GmbH, legal info/Impressum

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 4, 2021
@netlify
Copy link

netlify bot commented Dec 4, 2021

✔️ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

🔨 Explore the source changes: ab690e0

🔍 Inspect the deploy log: https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/61af34d309b6db0007ad5eb2

😎 Browse the preview: https://deploy-preview-1070--kubernetes-sigs-cluster-api-openstack.netlify.app/print

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 4, 2021
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch from ad684bc to 301d7b8 Compare December 4, 2021 14:21
@k8s-ci-robot k8s-ci-robot 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 Dec 4, 2021
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch 4 times, most recently from 9a56fa2 to aea3643 Compare December 4, 2021 15:11
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 4, 2021
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch 5 times, most recently from e6d66f4 to 8810b36 Compare December 5, 2021 11:22
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 5, 2021
@tobiasgiese tobiasgiese changed the title ✨ Allow webhook changes to the bastion enabled flag ✨ Allow webhook changes to OpenStackCluster.Spec.Bastion Dec 5, 2021
Signed-off-by: Tobias Giese <tobias.giese@daimler.com>
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch 3 times, most recently from c68b89e to 5be9181 Compare December 5, 2021 22:02
Copy link
Contributor

@mdbooth mdbooth left a comment

Choose a reason for hiding this comment

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

Thanks for the unit tests! Couple of discussion points.

api/v1alpha4/openstackcluster_webhook_test.go Outdated Show resolved Hide resolved
api/v1alpha4/openstackcluster_webhook_test.go Outdated Show resolved Hide resolved
api/v1beta1/openstackcluster_webhook_test.go Outdated Show resolved Hide resolved
api/v1alpha4/openstackcluster_webhook_test.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2021
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch from 6c2b7f4 to a32fe32 Compare December 7, 2021 10:03
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2021
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch from a32fe32 to f81ecbf Compare December 7, 2021 10:10
Signed-off-by: Tobias Giese <tobias.giese@daimler.com>
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/allow-bastion-host-changes branch from f81ecbf to ab690e0 Compare December 7, 2021 10:17
Copy link
Contributor

@mdbooth mdbooth 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 extra test. As discussed in Slack, I was worried that allowing changes to the spec before the bastion had actually been removed could potentially introduce a race which somebody might hit if, e.g. they scripted it. This approach feels simple and correct.

wantErr: true,
},
{
name: "Disabling the OpenStackCluster.Spec.Bastion while it's running is allowed",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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

mdbooth commented Dec 7, 2021

@tobiasgiese Tests are all passing. Do you want to remove the hold?

@tobiasgiese
Copy link
Member Author

@tobiasgiese Tests are all passing. Do you want to remove the hold?

I‘m still waiting for the approve of a CAPO maintainer. Prow won‘t merge until it‘s approved.

@tobiasgiese
Copy link
Member Author

ptal @hidekazuna @jichenjc 🙂 thanks

@mdbooth
Copy link
Contributor

mdbooth commented Dec 7, 2021

@tobiasgiese Tests are all passing. Do you want to remove the hold?

I‘m still waiting for the approve of a CAPO maintainer. Prow won‘t merge until it‘s approved.

That's ok. If you remove the /hold it will merge immediately after it's approved.

@tobiasgiese
Copy link
Member Author

tobiasgiese commented Dec 7, 2021

That's ok. If you remove the /hold it will merge immediately after it's approved.

I know that 🙂 we're using Prow at work.
I like to know when my PR is going to be merged. Also, I don't like to handover the responsibility (as it's sometimes a approve-blocker for someone).

Edit: and it removes the chance to get reviews from more people. If someone approves and lgtm this PR without my hold it's going to be merged, no matter if other people have findings/concerns or not :)

@seanschneeweiss
Copy link
Contributor

/LGTM
Agree very much that the tests make it easy to review 👍

@hidekazuna
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hidekazuna, mdbooth, tobiasgiese

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2021
@hidekazuna
Copy link
Contributor

@tobiasgiese You can remove /hold if you want 😃

@tobiasgiese
Copy link
Member Author

thx @hidekazuna :)

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 8, 2021
@k8s-ci-robot k8s-ci-robot merged commit 172c23f into kubernetes-sigs:main Dec 8, 2021
@tobiasgiese tobiasgiese deleted the tobiasgiese/allow-bastion-host-changes branch December 8, 2021 09:18
@mdbooth mdbooth mentioned this pull request Feb 7, 2022
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. 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.

Bastion host is immutable on 0.5.0 while it wasnt on 0.4.0
7 participants