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

Bug: The Mutating method of PodResourceConsistWebhooks updates the PodAvailableConditionsAnnotation of the pod in full rather than incrementally, which may lead to the loss of existing annotations. #24

Closed
cyh-ant opened this issue Jan 3, 2024 · 0 comments · Fixed by #25
Assignees

Comments

@cyh-ant
Copy link

cyh-ant commented Jan 3, 2024

Minimal reproduce step

The steps to reproduce the bug are as follows:

  1. Apply the deployment yaml, as follow
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cyh-test1
spec:
  selector:
    matchLabels:
      app: cyh-test1
  replicas: 1
  template:
    metadata:
      labels:
        app: cyh-test1
        kusionstack.io/control: "true"
      annotations:
        pod.kusionstack.io/available-conditions: "{\"expectedFinalizers\":{\"testKind/default/test1\":\"prot.podopslifecycle.kusionstack.io/nacos-traffic\"}}"
    spec:
      containers:
      - image: nginx:latest
        name: webhook-test

Focus on the pod.kusionstack.io/available-conditions of Deployment.
2. Watch the pod annotation of above Deployment.

What did you expect to see?

The pod contains the expectedFinalizers annotations of Deployment.

What did you see instead

The actual pod yaml is show below:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    pod.kusionstack.io/available-conditions: '{}'
  creationTimestamp: "2024-01-03T07:44:09Z"
  generateName: cyh-test1-8567966c88-
  labels:
    app: cyh-test1
    kusionstack.io/control: "true"
    pod-template-hash: 8567966c88
    podopslifecycle.kusionstack.io/service-available: "1704267853"
  name: cyh-test1-8567966c88-9s9t2
  namespace: default
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: cyh-test1-8567966c88
    uid: 4036e01c-86a1-410e-a542-1c3463d81a55
  resourceVersion: "1705"
  uid: fc29d6fb-632b-46c4-aa2f-41a10c6ea2de

The pod.kusionstack.io/available-conditions annotation is empty.

What is your KusionStack components and its version?

Screenshot 2024-01-03 at 15 51 23
@WeichengWang1 WeichengWang1 self-assigned this Jan 3, 2024
@WeichengWang1 WeichengWang1 transferred this issue from KusionStack/kuperator Jan 3, 2024
@wu8685 wu8685 closed this as completed in #25 Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants