Skip to content

Commit

Permalink
fix the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Zhang committed Oct 28, 2024
1 parent 251b3a3 commit 65c71d2
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apis/cluster/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions apis/placement/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/placement/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/controllers/workgenerator/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req controllerruntime.Reques

workUpdated := false
overrideSucceeded := false
resourceBinding.Status.FailedPlacements = nil
// list all the corresponding works
works, syncErr := r.listAllWorksAssociated(ctx, &resourceBinding)
if syncErr == nil {
Expand All @@ -147,6 +146,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req controllerruntime.Reques
for i := condition.OverriddenCondition; i < condition.TotalCondition; i++ {
resourceBinding.RemoveCondition(string(i.ResourceBindingConditionType()))
}
resourceBinding.Status.FailedPlacements = nil
if overrideSucceeded {
overrideReason := condition.OverriddenSucceededReason
overrideMessage := "Successfully applied the override rules on the resources"
Expand Down
8 changes: 1 addition & 7 deletions pkg/controllers/workgenerator/controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,8 @@ var _ = Describe("Test Work Generator Controller", func() {
},
{
Type: string(placementv1beta1.ResourceBindingOverridden),
Status: metav1.ConditionTrue,
Reason: condition.OverrideNotSpecifiedReason,
ObservedGeneration: binding.GetGeneration(),
},
{
Type: string(placementv1beta1.ResourceBindingWorkSynchronized),
Status: metav1.ConditionFalse,
Reason: condition.SyncWorkFailedReason,
Reason: condition.OverriddenFailedReason,
ObservedGeneration: binding.GetGeneration(),
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/e2e/rollout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ var _ = Describe("placing wrapped resources using a CRP", Ordered, func() {
})
})

FContext("Test a CRP place custom resource successfully, should wait to update resource on multiple member clusters", Ordered, func() {
Context("Test a CRP place custom resource successfully, should wait to update resource on multiple member clusters", Ordered, func() {
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
workNamespace := appNamespace()
var wantSelectedResources []placementv1beta1.ResourceIdentifier
Expand Down

0 comments on commit 65c71d2

Please sign in to comment.