From 8f6d43546f67813b411bdd37286e8947e2754aa7 Mon Sep 17 00:00:00 2001 From: Fish-pro Date: Thu, 9 Feb 2023 10:36:21 +0800 Subject: [PATCH] modify the typecheck as prompted Signed-off-by: Fish-pro --- apis/status/v1beta1/constraintpodstatus_types_test.go | 3 +-- pkg/readiness/ready_tracker_test.go | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apis/status/v1beta1/constraintpodstatus_types_test.go b/apis/status/v1beta1/constraintpodstatus_types_test.go index ca7f6be1633..cfd7cf6f728 100644 --- a/apis/status/v1beta1/constraintpodstatus_types_test.go +++ b/apis/status/v1beta1/constraintpodstatus_types_test.go @@ -1,7 +1,6 @@ package v1beta1_test import ( - "strings" "testing" "github.com/google/go-cmp/cmp" @@ -53,7 +52,7 @@ func TestNewConstraintStatusForPod(t *testing.T) { v1beta1.ConstraintNameLabel: "a-constraint", v1beta1.ConstraintKindLabel: "AConstraintKind", v1beta1.PodLabel: podName, - v1beta1.ConstraintTemplateNameLabel: strings.ToLower(cstrKind), + v1beta1.ConstraintTemplateNameLabel: "aconstraintkind", }) err = controllerutil.SetOwnerReference(pod, wantStatus, scheme) diff --git a/pkg/readiness/ready_tracker_test.go b/pkg/readiness/ready_tracker_test.go index 914faadad4b..3db51fe9d8a 100644 --- a/pkg/readiness/ready_tracker_test.go +++ b/pkg/readiness/ready_tracker_test.go @@ -504,7 +504,7 @@ func Test_CollectDeleted(t *testing.T) { type test struct { description string gvk schema.GroupVersionKind - tracker readiness.Expectations + tracker *readiness.Expectations } g := gomega.NewWithT(t) @@ -562,7 +562,7 @@ func Test_CollectDeleted(t *testing.T) { // between them to keep the test short. Trackers are mostly independent per GVK. tests := []test{ {description: "constraints", gvk: cgvk}, - {description: "data (configmaps)", gvk: cmgvk, tracker: cmtracker}, + {description: "data (configmaps)", gvk: cmgvk, tracker: &cmtracker}, {description: "templates", gvk: ctgvk}, // no need to check Config here since it is not actually Expected for readiness // (the objects identified in a Config's syncOnly are Expected, tested in data case above) @@ -572,7 +572,7 @@ func Test_CollectDeleted(t *testing.T) { t.Run(tc.description, func(t *testing.T) { var tt readiness.Expectations if tc.tracker != nil { - tt = tc.tracker + tt = *tc.tracker } else { tt = tracker.For(tc.gvk) }