KUDO init --dry-run Should Succeed Regardless of Cluster has CRDs or Not
kudo v0.15.0+
If you have kudo init a cluster and then need to work with or create manifests... it fails with:
go run cmd/kubectl-kudo/main.go init --unsafe-self-signed-webhook-ca --version dev --dry-run -o yaml
Errors
CRD operators.kudo.dev is already installed. Did you mean to use --upgrade?
KUDO manager kudo-system/kudo-controller-manager seems to be installed. Did you mean to use --upgrade
Error: failed to verify installation requirements
exit status 255
If the cluster was new this does NOT happen. The --dry-run isn't changing anything and we should be able to get an output without this validation error. The solution is to change KUBECONFIG or clear cluster :(
We need to have a verify flag... or change it. when turning off verify it still fails.
go run cmd/kubectl-kudo/main.go init --unsafe-self-signed-webhook-ca --version dev --dry-run -o yaml --verify=false
--upgrade fixes it... but this is NOT a good UX
there's challenge with cert-manager related resources. @ANeumann82 can fill in the details since he pointed it out
this really bugs me a lot, I am used to being able to get the yaml out of the CLI and hitting this all the time :(
./bin/kubectl-kudo init --version 0.15.0 -o yaml --dry-run
Errors
CRD operators.kudo.dev is already installed. Did you mean to use --upgrade?
Error: failed to verify installation requirements
I'm not sure how to fix this, to be honest. From what I see when have these options:
- Change
kudo initto silently upgrade an existing installation. I feel this is a bad idea, but I might be alone with this opinion. - Change
kudo init --dry-run -o yamlto implicitly use--upgradeif it's not specified. I don't like it, because it changes the behaviour depending on the parameters.
If there is a third option, i'd love to hear it.
I do agree that this is weird when uninstalling KUDO, because we now need users to run kudo init --upgrade --dry-run -o yaml | kubectl delete -f - which is a mouthful. But I'd rather implement something like kudo init --uninstall, to be honest