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

fix: only mark a binding apply failed if there are failed manifest #802

Closed
wants to merge 2 commits into from

Conversation

ryanzhang-oss
Copy link
Contributor

Description of your changes

Currently, we mark a binding failed if not all work are applied. This causes the CRP controller to try to fill in failed placement from work. So we only mark a binding apply failed if there are failed manifest, CRP condition won't change. This is probably also useful when we start to copy failed manifest to the binding.

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@ryanzhang-oss ryanzhang-oss changed the title Fix: Only mark a binding apply failed if there are failed manifest fix: only mark a binding apply failed if there are failed manifest May 8, 2024
return metav1.Condition{
Status: metav1.ConditionFalse,
Type: string(fleetv1beta1.ResourceBindingApplied),
Reason: condition.WorkNotAppliedReason,
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use "WorkFailedReason"?

Status: metav1.ConditionFalse,
Type: string(fleetv1beta1.ResourceBindingApplied),
Reason: condition.WorkNotAppliedReason,
Message: fmt.Sprintf("Work object %s is not applied", notAppliedWork),
Copy link
Contributor

@zhiying-lin zhiying-lin May 9, 2024

Choose a reason for hiding this comment

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

Suggested change
Message: fmt.Sprintf("Work object %s is not applied", notAppliedWork),
Message: fmt.Sprintf("Failed to apply work object %s", notAppliedWork),

need to record the failedWork

@@ -170,7 +170,7 @@ func TestBuildAllWorkAppliedCondition(t *testing.T) {
ObservedGeneration: 1,
},
},
"applied should be false if not all work applied to the latest generation": {
"applied should be known if not all work applied to the latest generation": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"applied should be known if not all work applied to the latest generation": {
"applied should be unknown if not all work applied to the latest generation": {

@ryanzhang-oss ryanzhang-oss deleted the mark-applied-unknown branch July 10, 2024 20:15
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 this pull request may close these issues.

2 participants