diff --git a/controllers/argocd/openshift/openshift.go b/controllers/argocd/openshift/openshift.go index 6dcd0a6e6cc..0e5133af0a8 100644 --- a/controllers/argocd/openshift/openshift.go +++ b/controllers/argocd/openshift/openshift.go @@ -32,7 +32,7 @@ var log = logf.Log.WithName("openshift_controller_argocd") // argocd.Register(reconcilerHook) // } -func ReconcilerHook(cr *argoapp.ArgoCD, v interface{}, hint string) error { +func ReconcilerHook(cr *argoapp.ArgoCD, v any, hint string) error { logv := log.WithValues("ArgoCD Namespace", cr.Namespace, "ArgoCD Name", cr.Name) switch o := v.(type) { @@ -205,7 +205,7 @@ echo "Done!" } // BuilderHook updates the Argo CD controller builder to watch for changes to the "admin" ClusterRole -func BuilderHook(_ *argoapp.ArgoCD, v interface{}, _ string) error { +func BuilderHook(_ *argoapp.ArgoCD, v any, _ string) error { logv := log.WithValues("module", "builder-hook") bldr, ok := v.(*argocd.BuilderHook) @@ -480,10 +480,8 @@ func allowedNamespace(current string, namespaces string) bool { return true } - for _, n := range clusterConfigNamespaces { - if n == current { - return true - } + if slices.Contains(clusterConfigNamespaces, current) { + return true } } return false diff --git a/controllers/consoleplugin.go b/controllers/consoleplugin.go index 80673fdd228..bf74a04a922 100644 --- a/controllers/consoleplugin.go +++ b/controllers/consoleplugin.go @@ -22,7 +22,6 @@ import ( resourcev1 "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -107,7 +106,7 @@ func getPluginPodSpec(crImagePullPolicy corev1.PullPolicy) corev1.PodSpec { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -118,7 +117,7 @@ func getPluginPodSpec(crImagePullPolicy corev1.PullPolicy) corev1.PodSpec { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -232,8 +231,8 @@ func securityContextForPlugin() *corev1.SecurityContext { "ALL", }, }, - RunAsNonRoot: ptr.To(true), - AllowPrivilegeEscalation: ptr.To(false), + RunAsNonRoot: new(true), + AllowPrivilegeEscalation: new(false), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, }, diff --git a/controllers/consoleplugin_test.go b/controllers/consoleplugin_test.go index c6f3743e946..e66bae62cd9 100644 --- a/controllers/consoleplugin_test.go +++ b/controllers/consoleplugin_test.go @@ -17,7 +17,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) @@ -146,7 +145,7 @@ func TestPlugin_reconcileDeployment_changedLabels(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -157,7 +156,7 @@ func TestPlugin_reconcileDeployment_changedLabels(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -292,7 +291,7 @@ func TestPlugin_reconcileDeployment_changedReplicas(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -303,7 +302,7 @@ func TestPlugin_reconcileDeployment_changedReplicas(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -433,7 +432,7 @@ func TestPlugin_reconcileDeployment_changedSelector(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -444,7 +443,7 @@ func TestPlugin_reconcileDeployment_changedSelector(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -573,7 +572,7 @@ func TestPlugin_reconcileDeployment_changedTemplateLabels(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -584,7 +583,7 @@ func TestPlugin_reconcileDeployment_changedTemplateLabels(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -660,7 +659,7 @@ func TestPlugin_reconcileDeployment_changedContainers(t *testing.T) { Name: "wrong name", Image: "wrong image", SecurityContext: &corev1.SecurityContext{ - Privileged: ptr.To(true), + Privileged: new(true), }, }, } @@ -780,7 +779,7 @@ func TestPlugin_reconcileDeployment_changedRestartPolicy(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -791,7 +790,7 @@ func TestPlugin_reconcileDeployment_changedRestartPolicy(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -920,7 +919,7 @@ func TestPlugin_reconcileDeployment_changedDNSPolicy(t *testing.T) { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: pluginServingCertName, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, @@ -931,7 +930,7 @@ func TestPlugin_reconcileDeployment_changedDNSPolicy(t *testing.T) { LocalObjectReference: corev1.LocalObjectReference{ Name: httpdConfigMapName, }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }, }, }, diff --git a/controllers/gitopsservice_controller_test.go b/controllers/gitopsservice_controller_test.go index d0447e89962..ae77de81674 100644 --- a/controllers/gitopsservice_controller_test.go +++ b/controllers/gitopsservice_controller_test.go @@ -472,13 +472,13 @@ func TestReconcile_BackendSecurityContext(t *testing.T) { securityContext := deployment.Spec.Template.Spec.Containers[0].SecurityContext want := &corev1.SecurityContext{ - AllowPrivilegeEscalation: util.BoolPtr(false), + AllowPrivilegeEscalation: new(false), Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{ "ALL", }, }, - RunAsNonRoot: util.BoolPtr(true), + RunAsNonRoot: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, }, diff --git a/controllers/util/util.go b/controllers/util/util.go index ebde45f5f6c..36c421c4599 100644 --- a/controllers/util/util.go +++ b/controllers/util/util.go @@ -260,11 +260,6 @@ func caseInsensitiveGetenv(s string) (string, string) { return "", "" } -// BoolPtr returns a pointer to val -func BoolPtr(val bool) *bool { - return &val -} - func AddSeccompProfileForOpenShift(client client.Client, podspec *corev1.PodSpec) { version, _ := GetClusterVersion(client) @@ -280,13 +275,13 @@ func AddSeccompProfileForOpenShift(client client.Client, podspec *corev1.PodSpec } if podspec.Containers[0].SecurityContext == nil { podspec.Containers[0].SecurityContext = &corev1.SecurityContext{ - AllowPrivilegeEscalation: BoolPtr(false), + AllowPrivilegeEscalation: new(false), Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{ "ALL", }, }, - RunAsNonRoot: BoolPtr(true), + RunAsNonRoot: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, }, diff --git a/test/e2e/gitopsservice_test.go b/test/e2e/gitopsservice_test.go index 4596384fbab..bc995a6ec28 100644 --- a/test/e2e/gitopsservice_test.go +++ b/test/e2e/gitopsservice_test.go @@ -593,8 +593,8 @@ var _ = Describe("GitOpsServiceController", func() { continue } if namespaces, ok := secret.Data["namespaces"]; ok { - namespaceList := strings.Split(string(namespaces), ",") - for _, ns := range namespaceList { + namespaceList := strings.SplitSeq(string(namespaces), ",") + for ns := range namespaceList { if strings.TrimSpace(ns) == argocdTargetNamespace { err := fmt.Errorf("namespace %v still present in cluster secret namespace list", argocdTargetNamespace) GinkgoT().Log(err.Error()) diff --git a/test/openshift/e2e/ginkgo/parallel/1-003_alpha_to_beta_sso_conflict_conversion_test.go b/test/openshift/e2e/ginkgo/parallel/1-003_alpha_to_beta_sso_conflict_conversion_test.go index f8cb6460d55..abce4c00ab7 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-003_alpha_to_beta_sso_conflict_conversion_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-003_alpha_to_beta_sso_conflict_conversion_test.go @@ -28,7 +28,6 @@ import ( k8sFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/k8s" fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -74,7 +73,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Keycloak: &argov1alpha1api.ArgoCDKeycloakSpec{ RootCA: "\"---BEGIN---END---\"", }, - VerifyTLS: ptr.To(false), + VerifyTLS: new(false), }, ExtraConfig: map[string]string{ "oidc.tls.insecure.skip.verify": "true", diff --git a/test/openshift/e2e/ginkgo/parallel/1-005_validate_route_tls_test.go b/test/openshift/e2e/ginkgo/parallel/1-005_validate_route_tls_test.go index 872e819fb80..ed252ad11f2 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-005_validate_route_tls_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-005_validate_route_tls_test.go @@ -31,7 +31,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -71,7 +70,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { }, }, ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{ - Enabled: ptr.To(true), + Enabled: new(true), WebhookServer: argov1beta1api.WebhookServerSpec{ Host: "example.com", Route: argov1beta1api.ArgoCDRouteSpec{ diff --git a/test/openshift/e2e/ginkgo/parallel/1-007_validate_volume_mounts_test.go b/test/openshift/e2e/ginkgo/parallel/1-007_validate_volume_mounts_test.go index 1028a986ece..a21ef0a57fd 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-007_validate_volume_mounts_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-007_validate_volume_mounts_test.go @@ -28,7 +28,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -103,21 +102,21 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "ssh-known-hosts", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-ssh-known-hosts-cm"}}, }, }, { Name: "tls-certs", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-tls-certs-cm"}}, }, }, { Name: "gpg-keys", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{ Name: "argocd-gpg-keys-cm", }, diff --git a/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go b/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go index 2b291381492..badc58fe926 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go @@ -30,7 +30,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -83,32 +82,32 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "ssh-known-hosts", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-ssh-known-hosts-cm"}}, }, }, { Name: "tls-certs", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-tls-certs-cm"}}, }, }, { Name: "argocd-repo-server-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-repo-server-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, { Name: "argocd-operator-redis-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-operator-redis-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, @@ -120,10 +119,10 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "argocd-cmd-params-cm", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{{Key: "server.profile.enabled", Path: "profiler.enabled"}}, LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-cmd-params-cm"}, - Optional: ptr.To(true)}, + Optional: new(true)}, }, }, { @@ -136,7 +135,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: "argocd-redis-initial-password", - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, @@ -167,21 +166,21 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "ssh-known-hosts", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-ssh-known-hosts-cm"}}, }, }, { Name: "tls-certs", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-tls-certs-cm"}}, }, }, { Name: "gpg-keys", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-gpg-keys-cm"}}, }, }, @@ -193,18 +192,18 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "argocd-repo-server-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-repo-server-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, { Name: "argocd-operator-redis-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-operator-redis-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, @@ -223,7 +222,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: "argocd-redis-initial-password", - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, @@ -256,18 +255,18 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "argocd-repo-server-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-repo-server-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, { Name: "argocd-operator-redis-tls", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), SecretName: "argocd-operator-redis-tls", - Optional: ptr.To(true), + Optional: new(true), }, }, }, @@ -279,13 +278,13 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { { Name: "argocd-cmd-params-cm", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "controller.profile.enabled", Path: "profiler.enabled"}, {Key: "controller.resource.health.persist", Path: "controller.resource.health.persist"}, }, LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-cmd-params-cm"}, - Optional: ptr.To(true)}, + Optional: new(true)}, }, }, { @@ -298,7 +297,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ SecretName: "argocd-redis-initial-password", - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, @@ -375,7 +374,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { LocalObjectReference: corev1.LocalObjectReference{ Name: "argocd-ssh-known-hosts-cm", }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }}, }, { @@ -384,7 +383,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { LocalObjectReference: corev1.LocalObjectReference{ Name: "argocd-tls-certs-cm", }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }}, }, { @@ -393,7 +392,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { LocalObjectReference: corev1.LocalObjectReference{ Name: "argocd-gpg-keys-cm", }, - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), }}, }, { diff --git a/test/openshift/e2e/ginkgo/parallel/1-030_validate_reencrypt_test.go b/test/openshift/e2e/ginkgo/parallel/1-030_validate_reencrypt_test.go index a84667e0059..2bfc054645f 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-030_validate_reencrypt_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-030_validate_reencrypt_test.go @@ -35,7 +35,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -87,7 +86,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Expect(r).Should(routeFixture.HavePort(intstr.FromString("https"))) Expect(r).Should(routeFixture.HaveTLS(routev1.TLSTerminationReencrypt, routev1.InsecureEdgeTerminationPolicyRedirect)) - Expect(r).Should(routeFixture.HaveTo(routev1.RouteTargetReference{Kind: "Service", Name: "argocd-server", Weight: ptr.To(int32(100))})) + Expect(r).Should(routeFixture.HaveTo(routev1.RouteTargetReference{Kind: "Service", Name: "argocd-server", Weight: new(int32(100))})) By("verifying the Route was successfully admitted, and ths TLS Secret exists") Eventually(func() bool { diff --git a/test/openshift/e2e/ginkgo/parallel/1-031_validate_toolchain_test.go b/test/openshift/e2e/ginkgo/parallel/1-031_validate_toolchain_test.go index c1224337c1a..a254afef127 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-031_validate_toolchain_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-031_validate_toolchain_test.go @@ -150,8 +150,8 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { // Dex Version: v2.41.1-1-ga7854d65 var dexVersion string - dexVersionOutputSplit := strings.Split(dexVersionOutput, "\n") - for _, line := range dexVersionOutputSplit { + dexVersionOutputSplit := strings.SplitSeq(dexVersionOutput, "\n") + for line := range dexVersionOutputSplit { if strings.Contains(line, "Dex Version:") { dexVersion = line dexVersion = dexVersion[strings.Index(dexVersion, ":")+1:] diff --git a/test/openshift/e2e/ginkgo/parallel/1-032_validate_dynamic_scaling_test.go b/test/openshift/e2e/ginkgo/parallel/1-032_validate_dynamic_scaling_test.go index d4156cb42a1..bc672ad7751 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-032_validate_dynamic_scaling_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-032_validate_dynamic_scaling_test.go @@ -30,7 +30,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -71,7 +70,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Spec: argov1beta1api.ArgoCDSpec{ Controller: argov1beta1api.ArgoCDApplicationControllerSpec{ Sharding: argov1beta1api.ArgoCDApplicationControllerShardSpec{ - DynamicScalingEnabled: ptr.To(true), + DynamicScalingEnabled: new(true), MinShards: 1, MaxShards: 4, ClustersPerShard: 1, diff --git a/test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test.go b/test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test.go index 60f5b814c64..6a769ee072b 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test.go @@ -37,7 +37,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -209,7 +208,7 @@ Xq+NinfrqOLJkIZ/u/PJu4KqN3M= }, }, Spec: appsv1.DeploymentSpec{ - Replicas: ptr.To((int32)(1)), + Replicas: new((int32)(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "webhook", diff --git a/test/openshift/e2e/ginkgo/parallel/1-037_validate_argocd_setting_replicas_test.go b/test/openshift/e2e/ginkgo/parallel/1-037_validate_argocd_setting_replicas_test.go index d093e167a1f..a9cc57660f3 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-037_validate_argocd_setting_replicas_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-037_validate_argocd_setting_replicas_test.go @@ -28,7 +28,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -66,11 +65,11 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("updating server and repo replicas to 3") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Server.Replicas = ptr.To((int32)(3)) + ac.Spec.Server.Replicas = new((int32)(3)) }) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Repo.Replicas = ptr.To((int32)(3)) + ac.Spec.Repo.Replicas = new((int32)(3)) }) By("verifying 3 server and repo replicas become ready") @@ -82,11 +81,11 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("updating server and repo replicas to 1") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Server.Replicas = ptr.To((int32)(1)) + ac.Spec.Server.Replicas = new((int32)(1)) }) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Repo.Replicas = ptr.To((int32)(1)) + ac.Spec.Repo.Replicas = new((int32)(1)) }) By("verifying 1 server and repo replicas become ready") diff --git a/test/openshift/e2e/ginkgo/parallel/1-042_restricted_pss_compliant_test.go b/test/openshift/e2e/ginkgo/parallel/1-042_restricted_pss_compliant_test.go index 3dac9bc4ce9..c15b9b52a8a 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-042_restricted_pss_compliant_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-042_restricted_pss_compliant_test.go @@ -31,7 +31,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -87,7 +86,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { ObjectMeta: metav1.ObjectMeta{Name: "argocd", Namespace: ns.Name}, Spec: argov1beta1api.ArgoCDSpec{ ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{ - Enabled: ptr.To(true), + Enabled: new(true), }, Notifications: argov1beta1api.ArgoCDNotifications{ Enabled: true, diff --git a/test/openshift/e2e/ginkgo/parallel/1-045_validate_applicationset_image_override_test.go b/test/openshift/e2e/ginkgo/parallel/1-045_validate_applicationset_image_override_test.go index ddc11f5bdd9..b9e50f8a6a3 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-045_validate_applicationset_image_override_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-045_validate_applicationset_image_override_test.go @@ -28,7 +28,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -61,7 +60,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Image: "argocdimage", Version: "tag002", ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{ - Enabled: ptr.To(true), + Enabled: new(true), }, }, } diff --git a/test/openshift/e2e/ginkgo/parallel/1-045_validate_repo_exec_timeout_test.go b/test/openshift/e2e/ginkgo/parallel/1-045_validate_repo_exec_timeout_test.go index d29842169c6..72fe4a0c35e 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-045_validate_repo_exec_timeout_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-045_validate_repo_exec_timeout_test.go @@ -29,7 +29,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -67,7 +66,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("setting execTimeout on repo server via ArgoCD CR") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Repo.ExecTimeout = ptr.To(300) + ac.Spec.Repo.ExecTimeout = new(300) }) By("verifying that argocd-repo-server has execTimeout value we set on ArgoCD CR") diff --git a/test/openshift/e2e/ginkgo/parallel/1-050_validate_sso_test.go b/test/openshift/e2e/ginkgo/parallel/1-050_validate_sso_test.go index 98d5c633ca6..f53f7491b64 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-050_validate_sso_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-050_validate_sso_test.go @@ -25,7 +25,7 @@ import ( func getOCPVersion() string { output, err := osFixture.ExecCommand("oc", "version") Expect(err).ToNot(HaveOccurred()) - for _, line := range strings.Split(output, "\n") { + for line := range strings.SplitSeq(output, "\n") { if strings.Contains(line, "Server Version:") { return strings.TrimSpace(line[strings.Index(line, ":")+1:]) } diff --git a/test/openshift/e2e/ginkgo/parallel/1-057_validate_notifications_test.go b/test/openshift/e2e/ginkgo/parallel/1-057_validate_notifications_test.go index 9c37c47aa3e..682cf034e76 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-057_validate_notifications_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-057_validate_notifications_test.go @@ -37,7 +37,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -101,7 +100,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { }, }, Spec: appsv1.DeploymentSpec{ - Replicas: ptr.To(int32(1)), + Replicas: new(int32(1)), Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{"app": "smtp4dev"}, }, diff --git a/test/openshift/e2e/ginkgo/parallel/1-064_validate_security_contexts_test.go b/test/openshift/e2e/ginkgo/parallel/1-064_validate_security_contexts_test.go index 73b25d902ba..0f622fa427c 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-064_validate_security_contexts_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-064_validate_security_contexts_test.go @@ -30,7 +30,6 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -118,9 +117,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { case "argocd-applicationset-controller": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - ReadOnlyRootFilesystem: ptr.To(true), - RunAsNonRoot: ptr.To(true), + AllowPrivilegeEscalation: new(false), + ReadOnlyRootFilesystem: new(true), + RunAsNonRoot: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, @@ -129,9 +128,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { case "argocd-dex-server": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - RunAsNonRoot: ptr.To(true), - ReadOnlyRootFilesystem: ptr.To(true), + AllowPrivilegeEscalation: new(false), + RunAsNonRoot: new(true), + ReadOnlyRootFilesystem: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, @@ -140,23 +139,23 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { case "argocd-notifications-controller": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - RunAsNonRoot: ptr.To(true), - ReadOnlyRootFilesystem: ptr.To(true), + AllowPrivilegeEscalation: new(false), + RunAsNonRoot: new(true), + ReadOnlyRootFilesystem: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, }, })) - Expect(depl.Spec.Template.Spec.SecurityContext.RunAsNonRoot).To(Equal(ptr.To(true))) + Expect(depl.Spec.Template.Spec.SecurityContext.RunAsNonRoot).To(Equal(new(true))) case "argocd-redis": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - RunAsNonRoot: ptr.To(true), - ReadOnlyRootFilesystem: ptr.To(true), + AllowPrivilegeEscalation: new(false), + RunAsNonRoot: new(true), + ReadOnlyRootFilesystem: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, @@ -166,9 +165,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { case "argocd-repo-server": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - RunAsNonRoot: ptr.To(true), - ReadOnlyRootFilesystem: ptr.To(true), + AllowPrivilegeEscalation: new(false), + RunAsNonRoot: new(true), + ReadOnlyRootFilesystem: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, @@ -178,9 +177,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { case "argocd-server": Expect(*secContext).To(Equal(corev1.SecurityContext{ Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}}, - AllowPrivilegeEscalation: ptr.To(false), - RunAsNonRoot: ptr.To(true), - ReadOnlyRootFilesystem: ptr.To(true), + AllowPrivilegeEscalation: new(false), + RunAsNonRoot: new(true), + ReadOnlyRootFilesystem: new(true), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, LocalhostProfile: nil, diff --git a/test/openshift/e2e/ginkgo/parallel/1-070_validate_config_management_plugin_test.go b/test/openshift/e2e/ginkgo/parallel/1-070_validate_config_management_plugin_test.go index 66be700e0c6..717c2cf5906 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-070_validate_config_management_plugin_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-070_validate_config_management_plugin_test.go @@ -31,7 +31,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -79,7 +78,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Command: []string{"/var/run/argocd/argocd-cmp-server"}, // Entrypoint should be Argo CD lightweight CMP server ie. argocd-cmp-server Image: "quay.io/fedora/fedora:latest", // This can be off-the-shelf or custom-built image SecurityContext: &corev1.SecurityContext{ - RunAsNonRoot: ptr.To(true), + RunAsNonRoot: new(true), }, VolumeMounts: []corev1.VolumeMount{ {MountPath: "/var/run/argocd", Name: "var-files"}, @@ -95,7 +94,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { } if !fixture.RunningOnOpenShift() { - argoCD.Spec.Repo.SidecarContainers[0].SecurityContext.RunAsUser = ptr.To(int64(999)) + argoCD.Spec.Repo.SidecarContainers[0].SecurityContext.RunAsUser = new(int64(999)) } Expect(k8sClient.Create(ctx, argoCD)).To(Succeed()) diff --git a/test/openshift/e2e/ginkgo/parallel/1-080_validate_regex_support_argocd_rbac_test.go b/test/openshift/e2e/ginkgo/parallel/1-080_validate_regex_support_argocd_rbac_test.go index 4874f1ac9b3..743ed25afb5 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-080_validate_regex_support_argocd_rbac_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-080_validate_regex_support_argocd_rbac_test.go @@ -29,7 +29,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -68,7 +67,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("set regex Policy Matcher Mode") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.RBAC.PolicyMatcherMode = ptr.To("regex") + ac.Spec.RBAC.PolicyMatcherMode = new("regex") }) By("verifying it gets set on argocd-rbac-cm ConfigMap") @@ -92,7 +91,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("verifying we can also set glob, and it is set in the ConfigMap") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.RBAC.PolicyMatcherMode = ptr.To("glob") + ac.Spec.RBAC.PolicyMatcherMode = new("glob") }) Eventually(argocdRBACCM).Should(configmapFixture.HaveStringDataKeyValue("policy.matchMode", "glob")) diff --git a/test/openshift/e2e/ginkgo/parallel/1-088_validate_applicationset_add_env_vars_test.go b/test/openshift/e2e/ginkgo/parallel/1-088_validate_applicationset_add_env_vars_test.go index 2cd6cbd0e6b..387b5e408b3 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-088_validate_applicationset_add_env_vars_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-088_validate_applicationset_add_env_vars_test.go @@ -29,7 +29,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -60,7 +59,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { ObjectMeta: metav1.ObjectMeta{Name: "example-argocd", Namespace: ns.Name}, Spec: argov1beta1api.ArgoCDSpec{ ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{ - Enabled: ptr.To(true), + Enabled: new(true), }, }, } diff --git a/test/openshift/e2e/ginkgo/parallel/1-099_validate_server_autoscale_test.go b/test/openshift/e2e/ginkgo/parallel/1-099_validate_server_autoscale_test.go index 8b66e9cb41a..8f0598d3e11 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-099_validate_server_autoscale_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-099_validate_server_autoscale_test.go @@ -32,7 +32,6 @@ import ( autoscalingv2 "k8s.io/api/autoscaling/v2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -64,7 +63,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { ObjectMeta: metav1.ObjectMeta{Name: "example-argocd", Namespace: ns.Name}, Spec: argov1beta1api.ArgoCDSpec{ Server: argov1beta1api.ArgoCDServerSpec{ - Replicas: ptr.To(int32(2)), + Replicas: new(int32(2)), }, }, } @@ -88,9 +87,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { ac.Spec.Server.Autoscale = argov1beta1api.ArgoCDServerAutoscaleSpec{ Enabled: true, HPA: &autoscalingv1.HorizontalPodAutoscalerSpec{ - MinReplicas: ptr.To(int32(4)), + MinReplicas: new(int32(4)), MaxReplicas: int32(7), - TargetCPUUtilizationPercentage: ptr.To(int32(50)), + TargetCPUUtilizationPercentage: new(int32(50)), ScaleTargetRef: autoscalingv1.CrossVersionObjectReference{ Kind: "deployment", APIVersion: "apps/v1", @@ -118,9 +117,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { ac.Spec.Server.Autoscale = argov1beta1api.ArgoCDServerAutoscaleSpec{ Enabled: true, HPA: &autoscalingv1.HorizontalPodAutoscalerSpec{ - MinReplicas: ptr.To(int32(8)), + MinReplicas: new(int32(8)), MaxReplicas: int32(12), - TargetCPUUtilizationPercentage: ptr.To(int32(50)), + TargetCPUUtilizationPercentage: new(int32(50)), ScaleTargetRef: autoscalingv1.CrossVersionObjectReference{ Kind: "deployment", APIVersion: "apps/v1", diff --git a/test/openshift/e2e/ginkgo/parallel/1-104_validate_applicationset_tls_scm_volume_mount_test.go b/test/openshift/e2e/ginkgo/parallel/1-104_validate_applicationset_tls_scm_volume_mount_test.go index 6d3d51efde0..4d52ce78854 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-104_validate_applicationset_tls_scm_volume_mount_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-104_validate_applicationset_tls_scm_volume_mount_test.go @@ -29,7 +29,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -167,21 +166,21 @@ XWyb96wrUlv+E8I= { Name: "ssh-known-hosts", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-ssh-known-hosts-cm"}}, }, }, { Name: "tls-certs", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-tls-certs-cm"}}, }, }, { Name: "gpg-keys", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-gpg-keys-cm"}}, }, }, @@ -198,7 +197,7 @@ XWyb96wrUlv+E8I= { Name: "appset-gitlab-scm-tls-cert", VolumeSource: corev1.VolumeSource{ ConfigMap: &corev1.ConfigMapVolumeSource{ - DefaultMode: ptr.To(int32(420)), + DefaultMode: new(int32(420)), LocalObjectReference: corev1.LocalObjectReference{Name: "argocd-appset-gitlab-scm-tls-certs-cm"}}, }, }, diff --git a/test/openshift/e2e/ginkgo/parallel/1-115_validate_controller_extra_command_args_test.go b/test/openshift/e2e/ginkgo/parallel/1-115_validate_controller_extra_command_args_test.go index 6c0d1d96d61..9419b1c6ee6 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-115_validate_controller_extra_command_args_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-115_validate_controller_extra_command_args_test.go @@ -146,7 +146,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { statusProcessorsCount := 0 kubectlLimitCount := 0 - for i := 0; i < len(cmd); i++ { + for i := range cmd { if cmd[i] == "--status-processors" { statusProcessorsCount++ } @@ -180,7 +180,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { cmd := appControllerSS.Spec.Template.Spec.Containers[0].Command metricVals := []string{} - for i := 0; i < len(cmd); i++ { + for i := range cmd { if cmd[i] == "--metrics-application-labels" && i+1 < len(cmd) { metricVals = append(metricVals, cmd[i+1]) } diff --git a/test/openshift/e2e/ginkgo/parallel/1-124_validate_networkpolicies_test.go b/test/openshift/e2e/ginkgo/parallel/1-124_validate_networkpolicies_test.go index f24b9652f73..b1bd82093e3 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-124_validate_networkpolicies_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-124_validate_networkpolicies_test.go @@ -31,7 +31,6 @@ import ( corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -83,7 +82,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Enabled: true, }, ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{ - Enabled: ptr.To(true), + Enabled: new(true), }, SSO: &argov1beta1api.ArgoCDSSOSpec{ Provider: argov1beta1api.SSOProviderTypeDex, diff --git a/test/openshift/e2e/ginkgo/parallel/1-125_validate_applicationset_cleanup_when_spec_field_omitted_test.go b/test/openshift/e2e/ginkgo/parallel/1-125_validate_applicationset_cleanup_when_spec_field_omitted_test.go index b95c7333660..dc9bc78cb0e 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-125_validate_applicationset_cleanup_when_spec_field_omitted_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-125_validate_applicationset_cleanup_when_spec_field_omitted_test.go @@ -30,7 +30,6 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -64,16 +63,16 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ Controller: argov1beta1api.ArgoCDApplicationControllerSpec{ - Enabled: ptr.To(true), + Enabled: new(true), }, Redis: argov1beta1api.ArgoCDRedisSpec{ - Enabled: ptr.To(true), + Enabled: new(true), }, Repo: argov1beta1api.ArgoCDRepoSpec{ - Enabled: ptr.To(true), + Enabled: new(true), }, Server: argov1beta1api.ArgoCDServerSpec{ - Enabled: ptr.To(true), + Enabled: new(true), }, ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{}, }, diff --git a/test/openshift/e2e/ginkgo/parallel/1-126_validate_servicemonitor_metrics_config_test.go b/test/openshift/e2e/ginkgo/parallel/1-126_validate_servicemonitor_metrics_config_test.go index 6abffd98a13..37f95d7177e 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-126_validate_servicemonitor_metrics_config_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-126_validate_servicemonitor_metrics_config_test.go @@ -22,7 +22,6 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" @@ -279,10 +278,10 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ Prometheus: argov1beta1api.ArgoCDPrometheusSpec{Enabled: true}, - Controller: argov1beta1api.ArgoCDApplicationControllerSpec{Enabled: ptr.To(false)}, + Controller: argov1beta1api.ArgoCDApplicationControllerSpec{Enabled: new(false)}, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Principal: &argov1beta1api.PrincipalSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Metrics: &argov1beta1api.ArgoCDMetricsSpec{ Interval: "40s", ScrapeTimeout: "12s", @@ -351,11 +350,11 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ Prometheus: argov1beta1api.ArgoCDPrometheusSpec{Enabled: true}, - Controller: argov1beta1api.ArgoCDApplicationControllerSpec{Enabled: ptr.To(false)}, - Server: argov1beta1api.ArgoCDServerSpec{Enabled: ptr.To(false)}, + Controller: argov1beta1api.ArgoCDApplicationControllerSpec{Enabled: new(false)}, + Server: argov1beta1api.ArgoCDServerSpec{Enabled: new(false)}, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Agent: &argov1beta1api.AgentSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Metrics: &argov1beta1api.ArgoCDMetricsSpec{ Interval: "50s", ScrapeTimeout: "18s", diff --git a/test/openshift/e2e/ginkgo/sequential/1-006_validate_machine_config_test.go b/test/openshift/e2e/ginkgo/sequential/1-006_validate_machine_config_test.go index fdaa9f73efe..48e2096a506 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-006_validate_machine_config_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-006_validate_machine_config_test.go @@ -34,7 +34,6 @@ import ( k8sFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/k8s" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -80,7 +79,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(defaultArgoCD).ToNot(BeNil()) argocdFixture.Update(defaultArgoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Repo.Replicas = ptr.To(int32(2)) + ac.Spec.Repo.Replicas = new(int32(2)) }) By("creating an Argo CD Application targeting the Argo CD namespace") @@ -152,7 +151,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("updating repo server replicas back to 1") argocdFixture.Update(defaultArgoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Repo.Replicas = ptr.To(int32(1)) + ac.Spec.Repo.Replicas = new(int32(1)) }) By("verifying repo server Deployment moves back to a single replica") diff --git a/test/openshift/e2e/ginkgo/sequential/1-037_validate_applicationset_in_any_namespace_test.go b/test/openshift/e2e/ginkgo/sequential/1-037_validate_applicationset_in_any_namespace_test.go index ef2e8c65d4a..38359ae9e16 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-037_validate_applicationset_in_any_namespace_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-037_validate_applicationset_in_any_namespace_test.go @@ -3,6 +3,7 @@ package sequential import ( "context" "fmt" + "slices" "strings" "github.com/argoproj-labs/argocd-operator/api/v1beta1" @@ -1237,37 +1238,37 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("creating an ApplicationSet in the target namespace") appset := &unstructured.Unstructured{ - Object: map[string]interface{}{ + Object: map[string]any{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ApplicationSet", - "metadata": map[string]interface{}{ + "metadata": map[string]any{ "name": "guestbook-appset", "namespace": targetNS.Name, }, - "spec": map[string]interface{}{ - "generators": []interface{}{ - map[string]interface{}{ - "list": map[string]interface{}{ - "elements": []interface{}{ - map[string]interface{}{ + "spec": map[string]any{ + "generators": []any{ + map[string]any{ + "list": map[string]any{ + "elements": []any{ + map[string]any{ "name": "guestbook", }, }, }, }, }, - "template": map[string]interface{}{ - "metadata": map[string]interface{}{ + "template": map[string]any{ + "metadata": map[string]any{ "name": "{{name}}", }, - "spec": map[string]interface{}{ + "spec": map[string]any{ "project": "default", - "source": map[string]interface{}{ + "source": map[string]any{ "repoURL": "https://github.com/argoproj/argocd-example-apps.git", "targetRevision": "HEAD", "path": "guestbook", }, - "destination": map[string]interface{}{ + "destination": map[string]any{ "server": "https://kubernetes.default.svc", "namespace": targetNS.Name, }, @@ -1410,13 +1411,7 @@ func removeListVerbFromNamespacesRules(rules []rbacv1.PolicyRule) ([]rbacv1.Poli continue } - hasList := false - for _, verb := range rule.Verbs { - if verb == "list" { - hasList = true - break - } - } + hasList := slices.Contains(rule.Verbs, "list") if !hasList { modifiedRules = append(modifiedRules, rule) continue diff --git a/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go b/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go index 6af261cbe11..3617ab8432d 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go @@ -29,7 +29,6 @@ import ( networkingv1 "k8s.io/api/networking/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" argov1beta1api "github.com/argoproj-labs/argocd-operator/api/v1beta1" @@ -93,11 +92,11 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ Controller: argov1beta1api.ArgoCDApplicationControllerSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Principal: &argov1beta1api.PrincipalSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Auth: "mtls:CN=([^,]+)", LogLevel: "info", Namespace: &argov1beta1api.PrincipalNamespaceSpec{ @@ -106,10 +105,10 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { }, }, TLS: &argov1beta1api.PrincipalTLSSpec{ - InsecureGenerate: ptr.To(true), + InsecureGenerate: new(true), }, JWT: &argov1beta1api.PrincipalJWTSpec{ - InsecureGenerate: ptr.To(true), + InsecureGenerate: new(true), }, Server: &argov1beta1api.PrincipalServerSpec{ KeepAliveMinInterval: "30s", @@ -279,7 +278,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { verifyExpectedResourcesExist := func(namespace *corev1.Namespace, expectRoute ...bool) { var expectRoutePtr *bool if len(expectRoute) > 0 { - expectRoutePtr = ptr.To(expectRoute[0]) + expectRoutePtr = new(expectRoute[0]) } agentFixture.VerifyExpectedResourcesExist(agentFixture.VerifyExpectedResourcesExistParams{ @@ -338,7 +337,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Principal.Enabled = ptr.To(false) + ac.Spec.ArgoCDAgent.Principal.Enabled = new(false) }) By("Verify principal resources are deleted") @@ -441,19 +440,19 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { ac.Spec.ArgoCDAgent.Principal.LogLevel = "trace" ac.Spec.ArgoCDAgent.Principal.LogFormat = "json" ac.Spec.ArgoCDAgent.Principal.Server.KeepAliveMinInterval = "60s" - ac.Spec.ArgoCDAgent.Principal.Server.EnableWebSocket = ptr.To(true) + ac.Spec.ArgoCDAgent.Principal.Server.EnableWebSocket = new(true) ac.Spec.ArgoCDAgent.Principal.Image = "quay.io/argoprojlabs/argocd-agent:v0.8.1" ac.Spec.ArgoCDAgent.Principal.Namespace.AllowedNamespaces = []string{"agent-managed", "agent-autonomous"} - ac.Spec.ArgoCDAgent.Principal.Namespace.EnableNamespaceCreate = ptr.To(true) + ac.Spec.ArgoCDAgent.Principal.Namespace.EnableNamespaceCreate = new(true) ac.Spec.ArgoCDAgent.Principal.Namespace.NamespaceCreatePattern = "agent-.*" ac.Spec.ArgoCDAgent.Principal.Namespace.NamespaceCreateLabels = []string{"environment=agent"} - ac.Spec.ArgoCDAgent.Principal.TLS.InsecureGenerate = ptr.To(false) + ac.Spec.ArgoCDAgent.Principal.TLS.InsecureGenerate = new(false) ac.Spec.ArgoCDAgent.Principal.TLS.SecretName = "argocd-agent-principal-tls-v2" ac.Spec.ArgoCDAgent.Principal.TLS.RootCASecretName = "argocd-agent-ca-v2" - ac.Spec.ArgoCDAgent.Principal.JWT.InsecureGenerate = ptr.To(false) + ac.Spec.ArgoCDAgent.Principal.JWT.InsecureGenerate = new(false) ac.Spec.ArgoCDAgent.Principal.JWT.SecretName = "argocd-agent-jwt-v2" ac.Spec.ArgoCDAgent.Principal.ResourceProxy = &argov1beta1api.PrincipalResourceProxySpec{ @@ -524,7 +523,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("Create ArgoCD instance with route disabled") argoCD.Spec.ArgoCDAgent.Principal.Server.Route = argov1beta1api.ArgoCDAgentPrincipalRouteSpec{ - Enabled: ptr.To(false), + Enabled: new(false), } Expect(k8sClient.Create(ctx, argoCD)).To(Succeed()) @@ -544,7 +543,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("Create ArgoCD instance with route enabled") argoCD.Spec.ArgoCDAgent.Principal.Server.Route = argov1beta1api.ArgoCDAgentPrincipalRouteSpec{ - Enabled: ptr.To(true), + Enabled: new(true), } Expect(k8sClient.Create(ctx, argoCD)).To(Succeed()) @@ -564,7 +563,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("Create ArgoCD instance with route enabled") argoCD.Spec.ArgoCDAgent.Principal.Server.Route = argov1beta1api.ArgoCDAgentPrincipalRouteSpec{ - Enabled: ptr.To(true), + Enabled: new(true), } Expect(k8sClient.Create(ctx, argoCD)).To(Succeed()) @@ -582,7 +581,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Principal.Server.Route.Enabled = ptr.To(false) + ac.Spec.ArgoCDAgent.Principal.Server.Route.Enabled = new(false) }) By("Verify Route for principal is deleted") @@ -615,7 +614,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Principal.Server.Route.Enabled = ptr.To(true) + ac.Spec.ArgoCDAgent.Principal.Server.Route.Enabled = new(true) }) By("Verify Route for principal is recreated") @@ -855,7 +854,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { It("should create principal NetworkPolicy if principal is enabled", func() { By("Create ArgoCD instance with principal enabled") - argoCD.Spec.ArgoCDAgent.Principal.Enabled = ptr.To(true) + argoCD.Spec.ArgoCDAgent.Principal.Enabled = new(true) Expect(k8sClient.Create(ctx, argoCD)).To(Succeed()) verifyExpectedResourcesExist(ns) @@ -901,15 +900,15 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("Verify principal NetworkPolicy is created when principal instance is enabled and network policy is enabled") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Principal.Enabled = ptr.To(true) - ac.Spec.NetworkPolicy.Enabled = ptr.To(true) + ac.Spec.ArgoCDAgent.Principal.Enabled = new(true) + ac.Spec.NetworkPolicy.Enabled = new(true) }) Eventually(principalNetworkPolicy).Should(k8sFixture.ExistByName()) By("Verify principal NetworkPolicy is not created when network policy is disabled") argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.NetworkPolicy.Enabled = ptr.To(false) + ac.Spec.NetworkPolicy.Enabled = new(false) }) Eventually(principalNetworkPolicy).Should(k8sFixture.NotExistByName()) @@ -958,7 +957,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Principal.Enabled = ptr.To(false) + ac.Spec.ArgoCDAgent.Principal.Enabled = new(false) }) Eventually(principalServiceMonitor, "2m", "2s").Should(k8sFixture.NotExistByName()) diff --git a/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go b/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go index 4f09dd428ee..cceb2c7b531 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go @@ -27,7 +27,6 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" argov1beta1api "github.com/argoproj-labs/argocd-operator/api/v1beta1" @@ -83,14 +82,14 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ Controller: argov1beta1api.ArgoCDApplicationControllerSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, Server: argov1beta1api.ArgoCDServerSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Agent: &argov1beta1api.AgentSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Creds: "mtls:any", LogLevel: "info", LogFormat: "text", @@ -98,14 +97,14 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { PrincipalServerAddress: "argocd-agent-principal.example.com", PrincipalServerPort: "443", Mode: string(argov1beta1api.AgentModeManaged), - EnableWebSocket: ptr.To(false), - EnableCompression: ptr.To(false), + EnableWebSocket: new(false), + EnableCompression: new(false), KeepAliveInterval: "30s", }, TLS: &argov1beta1api.AgentTLSSpec{ SecretName: agentClientTLSSecretName, RootCASecretName: agentRootCASecretName, - Insecure: ptr.To(false), + Insecure: new(false), }, Redis: &argov1beta1api.AgentRedisSpec{ ServerAddress: fmt.Sprintf("%s-%s:%d", argoCDName, "redis", common.ArgoCDDefaultRedisPort), @@ -314,7 +313,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Agent.Enabled = ptr.To(false) + ac.Spec.ArgoCDAgent.Agent.Enabled = new(false) }) By("Verify agent resources are deleted") @@ -403,13 +402,13 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { ac.Spec.ArgoCDAgent.Agent.Image = "quay.io/argoprojlabs/argocd-agent:v0.8.1" ac.Spec.ArgoCDAgent.Agent.Client.KeepAliveInterval = "60s" - ac.Spec.ArgoCDAgent.Agent.Client.EnableWebSocket = ptr.To(true) - ac.Spec.ArgoCDAgent.Agent.Client.EnableCompression = ptr.To(true) + ac.Spec.ArgoCDAgent.Agent.Client.EnableWebSocket = new(true) + ac.Spec.ArgoCDAgent.Agent.Client.EnableCompression = new(true) ac.Spec.ArgoCDAgent.Agent.Client.Mode = string(argov1beta1api.AgentModeAutonomous) ac.Spec.ArgoCDAgent.Agent.Client.PrincipalServerAddress = "argocd-agent-principal-updated.example.com" ac.Spec.ArgoCDAgent.Agent.Client.PrincipalServerPort = "8443" - ac.Spec.ArgoCDAgent.Agent.TLS.Insecure = ptr.To(true) + ac.Spec.ArgoCDAgent.Agent.TLS.Insecure = new(true) ac.Spec.ArgoCDAgent.Agent.TLS.SecretName = "argocd-agent-client-tls-v2" ac.Spec.ArgoCDAgent.Agent.TLS.RootCASecretName = "argocd-agent-ca-v2" @@ -629,7 +628,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(k8sClient.Get(ctx, client.ObjectKey{Name: argoCDName, Namespace: ns.Name}, argoCD)).To(Succeed()) argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.ArgoCDAgent.Agent.Enabled = ptr.To(false) + ac.Spec.ArgoCDAgent.Agent.Enabled = new(false) }) Eventually(agentServiceMonitor, "2m", "2s").Should(k8sFixture.NotExistByName()) diff --git a/test/openshift/e2e/ginkgo/sequential/1-053_validate_argocd_agent_principal_connected_test.go b/test/openshift/e2e/ginkgo/sequential/1-053_validate_argocd_agent_principal_connected_test.go index a6fb2527c93..0d049f71358 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-053_validate_argocd_agent_principal_connected_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-053_validate_argocd_agent_principal_connected_test.go @@ -43,7 +43,6 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/argoproj/argo-cd/gitops-engine/pkg/health" @@ -787,11 +786,11 @@ func buildArgoCDResource(argoCDName string, componentType argov1beta1api.AgentCo if componentType == argov1beta1api.AgentComponentTypePrincipal { argoCD.Spec = argov1beta1api.ArgoCDSpec{ Controller: argov1beta1api.ArgoCDApplicationControllerSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Principal: &argov1beta1api.PrincipalSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Auth: "mtls:CN=([^,]+)", LogLevel: "debug", Image: common.ArgoCDAgentPrincipalDefaultImageName, @@ -802,15 +801,15 @@ func buildArgoCDResource(argoCDName string, componentType argov1beta1api.AgentCo }, }, TLS: &argov1beta1api.PrincipalTLSSpec{ - InsecureGenerate: ptr.To(false), + InsecureGenerate: new(false), }, JWT: &argov1beta1api.PrincipalJWTSpec{ - InsecureGenerate: ptr.To(false), + InsecureGenerate: new(false), }, Server: &argov1beta1api.PrincipalServerSpec{ KeepAliveMinInterval: "30s", Route: argov1beta1api.ArgoCDAgentPrincipalRouteSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, Service: argov1beta1api.ArgoCDAgentPrincipalServiceSpec{ Type: corev1.ServiceTypeLoadBalancer, @@ -818,7 +817,7 @@ func buildArgoCDResource(argoCDName string, componentType argov1beta1api.AgentCo }, }, Agent: &argov1beta1api.AgentSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, }, SourceNamespaces: []string{ @@ -830,14 +829,14 @@ func buildArgoCDResource(argoCDName string, componentType argov1beta1api.AgentCo // Agent configurations argoCD.Spec = argov1beta1api.ArgoCDSpec{ Server: argov1beta1api.ArgoCDServerSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, ArgoCDAgent: &argov1beta1api.ArgoCDAgentSpec{ Principal: &argov1beta1api.PrincipalSpec{ - Enabled: ptr.To(false), + Enabled: new(false), }, Agent: &argov1beta1api.AgentSpec{ - Enabled: ptr.To(true), + Enabled: new(true), Creds: "mtls:any", LogLevel: "debug", Image: common.ArgoCDAgentAgentDefaultImageName, @@ -853,7 +852,7 @@ func buildArgoCDResource(argoCDName string, componentType argov1beta1api.AgentCo TLS: &argov1beta1api.AgentTLSSpec{ SecretName: agentClientTLSSecretName, RootCASecretName: agentRootCASecretName, - Insecure: ptr.To(false), + Insecure: new(false), }, }, }, @@ -916,8 +915,8 @@ func buildApplicationResource(applicationName, nsName, agentName, argocdInstance }, SyncPolicy: &argocdv1alpha1.SyncPolicy{ Automated: &argocdv1alpha1.SyncPolicyAutomated{ - Prune: ptr.To(true), - SelfHeal: ptr.To(true), + Prune: new(true), + SelfHeal: new(true), }, ManagedNamespaceMetadata: &argocdv1alpha1.ManagedNamespaceMetadata{ Labels: map[string]string{ diff --git a/test/openshift/e2e/ginkgo/sequential/1-071_validate_SCC_HA_test.go b/test/openshift/e2e/ginkgo/sequential/1-071_validate_SCC_HA_test.go index 500b879c220..ab92959c06b 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-071_validate_SCC_HA_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-071_validate_SCC_HA_test.go @@ -31,7 +31,6 @@ import ( fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -75,7 +74,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { AllowHostNetwork: false, AllowHostPID: false, AllowHostPorts: false, - AllowPrivilegeEscalation: ptr.To(false), + AllowPrivilegeEscalation: new(false), AllowPrivilegedContainer: false, AllowedCapabilities: nil, DefaultAddCapabilities: nil, diff --git a/test/openshift/e2e/ginkgo/sequential/1-074_validate_terminating_namespace_block_test.go b/test/openshift/e2e/ginkgo/sequential/1-074_validate_terminating_namespace_block_test.go index 4158b29ccd0..3ff290eb0d9 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-074_validate_terminating_namespace_block_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-074_validate_terminating_namespace_block_test.go @@ -30,7 +30,6 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -63,8 +62,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { }, Spec: argov1beta1api.ArgoCDSpec{ RBAC: argov1beta1api.ArgoCDRBACSpec{ - Policy: ptr.To("g, system:authenticated, role:admin"), - Scopes: ptr.To("[groups]"), + Policy: new("g, system:authenticated, role:admin"), + Scopes: new("[groups]"), }, }, } diff --git a/test/openshift/e2e/ginkgo/sequential/1-085_validate_dynamic_plugin_installation_test.go b/test/openshift/e2e/ginkgo/sequential/1-085_validate_dynamic_plugin_installation_test.go index fa4032f1017..3985ea689d6 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-085_validate_dynamic_plugin_installation_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-085_validate_dynamic_plugin_installation_test.go @@ -70,7 +70,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { output, err := osFixture.ExecCommand("oc", "version") Expect(err).ToNot(HaveOccurred()) - for _, line := range strings.Split(output, "\n") { + for line := range strings.SplitSeq(output, "\n") { if strings.Contains(line, "Server Version:") { ocVersion = strings.TrimSpace(line[strings.Index(line, ":")+1:]) diff --git a/test/openshift/e2e/ginkgo/sequential/1-086_validate_default_argocd_role_test.go b/test/openshift/e2e/ginkgo/sequential/1-086_validate_default_argocd_role_test.go index 3fdd4a2f330..38beb5b62e4 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-086_validate_default_argocd_role_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-086_validate_default_argocd_role_test.go @@ -13,7 +13,6 @@ import ( "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -77,7 +76,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { ObjectMeta: metav1.ObjectMeta{Name: "argocd-default-policy-empty", Namespace: test_1_086_custom2NS.Name}, Spec: argov1beta1api.ArgoCDSpec{ RBAC: argov1beta1api.ArgoCDRBACSpec{ - DefaultPolicy: ptr.To(""), + DefaultPolicy: new(""), }, Server: argov1beta1api.ArgoCDServerSpec{ Route: argov1beta1api.ArgoCDRouteSpec{ @@ -92,7 +91,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { ObjectMeta: metav1.ObjectMeta{Name: "argocd-default-policy-admin", Namespace: test_1_086_custom3NS.Name}, Spec: argov1beta1api.ArgoCDSpec{ RBAC: argov1beta1api.ArgoCDRBACSpec{ - DefaultPolicy: ptr.To("role:admin"), + DefaultPolicy: new("role:admin"), }, Server: argov1beta1api.ArgoCDServerSpec{ Route: argov1beta1api.ArgoCDRouteSpec{ diff --git a/test/openshift/e2e/ginkgo/sequential/1-102_validate_handle_terminating_namespaces_test.go b/test/openshift/e2e/ginkgo/sequential/1-102_validate_handle_terminating_namespaces_test.go index 3a6da663b2f..96fe2c1609c 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-102_validate_handle_terminating_namespaces_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-102_validate_handle_terminating_namespaces_test.go @@ -33,7 +33,6 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -167,8 +166,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Project: "default", SyncPolicy: &argocdv1alpha1.SyncPolicy{ Automated: &argocdv1alpha1.SyncPolicyAutomated{ - Prune: ptr.To(true), - SelfHeal: ptr.To(true), + Prune: new(true), + SelfHeal: new(true), }, }, }, diff --git a/test/openshift/e2e/ginkgo/sequential/1-105_validate_default_argocd_route_test.go b/test/openshift/e2e/ginkgo/sequential/1-105_validate_default_argocd_route_test.go index c383cfcdcec..824c20503d3 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-105_validate_default_argocd_route_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-105_validate_default_argocd_route_test.go @@ -28,7 +28,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" ) var _ = Describe("GitOps Operator Sequential E2E Tests", func() { @@ -73,7 +72,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Eventually(serverRoute).Should(routeFixture.HaveTo(routev1.RouteTargetReference{ Kind: "Service", Name: "openshift-gitops-server", - Weight: ptr.To(int32(100)), + Weight: new(int32(100)), })) By("verifying Route ingress has been admitted") @@ -115,7 +114,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Eventually(serverRoute).Should(routeFixture.HaveTo(routev1.RouteTargetReference{ Kind: "Service", Name: "openshift-gitops-server", - Weight: ptr.To(int32(100)), + Weight: new(int32(100)), })) Eventually(serverRoute).Should(routeFixture.HaveConditionTypeStatus(routev1.RouteAdmitted, corev1.ConditionTrue)) diff --git a/test/openshift/e2e/ginkgo/sequential/1-105_validate_label_selector_test.go b/test/openshift/e2e/ginkgo/sequential/1-105_validate_label_selector_test.go index 93553c5452b..9624492921d 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-105_validate_label_selector_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-105_validate_label_selector_test.go @@ -13,7 +13,6 @@ import ( "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -84,8 +83,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { ac.Spec.RBAC = argov1beta1api.ArgoCDRBACSpec{ - Policy: ptr.To("g, system:cluster-admins, role:admin\ng, cluster-admins, role:admin"), - Scopes: ptr.To("[email]"), + Policy: new("g, system:cluster-admins, role:admin\ng, cluster-admins, role:admin"), + Scopes: new("[email]"), } }) @@ -108,8 +107,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) { ac.Spec.RBAC = argov1beta1api.ArgoCDRBACSpec{ - Policy: ptr.To("g, system:cluster-admins, role:admin\ng, cluster-admins, role:admin"), - Scopes: ptr.To("[people]"), + Policy: new("g, system:cluster-admins, role:admin\ng, cluster-admins, role:admin"), + Scopes: new("[people]"), } }) diff --git a/test/openshift/e2e/ginkgo/sequential/1-106_validate_argocd_metrics_controller_test.go b/test/openshift/e2e/ginkgo/sequential/1-106_validate_argocd_metrics_controller_test.go index 08a7da2bcd9..9a8f98d5b1f 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-106_validate_argocd_metrics_controller_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-106_validate_argocd_metrics_controller_test.go @@ -11,7 +11,6 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" ) var _ = Describe("GitOps Operator Sequential E2E Tests", func() { @@ -60,7 +59,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("disabling metrics via ArgoCD CR .spec.monitoring.disableMetrics") argocdFixture.Update(defaultArgoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Monitoring.DisableMetrics = ptr.To(true) + ac.Spec.Monitoring.DisableMetrics = new(true) }) By("verifying all metrics resources are in disabled state") @@ -83,7 +82,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("re-enabling metrics") argocdFixture.Update(defaultArgoCD, func(ac *argov1beta1api.ArgoCD) { - ac.Spec.Monitoring.DisableMetrics = ptr.To(false) + ac.Spec.Monitoring.DisableMetrics = new(false) }) By("verifying metrics are re-enabled") diff --git a/test/openshift/e2e/ginkgo/sequential/1-108_alternate_cluster_roles_cluster_scoped_instance_test.go b/test/openshift/e2e/ginkgo/sequential/1-108_alternate_cluster_roles_cluster_scoped_instance_test.go index db85751cbad..e164abcfed2 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-108_alternate_cluster_roles_cluster_scoped_instance_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-108_alternate_cluster_roles_cluster_scoped_instance_test.go @@ -248,8 +248,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Project: "default", SyncPolicy: &argocdv1alpha1.SyncPolicy{ Automated: &argocdv1alpha1.SyncPolicyAutomated{ - Prune: ptr.To(true), - SelfHeal: ptr.To(true), + Prune: new(true), + SelfHeal: new(true), }, }, }, diff --git a/test/openshift/e2e/ginkgo/sequential/1-111_validate_default_argocd_route_test.go b/test/openshift/e2e/ginkgo/sequential/1-111_validate_default_argocd_route_test.go index c88f392faf6..e79a0cfc545 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-111_validate_default_argocd_route_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-111_validate_default_argocd_route_test.go @@ -12,7 +12,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/ptr" ) var _ = Describe("GitOps Operator Sequential E2E Tests", func() { @@ -53,7 +52,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { Expect(serverRoute.Spec.To).Should(Equal(routev1.RouteTargetReference{ Kind: "Service", Name: "openshift-gitops-server", - Weight: ptr.To(int32(100)), + Weight: new(int32(100)), })) By("verifying Route has admitted ingress") diff --git a/test/openshift/e2e/ginkgo/sequential/1-120_repo_server_system_ca_trust.go b/test/openshift/e2e/ginkgo/sequential/1-120_repo_server_system_ca_trust.go index 7c7cc1c3cf5..39286e0ce0a 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-120_repo_server_system_ca_trust.go +++ b/test/openshift/e2e/ginkgo/sequential/1-120_repo_server_system_ca_trust.go @@ -35,8 +35,6 @@ import ( configmapFixture "github.com/argoproj-labs/argocd-operator/tests/ginkgo/fixture/configmap" secretFixture "github.com/argoproj-labs/argocd-operator/tests/ginkgo/fixture/secret" - "k8s.io/utils/ptr" - appFixture "github.com/argoproj-labs/argocd-operator/tests/ginkgo/fixture/application" osFixture "github.com/argoproj-labs/argocd-operator/tests/ginkgo/fixture/os" @@ -140,8 +138,8 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { SystemCATrust: &argov1beta1api.ArgoCDSystemCATrustSpec{ DropImageCertificates: true, // So we can test against upstream sites that would otherwise be trusted by the image ClusterTrustBundles: []corev1.ClusterTrustBundleProjection{ - {Name: ptr.To(combinedCtb.Name), Path: "combined.crt"}, - {Name: ptr.To("nah"), Path: "no-such-ctb.crt", Optional: ptr.To(true)}, + {Name: new(combinedCtb.Name), Path: "combined.crt"}, + {Name: new("nah"), Path: "no-such-ctb.crt", Optional: new(true)}, }, }, // plugin containers/volumes - this is not related to CTBs @@ -189,7 +187,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { LocalObjectReference: corev1.LocalObjectReference{ Name: cmCert.Name, }, - Optional: ptr.To(true), + Optional: new(true), Items: []corev1.KeyToPath{ {Key: "ca.cm.crt", Path: "ca.cm.wrong-suffix"}, }, @@ -267,13 +265,13 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { LocalObjectReference: corev1.LocalObjectReference{ Name: "ca-trust", }, - Optional: ptr.To(true), + Optional: new(true), }}, ConfigMaps: []corev1.ConfigMapProjection{{ LocalObjectReference: corev1.LocalObjectReference{ Name: "ca-trust", }, - Optional: ptr.To(true), + Optional: new(true), }}, }, }) @@ -358,7 +356,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { SystemCATrust: &argov1beta1api.ArgoCDSystemCATrustSpec{ DropImageCertificates: true, // To make the counting easier ClusterTrustBundles: []corev1.ClusterTrustBundleProjection{{ - Name: ptr.To(combinedCtb.Name), Path: "ctb.crt", Optional: ptr.To(true), + Name: new(combinedCtb.Name), Path: "ctb.crt", Optional: new(true), }}, }, }) @@ -412,12 +410,12 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { // Test CTB update detection based on CTB binding specified by labels - no real signers involved ClusterTrustBundles: []corev1.ClusterTrustBundleProjection{ { - SignerName: ptr.To(signerName), + SignerName: new(signerName), LabelSelector: &metav1.LabelSelector{MatchLabels: map[string]string{ "test": labelVal, }}, Path: "one.crt", - Optional: ptr.To(true), + Optional: new(true), }, }, }, @@ -452,9 +450,9 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { argocdFixture.Update(argoCD, func(cd *argov1beta1api.ArgoCD) { cd.Spec.Repo.SystemCATrust.ClusterTrustBundles = []corev1.ClusterTrustBundleProjection{ { - Name: ptr.To("no-such-ctb"), + Name: new("no-such-ctb"), Path: "three.crt", - Optional: ptr.To(true), + Optional: new(true), }, } }) @@ -601,7 +599,7 @@ func createHelmApp(ns *corev1.Namespace, source *appv1alpha1.ApplicationSource) }, SyncPolicy: &appv1alpha1.SyncPolicy{ Automated: &appv1alpha1.SyncPolicyAutomated{ - Prune: ptr.To(true), SelfHeal: ptr.To(true), + Prune: new(true), SelfHeal: new(true), }, }, }, diff --git a/test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go b/test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go index 81b66ad2cd8..67c30da645b 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go +++ b/test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go @@ -126,7 +126,7 @@ func gather() string { Expect(err).ToNot(HaveOccurred()) errorLines := make([]string, 0) - for _, line := range strings.Split(stdout, "\n") { + for line := range strings.SplitSeq(stdout, "\n") { if strings.Contains(line, "error:") { errorLines = append(errorLines, line) } diff --git a/test/openshift/e2e/ginkgo/sequential/1-121-valiate_resource_constraints_gitopsservice_test.go b/test/openshift/e2e/ginkgo/sequential/1-121-valiate_resource_constraints_gitopsservice_test.go index d28b82549ef..7c497044ec5 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-121-valiate_resource_constraints_gitopsservice_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-121-valiate_resource_constraints_gitopsservice_test.go @@ -27,7 +27,7 @@ import ( func getOCPVersion() string { output, err := osFixture.ExecCommand("oc", "version") Expect(err).ToNot(HaveOccurred()) - for _, line := range strings.Split(output, "\n") { + for line := range strings.SplitSeq(output, "\n") { if strings.Contains(line, "Server Version:") { return strings.TrimSpace(line[strings.Index(line, ":")+1:]) }