Skip to content

Commit

Permalink
refactor: fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
wu8685 authored and shaofan-hs committed Mar 28, 2024
1 parent 1256a9a commit 9e6fe89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/webhook/server/generic/pod/gracedelete/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ func (gd *GraceDelete) Validating(ctx context.Context, c client.Client, oldPod,
}

if len(finalizers) == 0 {
return fmt.Errorf("this Pod's deletion process is underway and being managed by PodOpsLifecycle")
return fmt.Errorf("pod deletion process is underway and being managed by PodOpsLifecycle")
}

return fmt.Errorf("this Pod's deletion process is underway and being managed by PodOpsLifecycle with finalizers: %v", finalizers)
return fmt.Errorf("pod deletion process is underway and being managed by PodOpsLifecycle with finalizers: %v", finalizers)
}

func (gd *GraceDelete) Mutating(ctx context.Context, c client.Client, oldPod, newPod *corev1.Pod, operation admissionv1.Operation) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/server/generic/pod/gracedelete/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestGraceDelete(t *testing.T) {
expectedLabels: map[string]string{
appsv1alpha1.PodDeletionIndicationLabelKey: "true",
},
keyWords: "podOpsLifecycle denied",
keyWords: "pod deletion process is underway",
reqOperation: admissionv1.Delete,
},
{
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestGraceDelete(t *testing.T) {
expectedLabels: map[string]string{
appsv1alpha1.PodDeletionIndicationLabelKey: "true",
},
keyWords: "podOpsLifecycle denied",
keyWords: "pod deletion process is underway",
reqOperation: admissionv1.Delete,
},
{
Expand Down

0 comments on commit 9e6fe89

Please sign in to comment.