Skip to content

Revert "Add MustCreate management policy"#933

Merged
phisco merged 1 commit intocrossplane:mainfrom
lsviben:revert-873
Feb 17, 2026
Merged

Revert "Add MustCreate management policy"#933
phisco merged 1 commit intocrossplane:mainfrom
lsviben:revert-873

Conversation

@lsviben
Copy link
Contributor

@lsviben lsviben commented Feb 17, 2026

This reverts commit af8c3fb, reversing changes made to a4cdda4.

Description of your changes

Reverts #874

Discussed with @bobh66 in Crossplane Slack. We would like to hold off on changes to management policies until we find a better aligned solution.

Ref: #930

Fixes #

I have:

Need help with this checklist? See the cheat sheet.

…olicy"

This reverts commit af8c3fb, reversing
changes made to a4cdda4.

Signed-off-by: lsviben <sviben.lovro@gmail.com>
@lsviben lsviben requested a review from a team as a code owner February 17, 2026 13:31
@lsviben lsviben requested a review from phisco February 17, 2026 13:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

This PR systematically removes the MustCreate management action variant and all associated functionality from the codebase, including policy handling logic, helper functions, interface methods, and test coverage.

Changes

Cohort / File(s) Summary
API Definitions
apis/common/policies.go, apis/common/v1/policies.go
Removed ManagementActionMustCreate constant and its public alias; updated kubebuilder validation enum to exclude MustCreate from allowed policy actions.
Helper Functions
pkg/meta/meta.go, pkg/meta/meta_test.go
Removed ExternalCreateNotStarted() function that checked if external resource creation had not started, along with its complete test coverage.
Policy and Reconciliation Logic
pkg/reconciler/managed/policies.go, pkg/reconciler/managed/reconciler.go
Removed MustCreate() method from ManagementPoliciesResolver and ManagementPoliciesChecker interface; removed MustCreate from default policy sets and reconciliation logic that depended on it; simplified ShouldCreate() to check only for Create or All policies.
Test Coverage
pkg/reconciler/managed/reconciler_legacy_test.go, pkg/reconciler/managed/reconciler_modern_test.go
Removed four test cases that validated MustCreate behavior: two testing successful creation under MustCreate policy, and two testing error conditions when resources exist with MustCreate policy.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • crossplane-runtime#931: Removes a different ManagementAction variant (Orphan) through similar pattern of updates to policy enum and handling logic across the same core files.
  • crossplane-runtime#873: Introduced the MustCreate feature that this PR is now removing, affecting the same API definitions and reconciliation logic areas.

Suggested labels

backport release-2.2

Suggested reviewers

  • phisco
  • bobh66

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Breaking Changes ❌ Error Pull request removes exported public APIs without the required 'breaking-change' label despite containing intentional API-incompatible changes. Add the 'breaking-change' label to this pull request to signal API-incompatible changes to users.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and descriptively summarizes the main change: reverting the MustCreate management policy addition.
Description check ✅ Passed The description is directly related to the changeset, explaining the revert rationale and providing context about the discussion and reasoning.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/reconciler/managed/policies.go (1)

98-98: Pre-existing typo: "No Crate" → "No Create"

Not from this PR, but I noticed the comment on line 98 says "No Crate" instead of "No Create." Would you be open to fixing this while you're in the neighborhood? Totally optional — happy to open a separate issue if you'd prefer to keep this revert minimal.

✏️ Typo fix
-		// No Crate and no Delete. Just update/patch the external resource.
+		// No Create and no Delete. Just update/patch the external resource.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/reconciler/managed/policies.go` at line 98, Update the typo in the
comment that currently reads "No Crate and no Delete. Just update/patch the
external resource." to "No Create and no Delete. Just update/patch the external
resource." Locate the comment text in policies.go (search for "No Crate and no
Delete") and make the small textual change; no code logic changes required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/reconciler/managed/policies.go`:
- Line 98: Update the typo in the comment that currently reads "No Crate and no
Delete. Just update/patch the external resource." to "No Create and no Delete.
Just update/patch the external resource." Locate the comment text in policies.go
(search for "No Crate and no Delete") and make the small textual change; no code
logic changes required.

@phisco phisco merged commit 8fa945b into crossplane:main Feb 17, 2026
11 checks passed
@github-actions
Copy link

Backport failed for release-2.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-2.2
git worktree add -d .worktree/backport-933-to-release-2.2 origin/release-2.2
cd .worktree/backport-933-to-release-2.2
git switch --create backport-933-to-release-2.2
git cherry-pick -x 7504c3e74f5951d46762a619d7d136da5b3a2a61

@github-actions
Copy link

Successfully created backport PR for release-2.2:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants