diff --git a/cmd/kots/cli/admin-console-upgrade.go b/cmd/kots/cli/admin-console-upgrade.go index a1e327afdb..1b94325f63 100644 --- a/cmd/kots/cli/admin-console-upgrade.go +++ b/cmd/kots/cli/admin-console-upgrade.go @@ -17,6 +17,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/pointer" ) func AdminConsoleUpgradeCmd() *cobra.Command { @@ -88,8 +89,7 @@ func AdminConsoleUpgradeCmd() *cobra.Command { } if v.IsSet("strict-security-context") { - ok := v.GetBool("strict-security-context") - upgradeOptions.StrictSecurityContext = &ok + upgradeOptions.StrictSecurityContext = pointer.Bool(v.GetBool("strict-security-context")) } timeout, err := time.ParseDuration(v.GetString("wait-duration")) diff --git a/pkg/kotsadm/api_test.go b/pkg/kotsadm/api_test.go index e7d6eb78f0..b2a08eae9d 100644 --- a/pkg/kotsadm/api_test.go +++ b/pkg/kotsadm/api_test.go @@ -3,13 +3,13 @@ package kotsadm import ( "testing" - "github.com/aws/smithy-go/ptr" "gopkg.in/go-playground/assert.v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" + "k8s.io/utils/pointer" ) func Test_getHTTPProxySettings(t *testing.T) { @@ -143,8 +143,8 @@ func Test_hasStrictSecurityContext(t *testing.T) { }, }, SecurityContext: &corev1.PodSecurityContext{ - RunAsUser: ptr.Int64(1001), - RunAsNonRoot: ptr.Bool(true), + RunAsUser: pointer.Int64(1001), + RunAsNonRoot: pointer.Bool(true), }, }, }, @@ -171,7 +171,7 @@ func Test_hasStrictSecurityContext(t *testing.T) { }, }, SecurityContext: &corev1.PodSecurityContext{ - RunAsUser: ptr.Int64(1001), + RunAsUser: pointer.Int64(1001), }, }, },