You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Apply operation fails with the following error:
If the object is empty, we avoid setting an empty affinity, which leads to issue
while patching the pod later.
client.Apply: Pod "pod-name" is invalid: spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`,`spec.initContainers[*].image`,`spec.a
ctiveDeadlineSeconds`,`spec.tolerations` (only additions to existing tolerations),`spec.terminationGracePeriodSeconds` (allow it to be set to 1 if it was previously negative)
core.PodSpec{
... // 15 identical fields
Subdomain: "",
SetHostnameAsFQDN: nil,
- Affinity: &core.Affinity{},+ Affinity: nil,
SchedulerName: "default-scheduler",
... // 13 identical fields
}
Using k8s.io/client-go v0.28.8
This can be fixed by setting the affinity to nil when creating the pod (instead of setting the zero-value).
However, I'm wondering if this should be handled by client-go (this seems to be implemented in apimachinery).
What do you think?
The text was updated successfully, but these errors were encountered:
I've been keen to learn Go and more about Kubernetes - so challenged myself to put together a reproduction of this.
How do we progress to getting an opinion on whether there is anything to fix in client-go? @liggitt you seem active in this project recently - any ideas? Is this issue raised in the wrong project?
When creating a pod:
When trying to later update it by using ExtractPodInfo:
The Apply operation fails with the following error:
Using
k8s.io/client-go v0.28.8
This can be fixed by setting the affinity to
nil
when creating the pod (instead of setting the zero-value).However, I'm wondering if this should be handled by client-go (this seems to be implemented in apimachinery).
What do you think?
The text was updated successfully, but these errors were encountered: