iits-consulting / otc-auth

Open Source CLI for the Open Telekom Cloud written in go.
GNU General Public License v3.0
44 stars 4 forks source link

fix(config): use the correct schema in the kube config file #91

Closed aazon closed 4 months ago

aazon commented 4 months ago

Currently, there are a few issues when I want the otc-auth tool to obtain CCE credentials and output them so that I can forward the output into a file:

otc-auth cce get-kube-config \
    --cluster "${TF_VAR_context}-${TF_VAR_stage}" \
    --days-valid 7 \
    --output \
> kubeconfig.yaml
  1. The otc-auth outputs the config file to STDERR, which already may contain log messages. That makes the kubeconfig.yaml not readable by kubectl.
  2. Even if there are no logs in the STDERR, the format of the generated JSON(YAML) is incompatible with the kubectl tool.

This pull request solves both of the above issues.