-
Notifications
You must be signed in to change notification settings - Fork 234
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
ValidateName always prints empty string as value instead of actual value #1646
ValidateName always prints empty string as value instead of actual value #1646
Conversation
This commit fixes an rather annoying issue where `ValidateName` does not print the correct value of the invalid cluster name which made the issue hard to debug. Background: I recently upgraded from an earlier KubeOne version to master and my cluster-name contained dots (`.`). However since kubermatic#1641 this is no longer valid. The output of this validation looked like ```bash $ kubeone apply --manifest kubeone.yaml --credentials credentials.yaml --tfjson output.json --auto-approve --verbose Error: failed to initialize State: failed to build state: failed to load cluster: unable to load a given KubeOneCluster object: unable to validate the given KubeOneCluster object: name: Invalid value: "": .name should be lowercase and can only contain alphanumeric characters and hyphens(-) ``` With this commit in place the output looks like this: ```bash $ kubeone install --manifest kubeone.yaml --credentials credentials.yaml --tfjson output.json --verbose Error: failed to initialize State: failed to build state: failed to load cluster: unable to load a given KubeOneCluster object: unable to validate the given KubeOneCluster object: name: Invalid value: "k8s.cedi.dev": .name should be lowercase and can only contain alphanumeric characters and hyphens(-) ``` Signed-off-by: Cedric Kienzler <github@cedric-kienzler.de>
Hi @cedi. Thanks for your PR. I'm waiting for a kubermatic member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks @cedi! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cedi, kron4eg 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 |
LGTM label has been added. Git tree hash: c5a8636f4ed4adc8d40321048eff4efcd79614ed
|
/retest Review the full test history Silence the bot with an |
What this PR does / why we need it:
This commit fixes an rather annoying issue where
ValidateName
does notprint the correct value of the invalid cluster name which made the issue
hard to debug.
Background:
I recently upgraded from an earlier KubeOne version to master and my cluster-name contained dots (
.
).However since #1641 this is no longer valid.
The output of this validation looked like
$ kubeone apply --manifest kubeone.yaml --credentials credentials.yaml --tfjson output.json --auto-approve --verbose Error: failed to initialize State: failed to build state: failed to load cluster: unable to load a given KubeOneCluster object: unable to validate the given KubeOneCluster object: name: Invalid value: "": .name should be lowercase and can only contain alphanumeric characters and hyphens(-)
With this commit in place the output looks like this:
$ kubeone install --manifest kubeone.yaml --credentials credentials.yaml --tfjson output.json --verbose Error: failed to initialize State: failed to build state: failed to load cluster: unable to load a given KubeOneCluster object: unable to validate the given KubeOneCluster object: name: Invalid value: "k8s.cedi.dev": .name should be lowercase and can only contain alphanumeric characters and hyphens(-)
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 #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: