Skip to content

Delete the propagation.karmada.io/instruction label #6512

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XiShanYongYe-Chang
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang commented Jul 4, 2025

What type of PR is this?

/kind deprecation

What this PR does / why we need it:

ref #6437

Which issue(s) this PR fixes:

Fixes #6437

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`Deprecation`: The deprecated label `propagation.karmada.io/instruction`, which was designed to suspend Work propagation, has now been removed.

@karmada-bot karmada-bot added the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Jul 4, 2025
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 4, 2025
@XiShanYongYe-Chang
Copy link
Member Author

Hi @vie-serendipity @RainbowMango can you help take a review?

/cc @vie-serendipity @RainbowMango

@karmada-bot karmada-bot requested a review from RainbowMango July 4, 2025 02:08
@karmada-bot
Copy link
Collaborator

@XiShanYongYe-Chang: GitHub didn't allow me to request PR reviews from the following users: vie-serendipity.

Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Hi @vie-serendipity @RainbowMango can you help take a review?

/cc @vie-serendipity @RainbowMango

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-sigs/prow repository.

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from f574b9c to fb6b299 Compare July 4, 2025 02:20
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 23.07692% with 20 lines in your changes missing coverage. Please review.

Project coverage is 45.41%. Comparing base (f4919ab) to head (027741b).

Files with missing lines Patch % Lines
pkg/controllers/execution/execution_controller.go 0.00% 9 Missing ⚠️
pkg/controllers/status/work_status_controller.go 0.00% 9 Missing ⚠️
cmd/controller-manager/app/controllermanager.go 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6512      +/-   ##
==========================================
- Coverage   45.43%   45.41%   -0.02%     
==========================================
  Files         687      687              
  Lines       56335    56296      -39     
==========================================
- Hits        25596    25568      -28     
+ Misses      29140    29132       -8     
+ Partials     1599     1596       -3     
Flag Coverage Δ
unittests 45.41% <23.07%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from fb6b299 to f574b9c Compare July 4, 2025 03:39
@XiShanYongYe-Chang XiShanYongYe-Chang changed the title Delete hte propagation.karmada.io/instruction label Delete the propagation.karmada.io/instruction label Jul 4, 2025
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from f574b9c to 2f2584b Compare July 4, 2025 06:11
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from 2f2584b to c43fcff Compare July 4, 2025 08:12
@vie-serendipity
Copy link
Contributor

/lgtm

@karmada-bot
Copy link
Collaborator

@vie-serendipity: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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-sigs/prow repository.

@XiShanYongYe-Chang
Copy link
Member Author

/cc @RainbowMango

@XiShanYongYe-Chang
Copy link
Member Author

/assign @RainbowMango

@RainbowMango RainbowMango added this to the v1.15 milestone Jul 10, 2025
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from c43fcff to fc23cc5 Compare July 10, 2025 12:26
@karmada-bot
Copy link
Collaborator

[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 ask for approval from rainbowmango. For more information see the Kubernetes Code Review Process.

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

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

@RainbowMango
Copy link
Member

/gemini review

@RainbowMango RainbowMango requested a review from Copilot July 10, 2025 12:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the deprecated propagation.karmada.io/instruction label and related functionality that was used to suppress Work propagation. The functionality has been replaced by the spec.suspendDispatching field in the Work API.

  • Removes the deprecated PropagationInstruction and PropagationInstructionSuppressed constants from util package
  • Eliminates checks for the deprecated label from predicate functions and controllers
  • Updates tests to use spec.suspendDispatching instead of the deprecated label
  • Renames and simplifies predicate functions to remove agent-specific variants

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/util/constants.go Removes deprecated PropagationInstruction and PropagationInstructionSuppressed constants
pkg/util/helper/predicate.go Removes deprecated label checks and eliminates NewExecutionPredicateOnAgent function
pkg/util/helper/predicate_test.go Updates tests to use spec.suspendDispatching and removes deprecated label test cases
pkg/controllers/status/work_status_controller.go Removes deprecated label check and renames predicate field
pkg/controllers/status/work_status_controller_test.go Updates test configurations with renamed predicate field
pkg/controllers/execution/execution_controller.go Renames predicate field from PredicateFunc to WorkPredicateFunc
pkg/controllers/ctrlutil/work.go Removes conditional logic based on deprecated label
pkg/controllers/ctrlutil/work_test.go Removes test case for deprecated label functionality
cmd/controller-manager/app/controllermanager.go Updates controller initialization to use renamed predicate function
cmd/agent/app/agent.go Removes predicate function assignment for agent controllers

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the deprecated propagation.karmada.io/instruction label and its associated logic. The renaming of functions and variables improves code clarity. A check for spec.suspendDispatching is needed in work_status_controller.go to prevent unintended resource recreation when dispatching is suspended.

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from fc23cc5 to 7ff8015 Compare July 11, 2025 02:05
@karmada-bot karmada-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2025
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from 7ff8015 to c861bc5 Compare July 15, 2025 02:22
@XiShanYongYe-Chang
Copy link
Member Author

/retest

@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 17, 2025
@XiShanYongYe-Chang
Copy link
Member Author

@gemini-code-assist
Any further comments on this pr?

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The code changes introduce the removal of the deprecated propagation.karmada.io/instruction label. The changes are consistent across the codebase, and the renames of functions and fields like NewExecutionPredicate to WorkWithinPushClusterPredicate significantly improve clarity. There are some suggestions to improve the consistency of naming in the test files.

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from c861bc5 to e914175 Compare July 17, 2025 02:31
@XiShanYongYe-Chang
Copy link
Member Author

/retest

InformerManager: genericmanager.GetInstance(),
WorkPredicateFunc: helper.AllowAllPredicate(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still feel not good to have a dummy event handler, it's waste for controller-runtime to filter events with a non-opt handler.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can refactor the SetupWithManager method in thecontroller like:

	ctrlBuilder := controllerruntime.NewControllerManagedBy(mgr).
		Named(ControllerName)

	if c.WorkPredicateFunc != nil {
		ctrlBuilder = ctrlBuilder.For(&workv1alpha1.Work{}, builder.WithPredicates(c.WorkPredicateFunc))
	} else {
		// In the case of this controller running in karmada-agent,
		// usually no event filter (predicate) is needed.
		ctrlBuilder = ctrlBuilder.For(&workv1alpha1.Work{})
	}

	return ctrlBuilder.
		WithEventFilter(predicate.GenerationChangedPredicate{}).
		WithOptions(controller.Options{
			RateLimiter: ratelimiterflag.DefaultControllerRateLimiter[controllerruntime.Request](c.RateLimiterOptions),
		}).
		Complete(c)

You no longer need to define or pass a dummy predicate function that always returns true. This reduces boilerplate and potential confusion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the remove-instruction-label branch from e914175 to 027741b Compare July 18, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete the propagation.karmada.io/instruction label
5 participants