kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.44k stars 1.26k forks source link

Overrides not working in .cluster-api/ only in .config/cluster-api #10179

Open ryjogo opened 4 months ago

ryjogo commented 4 months ago

What steps did you take and what happened?

clusterctl generate cluster k8s-management --infrastructure vsphere --kubernetes-version v1.29.1 --control-plane-machine-count 1 --worker-machine-count 1 --flavor=test -v8 --infrastructure vsphere:v1.9.0 > /dev/null

This should use overrides from ~/.cluster-api/overrides yet this wasn't found. Upon stepping through a debugger i noticed that the path at https://github.com/kubernetes-sigs/cluster-api/blob/main/cmd/clusterctl/client/repository/overrides.go#L110 was set to the $XDG_CONFIG_HOME/cluster-api location - perhaps from this change: https://github.com/kubernetes-sigs/cluster-api/pull/6913 ?

Once i moved my overrides to ~/.config/cluster-api/overrides this was then picked up:

ryan@box:~$ clusterctl generate cluster k8s-management --infrastructure vsphere --kubernetes-version v1.29.1 --control-plane-machine-count 1 --worker-machine-count 1 --flavor=test -v8 --infrastructure vsphere:v1.9.0 > /dev/null
Using configuration File="/home/ryan/.cluster-api/clusterctl.yaml"
Using Override="cluster-template-test.yaml" Provider="infrastructure-vsphere" Version="v1.9.0"
...

What did you expect to happen?

According to the docs, overrides can be picked up from both ~/.cluster-api/overrides or ~/.config/cluster-api/overrides

Cluster API version

1.6.1

Kubernetes version

No response

Anything else you would like to add?

No response

Label(s) to be applied

/kind bug /area clusterctl /area provider/vmware

fabriziopandini commented 4 months ago

/triage accepted I don't remember in detail the change for $XDG_CONFIG_HOME but we should look into it and eventually fix or improve documentation /help

k8s-ci-robot commented 4 months ago

@fabriziopandini: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

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

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/10179): >/triage accepted >I don't remember in detail the change for $XDG_CONFIG_HOME but we should look into it and eventually fix or improve documentation >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
fabriziopandini commented 2 months ago

/priority important-soon