Skip to content

Conversation

@PulkitDadwal
Copy link
Contributor

Ⅰ. Describe what this PR does

This PR removes deprecated DaemonSet APIs and modernizes template generation handling to improve future Kubernetes compatibility.

Changes made:

  • Remove DeprecatedSurgingRollingUpdateType constant from daemonset_types.go
  • Clean up compatibility logic for deprecated "Surging" rolling update type in defaults
  • Update validation to only accept supported rolling update types (Standard and InPlaceIfPossible)
  • Replace deprecated annotation-based template generation with standard Kubernetes Generation field
  • Update corresponding tests to use modern generation tracking

Benefits:

  • Eliminates technical debt from deprecated API usage
  • Prepares codebase for future Kubernetes versions
  • Simplifies validation and defaulting logic
  • Uses standard Kubernetes patterns for generation tracking

Ⅱ. Does this pull request fix one issue?

fixes #2150

Ⅲ. Describe how to verify it

Build verification:

  1. Ensure all files compile without errors: make build
  2. Run unit tests: make test
  3. Verify linting passes: make lint

Functional verification:

  1. Create a DaemonSet with rollingUpdate.type: "Standard" - should work as before
  2. Create a DaemonSet with rollingUpdate.type: "InPlaceIfPossible" - should work as before
  3. Verify that deprecated "Surging" type is no longer accepted in validation
  4. Check that GetTemplateGeneration() returns the correct generation value

Code verification:

  1. Confirm DeprecatedSurgingRollingUpdateType is completely removed from codebase:
    grep -r "DeprecatedSurgingRollingUpdateType" . || echo "Not found - good!"
  2. Verify deprecated annotation usage is removed:
    grep -r "DeprecatedTemplateGeneration" . || echo "Not found - good!"

Ⅳ. Special notes for reviews

  • Backward compatibility: This change maintains backward compatibility as it only removes deprecated functionality that shouldn't be used in production
  • No breaking changes: Existing DaemonSets using Standard or InPlaceIfPossible types will continue to work unchanged
  • Test coverage: Updated existing tests to use modern patterns rather than deprecated APIs
  • Migration: Users with deprecated configurations will need to update to use Standard type instead of Surging
  • Future-proofing: This change prepares the codebase for Kubernetes versions that may remove these deprecated APIs entirely

Files to pay special attention to:

  • apis/apps/v1alpha1/daemonset_types.go - Type definition removal
  • pkg/controller/daemonset/daemonset_update.go - Logic change from annotation to Generation field
  • pkg/webhook/daemonset/validating/daemonset_validation.go - Validation logic update

Signed-off-by: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com>
Signed-off-by: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com>
…tations

Signed-off-by: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com>
@kruise-bot kruise-bot requested review from furykerry and veophi August 6, 2025 17:38
@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zmberg for approval by writing /assign @zmberg in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot added the size/M size/M: 30-99 label Aug 6, 2025
Signed-off-by: PulkitDadwal <150671733+PulkitDadwal@users.noreply.github.com>
@kruise-bot
Copy link

@PulkitDadwal: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Removed deprecated DaemonSet rolling update type and legacy template generation

2 participants