-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed37913
commit 13ce805
Showing
9 changed files
with
518 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright (c) Microsoft Corporation. | ||
Licensed under the MIT license. | ||
*/ | ||
|
||
package e2e | ||
|
||
import ( | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/utils/pointer" | ||
|
||
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1" | ||
) | ||
|
||
var _ = Describe("placing resources using a CRP with no placement policy specified", Ordered, func() { | ||
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess()) | ||
|
||
BeforeAll(func() { | ||
// Create the resources. | ||
createWorkResources() | ||
|
||
// Create the CRP. | ||
crp := &placementv1beta1.ClusterResourcePlacement{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: crpName, | ||
// Add a custom finalizer; this would allow us to better observe | ||
// the behavior of the controllers. | ||
Finalizers: []string{customDeletionBlockerFinalizer}, | ||
}, | ||
Spec: placementv1beta1.ClusterResourcePlacementSpec{ | ||
ResourceSelectors: workResourceSelector(), | ||
Strategy: placementv1beta1.RolloutStrategy{ | ||
Type: placementv1beta1.RollingUpdateRolloutStrategyType, | ||
RollingUpdate: &placementv1beta1.RollingUpdateConfig{ | ||
UnavailablePeriodSeconds: pointer.Int(2), | ||
}, | ||
}, | ||
}, | ||
} | ||
Expect(hubClient.Create(ctx, crp)).To(Succeed(), "Failed to create CRP") | ||
}) | ||
|
||
It("should place the resources on all member clusters", checkIfPlacedWorkResourcesOnAllMemberClusters) | ||
|
||
It("should update CRP status as expected", func() { | ||
crpStatusUpdatedActual := crpStatusUpdatedActual(workResourceIdentifiers(), allMemberClusterNames, nil) | ||
Eventually(crpStatusUpdatedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update CRP status as expected") | ||
}) | ||
|
||
AfterAll(func() { | ||
ensureCRPAndRelatedResourcesDeletion(crpName, allMemberClusters) | ||
}) | ||
}) |
Oops, something went wrong.