Description
What happened:
Spawned from #94121
Running kubectl diff server side errors out due to the internal data types being different.
# kubectl diff -f test.yaml --server-side=true
Error from server: failed to create typed patch object: errors:
.spec.limits[0].default.cpu: expected string, got &value.valueUnstructured{Value:1}
.spec.limits[0].defaultRequest.cpu: expected string, got &value.valueUnstructured{Value:0.5}
What you expected to happen:
No error should be shown, and the diff (if any) should be shown instead.
How to reproduce it (as minimally and precisely as possible):
Given the following test manifest:
apiVersion: v1
kind: LimitRange
metadata:
name: default-limit-range
spec:
limits:
- default:
cpu: 1
memory: 2Gi
defaultRequest:
cpu: 0.5
memory: 1Gi
max:
memory: 8Gi
type: Container
Apply it to the cluster:
# kubectl apply -f test.yaml
Run a diff server side:
# kubectl diff -f test.yaml --server-side=true
Error from server: failed to create typed patch object: errors:
.spec.limits[0].default.cpu: expected string, got &value.valueUnstructured{Value:1}
.spec.limits[0].defaultRequest.cpu: expected string, got &value.valueUnstructured{Value:0.5}
Anything else we need to know?:
Running kubectl apply --dry-run=server -f ...
always detects incoming changes, which might be a consequence of this issue (I can't tell for sure):
# kubectl apply -f test.yaml --dry-run=server
limitrange/default-limit-range configured (server dry run)
This issue is related to #94121, where this behavior was first observed.
Environment:
- Kubernetes version (use
kubectl version
):
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:12:48Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:04:18Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
- Cloud provider or hardware configuration: baremetal
- OS (e.g:
cat /etc/os-release
):
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
-
Kernel (e.g.
uname -a
):Linux pluto-next 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
-
Install tools:
-
Network plugin and version (if this is a network-related bug):
-
Others: