Skip to content

Confusing error message suggests unsupported --kubeconfig flag #58

@ronak-701685

Description

@ronak-701685

What happened?

When running crossplane-diff without explicitly setting a kubeconfig, the tool fails with an error message that references unsupported flags:

W0926 ... Neither --kubeconfig nor --master was specified...
...
crossplane-diff: error: invalid configuration: no configuration has been provided

This is misleading, because crossplane-diff does not support the --kubeconfig flag. Attempting to use it results in:

crossplane-diff: error: unknown flag: --kubeconfig

How can we reproduce it?

  1. Run crossplane-diff diff without setting the KUBECONFIG environment variable and without having a default kubeconfig at ~/.kube/config.

    unset KUBECONFIG
    crossplane-diff diff
  2. Observe the following misleading error message:

    Neither --kubeconfig nor --master was specified...
    crossplane-diff: error: invalid configuration: no configuration has been provided
    
  3. Attempting to use the --kubeconfig flag as suggested:

    crossplane-diff diff --kubeconfig /path/to/config

    Results in:

    crossplane-diff: error: unknown flag: --kubeconfig
    
  4. Correct behavior is only achieved by setting the KUBECONFIG environment variable:

    export KUBECONFIG=/path/to/config
    crossplane-diff diff

This reproduces the misleading messaging and the lack of support for the --kubeconfig flag.

What environment did it happen in?

Crossplane version: v2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions