Skip to content

Commit

Permalink
resolving linting error and some check for updatedavailabel replica
Browse files Browse the repository at this point in the history
Signed-off-by: ntishchauhan0022 <[email protected]>
  • Loading branch information
nitishchauhan0022 committed Jul 4, 2023
1 parent 843f5c7 commit 72e889b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

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

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

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

21 changes: 21 additions & 0 deletions pkg/controller/statefulset/stateful_set_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ func CreatesPods(t *testing.T, set *appsv1beta1.StatefulSet, invariants invarian
if set.Status.UpdatedReplicas != 3 {
t.Error("Failed to set UpdatedReplicas correctly")
}
if set.Status.UpdatedAvailableReplicas != 3 {
t.Error("Failed to set UpdatedAvailbleReplicas correctly")

Check warning on line 229 in pkg/controller/statefulset/stateful_set_control_test.go

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Availble" should be "Available".
}
}

func ScalesUp(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFunc) {
Expand Down Expand Up @@ -257,6 +260,9 @@ func ScalesUp(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFu
if set.Status.UpdatedReplicas != 4 {
t.Error("Failed to set updatedReplicas correctly")
}
if set.Status.UpdatedAvailableReplicas != 4 {
t.Error("Failed to set updatedAvailableReplicas correctly")
}
}

func ScalesDown(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFunc) {
Expand Down Expand Up @@ -295,6 +301,9 @@ func ScalesDown(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariant
if set.Status.UpdatedReplicas != 0 {
t.Error("Failed to set updatedReplicas correctly")
}
if set.Status.UpdatedAvailableReplicas != 0 {
t.Error("Failed to set updatedAvailableReplicas correctly")
}
}

func ReplacesPods(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFunc) {
Expand Down Expand Up @@ -459,6 +468,9 @@ func CreatePodFailure(t *testing.T, set *appsv1beta1.StatefulSet, invariants inv
if set.Status.UpdatedReplicas != 3 {
t.Error("Failed to updatedReplicas correctly")
}
if set.Status.UpdatedAvailableReplicas != 4 {
t.Error("Failed to set updatedAvailableReplicas correctly")
}
}

func UpdatePodFailure(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFunc) {
Expand Down Expand Up @@ -489,6 +501,9 @@ func UpdatePodFailure(t *testing.T, set *appsv1beta1.StatefulSet, invariants inv
if set.Status.UpdatedReplicas != 3 {
t.Error("Failed to set updatedReplicas correctly")
}
if set.Status.UpdatedAvailableReplicas != 3 {
t.Error("Failed to set updatedAvailableReplicas correctly")
}

// now mutate a pod's identity
pods, err := om.podsLister.List(labels.Everything())
Expand Down Expand Up @@ -543,6 +558,9 @@ func UpdateSetStatusFailure(t *testing.T, set *appsv1beta1.StatefulSet, invarian
if set.Status.UpdatedReplicas != 3 {
t.Error("Failed to set updatedReplicas to 3")
}
if set.Status.UpdatedAvailableReplicas != 4 {
t.Error("Failed to set updatedAvailableReplicas correctly")
}
}

func PodRecreateDeleteFailure(t *testing.T, set *appsv1beta1.StatefulSet, invariants invariantFunc) {
Expand Down Expand Up @@ -637,6 +655,9 @@ func TestStatefulSetControlScaleDownDeleteError(t *testing.T) {
if set.Status.UpdatedReplicas != 0 {
t.Error("Failed to set updatedReplicas to 0")
}
if set.Status.UpdatedAvailableReplicas != 0 {
t.Error("Failed to set updatedAvailableReplicas to 0")
}
})
}

Expand Down

0 comments on commit 72e889b

Please sign in to comment.