Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/openshift/e2e/ginkgo/parallel/1-050_validate_sso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
argov1beta1api "github.com/argoproj-labs/argocd-operator/api/v1beta1"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
configv1 "github.com/openshift/api/config/v1"
"github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture"
argocdFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/argocd"
deploymentFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/deployment"
Expand All @@ -32,6 +33,14 @@ func getOCPVersion() string {
return ""
}

func IsExternalAuthenticationEnabledOnCluster(ctx context.Context, c client.Client) bool {
var authConfig configv1.Authentication
if err := c.Get(ctx, types.NamespacedName{Name: "cluster"}, &authConfig); err != nil {
return false
}
return authConfig.Spec.Type == "OIDC"
}

var _ = Describe("GitOps Operator Parallel E2E Tests", func() {

Context("1-050_validate_sso", func() {
Expand Down Expand Up @@ -66,6 +75,11 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
Skip("skipping this test as OCP version is less than 4.20")
return
}

if !IsExternalAuthenticationEnabledOnCluster(ctx, k8sClient) {
Skip("skipping this test as external authentication type is not OIDC on the cluster")
return
}
ns, cleanupFunc = fixture.CreateRandomE2ETestNamespaceWithCleanupFunc()

argoCD := &argov1beta1api.ArgoCD{
Expand Down
Loading