-
Notifications
You must be signed in to change notification settings - Fork 49
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
K0sControlPlane admission webhook #807
base: main
Are you sure you want to change the base?
Conversation
2195d6b
to
db4c512
Compare
d11ab59
to
325d339
Compare
if kcp.Spec.UpdateStrategy == v1beta1.UpdateRecreate { | ||
|
||
// If the cluster is running in single mode, we can't use the Recreate strategy | ||
if kcp.Spec.K0sConfigSpec.Args != nil { | ||
for _, arg := range kcp.Spec.K0sConfigSpec.Args { | ||
if arg == "--single" { | ||
return fmt.Errorf("UpdateStrategy Recreate strategy is not allowed when the cluster is running in single mode") | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this block from machine scale reconciliation?
I am trying to test the webhook by deploying the development version but it doesn't seem to run, even though I force an error with |
@makhov do I need something additional? how about adding an e2e test validating the webhook operation? |
Yeah, I was thinking about adding e2e test once we have envtest in place, but we haven't proceed with it yet, so I need to make something up. |
once this PR is merged I can add some test for this validation logic |
41a3cce
to
ffdd7d9
Compare
Signed-off-by: Alexey Makhov <[email protected]>
Signed-off-by: Alexey Makhov <[email protected]>
Signed-off-by: Alexey Makhov <[email protected]> Signed-off-by: makhov <[email protected]>
ffdd7d9
to
146609e
Compare
A simple admission webhook that declines clusters in single mode and update strategy "Recreate"