Skip to content

metadata field not created after creation of resource #2727

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

Closed
akgowda opened this issue Jun 14, 2022 Discussed in #2726 · 2 comments
Closed

metadata field not created after creation of resource #2727

akgowda opened this issue Jun 14, 2022 Discussed in #2726 · 2 comments

Comments

@akgowda
Copy link

akgowda commented Jun 14, 2022

Discussed in #2726

Originally posted by akgowda June 14, 2022
I created a Deployment wrapper Controller. But the template's metadata field is empty even though I've added labels/annotations to the resource.

apiVersion: test.domain/v1
kind: DhruvaDeployment
metadata:
  name: dhruvadeployment-sample
spec:
  deploymentSpec:
    selector:
      matchLabels:
        foo: bar
    template:
      metadata:
        labels:
          foo: bar
        annotations:
          test1: testAnnot
      spec:
        containers:
          - name: app
            image: busybox
            args:
              - /bin/sh
              - -c
              - "date; echo Hello from the Kubernetes cluster; trap : TERM INT; sleep infinity & wait"



ubuntu@master-node:~$ kubectl  get dhruvadeployments.test.domain dhruvadeployment-sample -o yaml
apiVersion:test.domain/v1
kind: DhruvaDeployment
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"test.domain/v1","kind":"DhruvaDeployment","metadata":{"annotations":{},"name":"dhruvadeployment-sample","namespace":"default"},"spec":{"deploymentSpec":{"selector":{"matchLabels":{"foo":"bar"}},"template":{"metadata":{"annotations":{"test1":"testAnnot"},"labels":{"foo":"bar"}},"spec":{"containers":[{"args":["/bin/sh","-c","date; echo Hello from the Kubernetes cluster; trap : TERM INT; sleep infinity \u0026 wait"],"image":"busybox","name":"app"}]}}}}}
  creationTimestamp: "2022-06-14T10:37:34Z"
  generation: 2
  name: dhruvadeployment-sample
  namespace: default
  resourceVersion: "2426014"
  uid: 711a4a99-6537-4a18-9977-bc7d925dfa15
spec:
  deploymentSpec:
    selector:
      matchLabels:
        foo: bar
    template:
      metadata: {}
      spec:
        containers:
        - args:
          - /bin/sh
          - -c
          - 'date; echo Hello from the Kubernetes cluster; trap : TERM INT; sleep
            infinity & wait'
          image: busybox
          name: app
</div>
@FillZpp
Copy link

FillZpp commented Jun 15, 2022

https://github.com/kubernetes-sigs/controller-tools may be a better place for this issue. But you can firstly provide your DhruvaDeployment definition and its CRD generated.

@akgowda
Copy link
Author

akgowda commented Jun 15, 2022

kubernetes-sigs/controller-tools#448 an issue is already created. We can close this one as duplicate. Thanks

@akgowda akgowda closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants