Cluster-api: [clusterctl] log when using overrides for clusterctl

Created on 18 Mar 2020  路  11Comments  路  Source: kubernetes-sigs/cluster-api

When using overrides, clusterctl should log a warning/info message. Right now it's very easy for someone switching back and forth between dev and user to forget to remove overrides and deploy a cluster the wrong controller-manager image.

good first issue help wanted prioritimportant-soon

All 11 comments

/good-first-issue
/help

@CecileRobertMichon:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue
/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

current log only shows with -v 1 https://github.com/kubernetes-sigs/cluster-api/blob/master/cmd/clusterctl/client/repository/components_client.go#L74

Maybe it should be a warning? Or just changed to -v 0

/assign

@CecileRobertMichon We can just remove the Verbosity part and just log the info rather than setting -v 0 right?

HI @prankul88,

It shows correct, however, I never contribute with this project.

@camilamacedo86 Sorry I tagged you by mistake.

@prankul88 correct, I think just removing the v(1) should work since it's v 0 by default

Unfortunately, this can cause problems to ./bin/clusterctl config provider --infrastructure aws -o yaml, because this is going to prepend logs to the yaml (same for other commands ruturning yaml)

Using Override="infrastructure-components.yaml" Provider="infrastructure-aws" Version="v0.5.0"
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
...

So as per https://github.com/kubernetes-sigs/cluster-api/pull/2717#issuecomment-607518818, before implementing this, we should explore different solutions like log to stderr in case of commands generating yaml output (this is what kubectl does)

@CecileRobertMichon Can we close this?

@prankul88 was it fixed? It looks like your PR got closed

Was this page helpful?
0 / 5 - 0 ratings