Skip to content

The rolling restart of a Deployment or StatefulSet removes the annotations from spec.template.metadata. #6892

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

Closed
jfreese opened this issue Feb 18, 2025 · 0 comments · Fixed by #6893
Assignees
Labels
Milestone

Comments

@jfreese
Copy link

jfreese commented Feb 18, 2025

Describe the bug

The error cased by https://github.com/fabric8io/kubernetes-client/pull/6723/commits

The patch, that is defined in io.fabric8.kubernetes.client.dsl.internal.apps.v1.RollingUpdater.requestPayLoadForRolloutRestart() replaces the hole annotations map found by /spec/template/metadata/annotations and sets the kubectl.kubernetes.io/restartedAt annotation. The patch should merge the annotations map instead.

Fabric8 Kubernetes Client version

7.1.0

Steps to reproduce

  1. Create deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
spec:
  template:
    metadata:
      annotations:
        checksum/event: 8881e757542d422d91cb41b68ff8a0ef60d6cdf22f665b68025d4762575ffb48
  1. Run client.apps().deployments().inNamespace("my-namespace").withName("test").rolling().restart()
  2. Get Deployment: annotation checksum/event is removed from deployment.

Expected behavior

  1. Create deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
spec:
  template:
    metadata:
      annotations:
        checksum/event: 8881e757542d422d91cb41b68ff8a0ef60d6cdf22f665b68025d4762575ffb48
  1. Run client.apps().deployments().inNamespace("my-namespace").withName("test").rolling().restart()
  2. Get Deployment: annotation checksum/event exists in the deployment.

Runtime

other (please specify in additional context)

Kubernetes API Server version

other (please specify in additional context)

Environment

Linux

Fabric8 Kubernetes Client Logs

Additional context

v1.30.2+k0s

@manusa manusa added the bug label Feb 18, 2025
@manusa manusa moved this to Planned in Eclipse JKube Feb 18, 2025
@manusa manusa self-assigned this Feb 19, 2025
@manusa manusa moved this from Planned to In Progress in Eclipse JKube Feb 19, 2025
@manusa manusa moved this from In Progress to Review in Eclipse JKube Feb 19, 2025
@manusa manusa added this to the 7.2.0 milestone Feb 19, 2025 — with automated-tasks
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants