From 0f2c8ea4ed40674d837fd59fb41268428fc5523b Mon Sep 17 00:00:00 2001 From: Fish-pro Date: Sat, 11 Feb 2023 06:10:01 +0800 Subject: [PATCH] chore: modify the typecheck as prompted (#2553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com> --- 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) }