-
Notifications
You must be signed in to change notification settings - Fork 107
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
Make some recently required bool parameters optional #650
Conversation
But keep the default of `false`, so that the value can effectively be set to `false` in k8s storage. VaultConnection's skipTLSVerify was set to required in v0.4.3, and the secret destination options were added in v0.5.0.
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.
I'm supportive of this approach 👍 it always looked a bit wrong to me that these parameters were marked as required
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.
We should revert the change made to SkipTLSVerify, after that +1
api/v1beta1/vaultconnection_types.go
Outdated
@@ -22,7 +22,7 @@ type VaultConnectionSpec struct { | |||
CACertSecretRef string `json:"caCertSecretRef,omitempty"` | |||
// SkipTLSVerify for TLS connections. | |||
// +kubebuilder:default=false | |||
SkipTLSVerify bool `json:"skipTLSVerify"` | |||
SkipTLSVerify bool `json:"skipTLSVerify,omitempty"` |
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.
I think this one we want to keep as-is. We made this change under #527 - to avoid an issue with Rancher.
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.
We can certainly do that, especially since this has been in place since v0.4.3.
FWIW in my testing this behaves the same with or without omitempty
when there's a default set. If the parameter is set to true/false in the CRD spec it comes back on a get. And if the parameter is unspecified it comes back as false
on a get. Which I think satisfies #527 and #278.
@tomhjp - yeah its unfortunate that fields with defaults are not excluded from the set of required fields, or that the validators do not take defaults into account. |
skips: | ||
- vault-secrets-operator.v0.5.0 | ||
- vault-secrets-operator.v0.5.1 |
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.
Because of these I think we'll want to use PREVIOUS_VERSION=v0.4.3 with make bundle
at release time:
make bundle VERSION=${LATEST_TAG//v} USE_IMAGE_DIGESTS=true PREVIOUS_VERSION=v0.4.3
So that the resulting build/bundle/manifests/vault-secrets-operator.clusterserviceversion.yaml
comes out like this:
skips:
- vault-secrets-operator.v0.5.0
- vault-secrets-operator.v0.5.1
version: 0.5.2
replaces: vault-secrets-operator.v0.4.3
(Just putting this up as an option to address #631 if we wish.)
Makes some currently required
bool
parameters optional, but keeps the default offalse
, so that the value can effectively be set tofalse
in k8s storage. The secret destination options were added in v0.5.0.I was able to duplicate the upgrade error in #631 on OpenShift outside of OperatorHub with
operator-sdk run bundle...
andoperator-sdk run bundle-upgrade...
, which would fail when going from v0.4.3 to v0.5.x, but succeed when going from v0.4.3 to these changes.Details for posterity:
Closes #631