Skip to content

Commit

Permalink
chore: modify the typecheck as prompted (#2553)
Browse files Browse the repository at this point in the history
Co-authored-by: Sertaç Özercan <[email protected]>
  • Loading branch information
Fish-pro and sozercan authored Feb 10, 2023
1 parent 05638fd commit 0f2c8ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions apis/status/v1beta1/constraintpodstatus_types_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package v1beta1_test

import (
"strings"
"testing"

"github.com/google/go-cmp/cmp"
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/readiness/ready_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down

0 comments on commit 0f2c8ea

Please sign in to comment.