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

Remove invocation with "kubernetes" in the help #192

Merged

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Jun 8, 2024

What this PR does / why we need it

Today plugins created with TargetK8s target type have their commands visible/invocable via both tanzu <pluginname> ... and tanzu kubernetes|k8s <plugingname> ...

The form without a target prefix is available only to kubernetes target for historical and compatibility reasons, but is the predominant invocation style. Since Tanzu Platform's plugin functionality are delivered through a mix of kubernetes-targeted and nonkubernetes-targeted plugins, encouraging this more compact form is important in promoting consistent and intuitive invocation styles.

This PR removes the invocation using the kubernetes target from the help output of plugins.

Note that a plugin must be recompiled with this PR for the change to take effect. Therefore it will only start taking effect as new versions of plugins get released.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Note that I'm using the CLI build with vmware-tanzu/tanzu-cli#781 which adds a deprecation message for the invocation with the kubernetes target prefix.

Before the change this was the output of the help for the services plugin which has a target of kubernetes:

Commands for working with services, classes and claims

Usage:
  tanzu services [command]
  tanzu kubernetes services [command]

Aliases:
  services, service

Available Commands:
  bind          Bind a service to an app
  create        Create a new service
  delete        Delete a service
  get           Get a service
  list          List the available services
  type          Commands for working with service types
  unbind        Unbind a service from an app

Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
  -h, --help                help for services
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

Use "tanzu services [command] --help" for more information about a command.
Use "tanzu kubernetes services [command] --help" for more information about a command.
$ tz k8s services -h
Command "services" is deprecated, when called with the "kubernetes" prefix. Please invoke "services" directly without the "kubernetes" prefix.
Commands for working with services, classes and claims

Usage:
  tanzu services [command]
  tanzu kubernetes services [command]

Aliases:
  services, service

Available Commands:
  bind          Bind a service to an app
  create        Create a new service
  delete        Delete a service
  get           Get a service
  list          List the available services
  type          Commands for working with service types
  unbind        Unbind a service from an app

Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
  -h, --help                help for services
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

Use "tanzu services [command] --help" for more information about a command.
Use "tanzu kubernetes services [command] --help" for more information about a command.
$ tz services list -h
List the available services

Usage:
  tanzu services list [flags]
  tanzu kubernetes services list [flags]

Examples:
  tanzu services list

Flags:
  -h, --help   help for list

Global Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

After recompiling the plugin using a plugin-runtime with this PR, the help no longer shows the invocation with kubernetes:

$ tz services -h
Commands for working with services, classes and claims

Usage:
  tanzu services [command]

Aliases:
  services, service

Available Commands:
  bind          Bind a service to an app
  create        Create a new service
  delete        Delete a service
  get           Get a service
  list          List the available services
  type          Commands for working with service types
  unbind        Unbind a service from an app

Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
  -h, --help                help for services
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

Use "tanzu services [command] --help" for more information about a command.

$ tz k8s services -h
Command "services" is deprecated, when called with the "kubernetes" prefix. Please invoke "services" directly without the "kubernetes" prefix.
Commands for working with services, classes and claims

Usage:
  tanzu services [command]

Aliases:
  services, service

Available Commands:
  bind          Bind a service to an app
  create        Create a new service
  delete        Delete a service
  get           Get a service
  list          List the available services
  type          Commands for working with service types
  unbind        Unbind a service from an app

Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
  -h, --help                help for services
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

Use "tanzu services [command] --help" for more information about a command.

$ tz services list -h
List the available services

Usage:
  tanzu services list [flags]

Examples:
  tanzu services list

Flags:
  -h, --help   help for list

Global Flags:
      --context string      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
      --kubeconfig string   kubeconfig file (default is /Users/kmarc/.kube/config)
      --no-color            turn off color output in terminals

Release note

No longer show the invocation with the `kubernetes` target prefix in the help output.

Additional information

Special notes for your reviewer

Plugins should use the global target.
Plugins that still use the kubernetes target but recompile with the
latest plugin-runtime library will at least no longer show the
invocation form that uses "kubernetes" in the help messages.

Signed-off-by: Marc Khouzam <marc.khouzam@broadcom.com>
@marckhouzam marckhouzam force-pushed the feat/deprecateKubernetesTarget branch from 605fffe to a306ea4 Compare June 8, 2024 03:25
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@marckhouzam marckhouzam merged commit 30ec668 into vmware-tanzu:main Jun 10, 2024
4 checks passed
@marckhouzam marckhouzam deleted the feat/deprecateKubernetesTarget branch June 10, 2024 22:06
@marckhouzam marckhouzam added this to the v1.4.0 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants