Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show diffs in HierarchicalResourceQuota resources and manifests #394

Open
summerwind opened this issue Sep 19, 2024 · 2 comments
Open
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@summerwind
Copy link

I found a case where there is always a diff between the HierarchicalResourceQuota resource and the manifest.
The following manifest can be used to reproduce the problem.

apiVersion: hnc.x-k8s.io/v1alpha2
kind: HierarchicalResourceQuota
metadata:
  name: default
  namespace: default
spec:
  hard:
    count/replicasets.apps: 1000

After applying the above manifest, the diffs obtained using kubectl diff command are as follows. It seems that the values are always diffed by replacing them with SI units.

$ kubectl diff -f hrq.yaml
diff -u -N /var/folders/5l/b5vxg_4x5mj_ty2lvlnslbph0000gp/T/LIVE-460512288/hnc.x-k8s.io.v1alpha2.HierarchicalResourceQuota.default.default /var/folders/5l/b5vxg_4x5mj_ty2lvlnslbph0000gp/T/MERGED-1098353043/hnc.x-k8s.io.v1alpha2.HierarchicalResourceQuota.default.default
--- /var/folders/5l/b5vxg_4x5mj_ty2lvlnslbph0000gp/T/LIVE-460512288/hnc.x-k8s.io.v1alpha2.HierarchicalResourceQuota.default.default	2024-09-19 16:19:25
+++ /var/folders/5l/b5vxg_4x5mj_ty2lvlnslbph0000gp/T/MERGED-1098353043/hnc.x-k8s.io.v1alpha2.HierarchicalResourceQuota.default.default	2024-09-19 16:19:25
@@ -5,14 +5,14 @@
     kubectl.kubernetes.io/last-applied-configuration: |
       {"apiVersion":"hnc.x-k8s.io/v1alpha2","kind":"HierarchicalResourceQuota","metadata":{"annotations":{},"name":"default","namespace":"default"},"spec":{"hard":{"count/replicasets.apps":1000}}}
   creationTimestamp: "2024-09-19T07:19:21Z"
-  generation: 3
+  generation: 4
   name: default
   namespace: default
   resourceVersion: "39813"
   uid: e997b707-8c33-45f6-ab01-37e4574baeec
 spec:
   hard:
-    count/replicasets.apps: 1k
+    count/replicasets.apps: 1000
 status:
   hard:
     count/replicasets.apps: 1k

The replacement to SI units is also done in ResourceQuota, but the following definition of ResourceQuota will not show any difference using kubectl diff.

apiVersion: v1
kind: ResourceQuota
metadata:
  name: default
  namespace: default
spec:
  hard:
    count/replicasets.apps: 1000

This difference in behavior causes problems with GitOps constantly causing manifest synchronization.
Is this HierarchicalResourceQuota resource behavior intended?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 18, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants