vmware-tanzu / tanzu-cli

The Tanzu Core CLI project provides the core functionality of the Tanzu CLI. The CLI is based on a plugin architecture where CLI command functionality can be delivered through independently developed plugin binaries
Apache License 2.0
35 stars 22 forks source link

Add flags validation check to error if `--kubeconfig` flag is specified while creating tanzu context type using `--type` flag #786

Closed prkalle closed 3 months ago

prkalle commented 3 months ago

What this PR does / why we need it

This PR adds validation check to error if --kubeconfig flag is specified while creating tanzu context type using --type flag

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Tested creating the tanzu context by providing both --type tanzu and --kubeconfig flags, CLI throws error as expected.

❯ ./bin/tanzu context create testTAPSaaSBeta3Prod --type tanzu  --kubeconfig ~/junk/config.yaml
[x] : the '–-kubeconfig' flag is not applicable when creating a context of type 'tanzu'

Tested creating the tanzu context by providing both --type tanzu and --kubecontext flags, CLI throws error as expected.

❯ ./bin/tanzu context create  --type tanzu  --kubecontext test
[x] : the '–-kubecontext' flag is not applicable when creating a context of type 'tanzu

Release note

Additional information

Special notes for your reviewer