Deployment/update error map: map[] does not contain declared merge key: name
See original GitHub issueWhen 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:
- Created 4 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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[]@lennartschoch I will check tonight your merge commit 👍 .