From 82cc7882ad334ec2d43d339672421c1ecd763a93 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Fri, 24 Jul 2020 11:13:07 -0400 Subject: [PATCH] Fix int->string casts Kubernetes-commit: 124a5ddf725c4862520d8619017cac9db7a03522 --- pkg/cmd/create/create_clusterrolebinding_test.go | 5 +++-- pkg/drain/drain_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/create/create_clusterrolebinding_test.go b/pkg/cmd/create/create_clusterrolebinding_test.go index 78b26c02..43834128 100644 --- a/pkg/cmd/create/create_clusterrolebinding_test.go +++ b/pkg/cmd/create/create_clusterrolebinding_test.go @@ -17,11 +17,12 @@ limitations under the License. package create import ( + "strconv" "testing" rbac "k8s.io/api/rbac/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestCreateClusterRoleBinding(t *testing.T) { @@ -72,7 +73,7 @@ func TestCreateClusterRoleBinding(t *testing.T) { } for i, tc := range tests { - t.Run(string(i), func(t *testing.T) { + t.Run(strconv.Itoa(i), func(t *testing.T) { clusterRoleBinding, err := tc.options.createClusterRoleBinding() if err != nil { t.Errorf("unexpected error:\n%#v\n", err) diff --git a/pkg/drain/drain_test.go b/pkg/drain/drain_test.go index ce0c0b63..46c5344a 100644 --- a/pkg/drain/drain_test.go +++ b/pkg/drain/drain_test.go @@ -196,7 +196,7 @@ func createPods(ifCreateNewPods bool) (map[string]corev1.Pod, []corev1.Pod) { for i := 0; i < 8; i++ { var uid types.UID if ifCreateNewPods { - uid = types.UID(i) + uid = types.UID(strconv.Itoa(i)) } else { uid = types.UID(strconv.Itoa(i) + strconv.Itoa(i)) }