Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Object.spec.forProvider.manifest.metadata.name orphans previous resource #287

Open
Avarei opened this issue Aug 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Avarei
Copy link

Avarei commented Aug 28, 2024

What happened?

After changing the Object.spec.forProvider.manifest.metadata.name the resource with the previous name does not get deleted.

How can we reproduce it?

Create a Resource:

apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: foo
spec:
  forProvider:
    manifest:
      apiVersion: v1
      kind: ConfigMap
      metadata:
        namespace: default
        name: test1

Change the Resource

apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: foo
spec:
  forProvider:
    manifest:
      apiVersion: v1
      kind: ConfigMap
      metadata:
        namespace: default
        name: test2

run kubectl get cm -n default and observe both test1 and test2 are present.

What environment did it happen in?

Provider Kubernetes: v0.14.1
Crossplane version: v1.16.0
Kubernetes: v1.28.8

@Avarei Avarei added the bug Something isn't working label Aug 28, 2024
@bobh66
Copy link
Contributor

bobh66 commented Aug 28, 2024

I believe this is the expected behavior, at least for the current implementation. metadata.name is a "special" field since it defines the "key" to the object and the operator does not expect the key to change. That would require deleting the old Object and creating a new one with a new name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants