-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KSPACE-46: Use SpaceProvisionerConfig for space placement decisions (#…
…991)
- Loading branch information
Showing
14 changed files
with
571 additions
and
470 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,7 @@ const ( | |
) | ||
|
||
func TestReconcile(t *testing.T) { | ||
config := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.CapacityThresholds().MaxNumberOfSpaces( | ||
testconfig.PerMemberCluster("member1", 321)), | ||
testconfig.Deactivation().DeactivatingNotificationDays(3)) | ||
config := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.Deactivation().DeactivatingNotificationDays(3)) | ||
|
||
// given | ||
logf.SetLogger(zap.New(zap.UseDevMode(true))) | ||
|
@@ -65,7 +63,6 @@ func TestReconcile(t *testing.T) { | |
states.SetDeactivating(userSignupFoobar, true) | ||
|
||
t.Run("controller should not deactivate user", func(t *testing.T) { | ||
|
||
// the time since the mur was provisioned is within the deactivation timeout period for the 'deactivate30' tier | ||
t.Run("usersignup should not be deactivated - deactivate30 (30 days)", func(t *testing.T) { | ||
// given | ||
|
@@ -137,10 +134,7 @@ func TestReconcile(t *testing.T) { | |
// a user that belongs to the deactivation domain excluded list | ||
t.Run("user deactivation excluded", func(t *testing.T) { | ||
// given | ||
config := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.CapacityThresholds().MaxNumberOfSpaces( | ||
testconfig.PerMemberCluster("member1", 321)), | ||
testconfig.Deactivation().DeactivatingNotificationDays(3), | ||
) | ||
config := commonconfig.NewToolchainConfigObjWithReset(t, testconfig.Deactivation().DeactivatingNotificationDays(3)) | ||
restore := commontest.SetEnvVarAndRestore(t, "HOST_OPERATOR_DEACTIVATION_DOMAINS_EXCLUDED", "@redhat.com") | ||
defer restore() | ||
murProvisionedTime := &metav1.Time{Time: time.Now().Add(-time.Duration(expectedDeactivationTimeoutDeactivate30Tier*24) * time.Hour)} | ||
|
@@ -155,11 +149,9 @@ func TestReconcile(t *testing.T) { | |
require.Equal(t, time.Duration(0), res.RequeueAfter, "requeueAfter should not be set") | ||
assertThatUserSignupDeactivated(t, cl, username, false) | ||
}) | ||
|
||
}) | ||
// in these tests, the controller should (eventually) deactivate the user | ||
t.Run("controller should deactivate user", func(t *testing.T) { | ||
|
||
userSignupFoobar := userSignupWithEmail(username, "[email protected]") | ||
t.Run("usersignup should be marked as deactivating - deactivate30 (30 days)", func(t *testing.T) { | ||
// given | ||
|
@@ -288,7 +280,6 @@ func TestReconcile(t *testing.T) { | |
assertThatUserSignupDeactivated(t, cl, username, true) | ||
AssertMetricsCounterEquals(t, 1, metrics.UserSignupAutoDeactivatedTotal) | ||
}) | ||
|
||
}) | ||
|
||
t.Run("test usersignup deactivating state reset to false", func(t *testing.T) { | ||
|
@@ -355,7 +346,6 @@ func TestReconcile(t *testing.T) { | |
}) | ||
|
||
t.Run("failures", func(t *testing.T) { | ||
|
||
// cannot find UserTier | ||
t.Run("unable to get UserTier", func(t *testing.T) { | ||
// given | ||
|
@@ -433,7 +423,6 @@ func TestReconcile(t *testing.T) { | |
assertThatUserSignupDeactivated(t, cl, username, false) | ||
}) | ||
}) | ||
|
||
} | ||
|
||
func prepareReconcile(t *testing.T, name string, initObjs ...runtime.Object) (reconcile.Reconciler, reconcile.Request, *commontest.FakeClient) { | ||
|
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
Oops, something went wrong.