diff --git a/controllers/argocd/custommapper_test.go b/controllers/argocd/custommapper_test.go index acd32905e..8cfad322e 100644 --- a/controllers/argocd/custommapper_test.go +++ b/controllers/argocd/custommapper_test.go @@ -153,7 +153,7 @@ func TestReconcileArgoCD_tlsSecretMapperRepoServer(t *testing.T) { resObjs := []client.Object{argocd, secret, service} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -210,7 +210,7 @@ func TestReconcileArgoCD_tlsSecretMapperRepoServer(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -260,7 +260,7 @@ func TestReconcileArgoCD_tlsSecretMapperRepoServer(t *testing.T) { resObjs := []client.Object{argocd, secret, service} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -290,7 +290,7 @@ func TestReconcileArgoCD_tlsSecretMapperRepoServer(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -324,7 +324,7 @@ func TestReconcileArgoCD_tlsSecretMapperRepoServer(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -385,7 +385,7 @@ func TestReconcileArgoCD_tlsSecretMapperRedis(t *testing.T) { resObjs := []client.Object{argocd, secret, service} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -442,7 +442,7 @@ func TestReconcileArgoCD_tlsSecretMapperRedis(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -492,7 +492,7 @@ func TestReconcileArgoCD_tlsSecretMapperRedis(t *testing.T) { resObjs := []client.Object{argocd, secret, service} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -522,7 +522,7 @@ func TestReconcileArgoCD_tlsSecretMapperRedis(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -556,7 +556,7 @@ func TestReconcileArgoCD_tlsSecretMapperRedis(t *testing.T) { resObjs := []client.Object{argocd, secret} subresObjs := []client.Object{argocd} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) diff --git a/controllers/argocd/keycloak_test.go b/controllers/argocd/keycloak_test.go index 58670e341..37236dafa 100644 --- a/controllers/argocd/keycloak_test.go +++ b/controllers/argocd/keycloak_test.go @@ -354,7 +354,7 @@ func TestKeycloak_testServerCert(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -426,7 +426,7 @@ func TestKeycloakConfigVerifyTLSForOpenShift(t *testing.T) { resObjs := []client.Object{test.argoCD} subresObjs := []client.Object{test.argoCD} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) diff --git a/controllers/argocd/route_test.go b/controllers/argocd/route_test.go index 4b2c6dfb0..626520e55 100644 --- a/controllers/argocd/route_test.go +++ b/controllers/argocd/route_test.go @@ -37,7 +37,7 @@ func TestReconcileRouteSetLabels(t *testing.T) { resObjs := []client.Object{argoCD} subresObjs := []client.Object{argoCD} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -73,7 +73,7 @@ func TestReconcileRouteSetsInsecure(t *testing.T) { resObjs := []client.Object{argoCD} subresObjs := []client.Object{argoCD} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -149,7 +149,7 @@ func TestReconcileRouteUnsetsInsecure(t *testing.T) { resObjs := []client.Object{argoCD} subresObjs := []client.Object{argoCD} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) diff --git a/controllers/argocd/secret_test.go b/controllers/argocd/secret_test.go index f694f43ef..8fbcc0058 100644 --- a/controllers/argocd/secret_test.go +++ b/controllers/argocd/secret_test.go @@ -120,7 +120,7 @@ func Test_ReconcileArgoCD_ReconcileRepoTLSSecret(t *testing.T) { repoDepl, ctrlSts} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -329,7 +329,7 @@ func Test_ReconcileArgoCD_ReconcileRedisTLSSecret(t *testing.T) { ctrlSts, redisDepl} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) diff --git a/controllers/argocd/sso.go b/controllers/argocd/sso.go index 6b3f38172..3acd2ab69 100644 --- a/controllers/argocd/sso.go +++ b/controllers/argocd/sso.go @@ -44,7 +44,7 @@ func IsTemplateAPIAvailable() bool { // verifyTemplateAPI will verify that the template API is present. func verifyTemplateAPI() error { - found, err := argoutil.VerifyAPI(template.SchemeGroupVersion.Group, template.SchemeGroupVersion.Version) + found, err := argoutil.VerifyAPI(template.GroupVersion.Group, template.GroupVersion.Version) if err != nil { return err } diff --git a/controllers/argocd/sso_test.go b/controllers/argocd/sso_test.go index 099a973e0..08d30e07d 100644 --- a/controllers/argocd/sso_test.go +++ b/controllers/argocd/sso_test.go @@ -44,7 +44,7 @@ func TestReconcile_testKeycloakTemplateInstance(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -69,7 +69,7 @@ func TestReconcile_noTemplateInstance(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -215,7 +215,7 @@ func TestReconcile_illegalSSOConfiguration(t *testing.T) { resObjs := []client.Object{test.argoCD} subresObjs := []client.Object{test.argoCD} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -254,7 +254,7 @@ func TestReconcile_testKeycloakK8sInstance(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) @@ -273,7 +273,7 @@ func TestReconcile_testKeycloakInstanceResources(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.AddToScheme, oappsv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, templatev1.Install, oappsv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch) diff --git a/controllers/argocd/status_test.go b/controllers/argocd/status_test.go index 241120785..78ab78b69 100644 --- a/controllers/argocd/status_test.go +++ b/controllers/argocd/status_test.go @@ -65,7 +65,7 @@ func TestReconcileArgoCD_reconcileStatusKeycloak_OpenShift(t *testing.T) { assert.NoError(t, createNamespace(r, a.Namespace, "")) - assert.NoError(t, oappsv1.AddToScheme(r.Scheme)) + assert.NoError(t, oappsv1.Install(r.Scheme)) templateAPIFound = true defer removeTemplateAPI() @@ -255,7 +255,7 @@ func TestReconcileArgoCD_reconcileStatusHost(t *testing.T) { resObjs := []client.Object{a} subresObjs := []client.Object{a} runtimeObjs := []runtime.Object{} - sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.AddToScheme, routev1.AddToScheme) + sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install) cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs) r := makeTestReconciler(cl, sch)