Skip to content

fix: do not print command when generating kubeconfig file

Description

Currently while generating the kubeconfig file in local, the command is printed at the top to the kubeconfig file which needs to be manually removed for the kubectl commands to work correctly.

This MR fixes this, by temporarily setting and then deleting the NO_COMMAND_PRINT env variable before and after generating the kubconfig file, if the env variable is not already set.

Testing instructions

Steps to test the changes:

  1. Checkout this branch for any cluster already setup in local
  2. Delete the kubeconfig file if already present
  3. Execute a kubectl command to trigger generating the kubeconfig file
  4. Verify that the command is not printed on top of the kubeconfig file
  5. Execute a kubectl command again
  6. Verify that the command is printed this time.

Checklist

If any of the items below is not applicable, do not remove them, but put a check in it.

  • All providers include the new feature/change
  • All affected providers can provision new clusters
  • Unit tests are added/updated
  • Documentation is added/updated
  • The TOOLS_CONTAINER_IMAGE_VERSION in ci_vars.yml is updated
  • The grove-template repository is updated

Additional context

Add any other context about the merge request here.

Edited by Kaustav Banerjee

Merge request reports