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

ValidateName always prints empty string as value instead of actual value #1646

Merged

Commits on Nov 23, 2021

  1. ValidateName always prints empty string as value instead of actual value

    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>
    Cedric Kienzler committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    142351c View commit details
    Browse the repository at this point in the history