-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.Categorizes an issue or PR as relevant to SIG API Machinery.sig/appsCategorizes an issue or PR as relevant to SIG Apps.Categorizes an issue or PR as relevant to SIG Apps.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
What happened?
The divisor key in ResourceFieldRef is documented to default to 1.
However, when applying a manifest using a resourceFieldRef without specifying the divisor, then checking the spec, the divisor is set to '0'.
What did you expect to happen?
The field should either not be present when checking the manifests, or having the correct value.
How can we reproduce it (as minimally and precisely as possible)?
On a kubernetes cluster, deploy the following manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: test-divisor
name: test-divisor
spec:
replicas: 1
selector:
matchLabels:
app: test-divisor
template:
metadata:
labels:
app: test-divisor
spec:
containers:
- image: invalid-name
name: test-divisor
resources:
limits:
memory: 30M
env:
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memoryThen run
$ kubectl get deploy test-divisor -o jsonpath='{.spec.template.spec.containers[0].env[0].valueFrom.resourceFieldRef.divisor}{"\n"}'
0Anything else we need to know?
This cause problem for things like argocd which considers the application perpetually out of sync (see cilium/cilium#3063)
Kubernetes version
$ kubectl version
Client Version: v1.31.2
Kustomize Version: v5.4.2
Server Version: v1.29.10
WARNING: version difference between client (1.31) and server (1.29) exceeds the supported minor version skew of +/-1Cloud provider
None
OS version
$ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
$ uname -a
Linux framework 6.11.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000 x86_64 GNU/LinuxInstall tools
Kubespray
Container runtime (CRI) and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.Categorizes an issue or PR as relevant to SIG API Machinery.sig/appsCategorizes an issue or PR as relevant to SIG Apps.Categorizes an issue or PR as relevant to SIG Apps.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.