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

Machine and KubeadmControlPlane disagree on k8s version validation #3128

Closed
mboersma opened this issue Jun 2, 2020 · 7 comments · Fixed by #3147
Closed

Machine and KubeadmControlPlane disagree on k8s version validation #3128

mboersma opened this issue Jun 2, 2020 · 7 comments · Fixed by #3147
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@mboersma
Copy link
Contributor

mboersma commented Jun 2, 2020

What steps did you take and what happened:

Generate a machinepool-flavored cluster manifest:

clusterctl config cluster capz-machinepool -f machinepool --worker-machine-count 1 --kubernetes-version 1.18.3 > capz-machinepool.yaml

Then apply the manifest and get a validation error on the "version" field:

% k apply -f capz-machinepool.yaml 
cluster.cluster.x-k8s.io/capz-machinepool unchanged
azurecluster.infrastructure.cluster.x-k8s.io/capz-machinepool unchanged
azuremachinetemplate.infrastructure.cluster.x-k8s.io/capz-machinepool-control-plane created
machinepool.exp.cluster.x-k8s.io/capz-machinepool-mp-0 unchanged
azuremachinepool.exp.infrastructure.cluster.x-k8s.io/capz-machinepool-mp-0 unchanged
kubeadmconfig.bootstrap.cluster.x-k8s.io/capz-machinepool-mp-0 created
The KubeadmControlPlane "capz-machinepool-control-plane" is invalid: spec.version: Invalid value: "": spec.version in body should match '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$'

Adding a v prefix to v1.18.3 in the manifest fixes it, but note that:

What did you expect to happen:

I expected that CAPZ and clusterctl would create a valid manifest without built-in validation errors. Perhaps clusterctl itself should have errored rather than allow "1.18.3" through.

Anything else you would like to add:

Environment:

  • Cluster-api version: v0.3.6
  • Minikube/KIND version: KIND v0.7.0
  • Kubernetes version: (use kubectl version): v1.18.3
  • OS (e.g. from /etc/os-release):

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

@vincepri
Copy link
Member

vincepri commented Jun 2, 2020

Let's reconcile the two and make sure they adhere to the same standard

cc @CecileRobertMichon @juan-lee

@CecileRobertMichon
Copy link
Contributor

Is there a reason why both 1.18.3 and v1.18.3 can't be valid? It worked fine before that validation was added so is it possible that requiring the v prefix is an artificial requirement? cc @randomvariable

@randomvariable
Copy link
Member

The decision was as a result of
#2691 (comment)

I did originally have it defaulting to add the v prefix for you.

@CecileRobertMichon
Copy link
Contributor

/assign

@CecileRobertMichon
Copy link
Contributor

/retitle "Machine and KubeadmControlPlane disagree on k8s version validation"

@k8s-ci-robot k8s-ci-robot changed the title MachinePool and KubeAdmControlPlane disagree on k8s version validation "Machine and KubeadmControlPlane disagree on k8s version validation" Jun 8, 2020
@CecileRobertMichon
Copy link
Contributor

/retitle Machine and KubeadmControlPlane disagree on k8s version validation

@k8s-ci-robot k8s-ci-robot changed the title "Machine and KubeadmControlPlane disagree on k8s version validation" Machine and KubeadmControlPlane disagree on k8s version validation Jun 8, 2020
@vincepri
Copy link
Member

vincepri commented Jun 8, 2020

/milestone v0.3.7

@k8s-ci-robot k8s-ci-robot added this to the v0.3.7 milestone Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants