question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deployment/update error map: map[] does not contain declared merge key: name

See original GitHub issue

When i deploy the first time with k8s deploy everything works fine. But when i deploy the second time i get the following error:

error calculating patch from openapi spec: map: map[] does not contain declared merge key: name

Strange though that when i deploy localy the firsttime with kubectl and update everything works fine. But when k8s has deployed i even can not update with local kubectl i get the same error.

Any ideas what this could be?

This is the deployment yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
  labels:
    app: test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test
  strategy:
    type: RollingUpdate
  template:
    metadata:
      name: test
      labels:
        app: test
    spec:
      securityContext:
        runAsGroup: 33
        fsGroup: 33
      volumes:
        - name: nfs-bucket
          persistentVolumeClaim:
            claimName: nfs-bucket
      containers:
        - name: test
          image: niek/test:develop
          imagePullPolicy: Always
          volumeMounts:
            - name: nfs-bucket
              mountPath: "/var/www/bucket"
          envFrom:
            - secretRef:
                name: test-secret
          ports:
            - name: 80tcp01
              containerPort: 80
              protocol: TCP
          stdin: true
          tty: true
      imagePullSecrets:
        - name: dockerhub

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thesattirajucommented, Dec 10, 2019

I suppose the issue is because of the imagepullrequests section in your deployment.yaml

If you’re adding extra image pull secrets in the workflow; it ends up converting the single image pull secret which is like this "imagePullSecrets":{"name":"n1"} to "imagePullSecrets":[{"name":"n1"},{"name":"n2"}] the edit fails because of the conversion of object to object[]

1reaction
niekappartmediacommented, Dec 2, 2019

@lennartschoch I will check tonight your merge commit 👍 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix 'map[] does not contain declared merge key: name ...
Kubefed init says "waiting for the federation control plane to come up" but it never comes up, so I checked the pod status...
Read more >
No Declared merge key error when trying to modify ... - Edureka
A copy of your changes has been stored to "/tmp/kubectl-edit-hv5dh.yaml" error: map: map[] does not contain declared merge key: name.
Read more >
Error kubectl edit deployment during configuration of ...
"A copy of your changes has been stored to "/tmp/kubectl-edit-hv5dh.yaml" error: map: map[] does not contain declared merge key: name".
Read more >
k8s 部署deploy报“does not contain declared merge key: name“
问题描述使用k8s python-client 请求patch deploy接口的时候,接口报500的错误排查思路及过程看了一下代码的报错map[cpu:48 memory:256Gi] ...
Read more >
Performing a Rolling Update - Kubernetes
Objectives Perform a rolling update using kubectl. Updating an application Users expect applications to be available all the time and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found