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.52k stars 1.3k forks source link

Missing support for "clusterctl.cluster.x-k8s.io/move" label since v1alpha4 #9630

Closed Endevir closed 8 months ago

Endevir commented 11 months ago

What steps did you take and what happened?

Hi! I'm using custom Secret to provide credentials for OpenStack infrastructure provider. Applied manifest like this (with clusterctl.cluster.x-k8s.io/move: "true" label, according to docs):

apiVersion: v1
kind: Secret
metadata:
  name: capi-clouds-config-secret
  namespace: capi-management-cluster
  labels:
    clusterctl.cluster.x-k8s.io/move: "true"
data:
  cacert: $CACERT_BASE64
  clouds.yaml: $CLOUDS_YAML_BASE64

But during clusterctl move --to-kubeconfig=kube.yaml --namespace capi-management-cluster --dry-run -v 10

I run into this line in logs: Excluding secret from move (not linked with any Cluster) name="capi-clouds-config-secret" and have secret skipped (breaking provider reconciliation in target cluster).

What did you expect to happen?

Secret with clusterctl.cluster.x-k8s.io/move: "true" label should also be moved into target cluster

Cluster API version

1.5.3

Kubernetes version

v1.27.6

Anything else you would like to add?

Seems like tracking clusterctl.cluster.x-k8s.io/move label was dropped since v1alpha4 (API for v1alpha3 still contains ClusterctlMoveLabel mentions).

However, label still is mentioned in docs: https://cluster-api.sigs.k8s.io/clusterctl/provider-contract.html#move

Label(s) to be applied

/kind bug One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

killianmuldoon commented 11 months ago

/triage accepted

There's definitely a bug in the implementation here - thanks for catching it. I think there's two seperate issues.

  1. Secrets in the provider namespace should be moved without needing a label.
  2. Secret should not be excluded from move if they have the correct label.

AFAICT neither of these cases are working right now and we need a fix.

/help

k8s-ci-robot commented 11 months ago

@killianmuldoon: 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/9630): >/triage accepted > >There's definitely a bug in the implementation here - thanks for catching it. I think there's two seperate issues. > >1. Secrets in the provider namespace should be moved without needing a label. >2. Secret should not be excluded from move if they have the correct label. > >AFAICT neither of these cases are working right now and we need a fix. > >/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.
killianmuldoon commented 11 months ago

/triage accepted

sbueringer commented 9 months ago

@killianmuldoon Did #9694 fix (only) 1?

killianmuldoon commented 9 months ago

According to https://github.com/kubernetes-sigs/cluster-api/pull/9694#issuecomment-1803479436 both cases were working for the user. I'm not sure if it's tested properly though. I think we should add a help wanted here and get someone to ensure the tests are covering that case.

/help

fabriziopandini commented 8 months ago

https://github.com/kubernetes-sigs/cluster-api/pull/9694 should have fixed both, we can eventually re-open if someone reports issues again /close

k8s-ci-robot commented 8 months ago

@fabriziopandini: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-api/issues/9630#issuecomment-1903969127): > https://github.com/kubernetes-sigs/cluster-api/pull/9694 should have fixed both, we can eventually re-open if someone reports issues again >/close 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.