Skip to content

Commit

Permalink
test: improve test
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
shubham-cmyk committed Apr 1, 2024
1 parent bc26ef6 commit 5e60431
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions k8sutils/finalizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,12 +837,34 @@ func TestAddFinalizer(t *testing.T) {
wantErr bool
}{
{
name: "Add finalizer",
name: "CR without finalizer",
args: args{
cr: &v1beta2.Redis{
ObjectMeta: metav1.ObjectMeta{
Name: "test-redis",
Namespace: "default",
Name: "test-redis",
Namespace: "default",
Finalizers: []string{},
},
},
finalizer: RedisFinalizer,
},
want: &v1beta2.Redis{
ObjectMeta: metav1.ObjectMeta{
Name: "test-redis",
Namespace: "default",
Finalizers: []string{RedisFinalizer},
},
},
wantErr: false,
},
{
name: "CR with finalizer",
args: args{
cr: &v1beta2.Redis{
ObjectMeta: metav1.ObjectMeta{
Name: "test-redis",
Namespace: "default",
Finalizers: []string{RedisFinalizer},
},
},
finalizer: RedisFinalizer,
Expand Down

0 comments on commit 5e60431

Please sign in to comment.