Skip to content

Commit e8f5a9a

Browse files
authored
chore: Update to latest commit of argocd-operator: 80f37522108a42db5bdb5d5c13403a4090b94c6f (#947)
Signed-off-by: Jonathan West <[email protected]>
1 parent ef0cfb0 commit e8f5a9a

12 files changed

+11
-1147
lines changed

bundle/manifests/argoproj.io_argocds.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7542,7 +7542,7 @@ spec:
75427542
keycloak:
75437543
description: |-
75447544
Keycloak contains the configuration for Argo CD keycloak authentication
7545-
Deprecated: This field is planned for removal in a future release and will no longer be supported.
7545+
Removed: This field is no longer supported and the related functionality has been removed.
75467546
properties:
75477547
host:
75487548
description: Host is the hostname to use for Ingress/Route
@@ -28719,8 +28719,9 @@ spec:
2871928719
type: array
2872028720
type: object
2872128721
keycloak:
28722-
description: Keycloak contains the configuration for Argo CD keycloak
28723-
authentication
28722+
description: |-
28723+
Keycloak contains the configuration for Argo CD keycloak authentication
28724+
Removed: This field is no longer supported and the related functionality has been removed.
2872428725
properties:
2872528726
host:
2872628727
description: Host is the hostname to use for Ingress/Route

config/crd/bases/argoproj.io_argocds.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7531,7 +7531,7 @@ spec:
75317531
keycloak:
75327532
description: |-
75337533
Keycloak contains the configuration for Argo CD keycloak authentication
7534-
Deprecated: This field is planned for removal in a future release and will no longer be supported.
7534+
Removed: This field is no longer supported and the related functionality has been removed.
75357535
properties:
75367536
host:
75377537
description: Host is the hostname to use for Ingress/Route
@@ -28708,8 +28708,9 @@ spec:
2870828708
type: array
2870928709
type: object
2871028710
keycloak:
28711-
description: Keycloak contains the configuration for Argo CD keycloak
28712-
authentication
28711+
description: |-
28712+
Keycloak contains the configuration for Argo CD keycloak authentication
28713+
Removed: This field is no longer supported and the related functionality has been removed.
2871328714
properties:
2871428715
host:
2871528716
description: Host is the hostname to use for Ingress/Route

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.4
44

55
require (
66
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250731075119-a100fc1d88b8
7-
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250808153852-5135028d6978
7+
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250812131727-80f37522108a
88
github.com/argoproj/argo-cd/v3 v3.1.0-rc2
99
github.com/argoproj/gitops-engine v0.7.1-0.20250617174952-093aef0dad58
1010
github.com/go-logr/logr v1.4.3
@@ -111,7 +111,6 @@ require (
111111
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
112112
github.com/opencontainers/go-digest v1.0.0 // indirect
113113
github.com/opencontainers/image-spec v1.1.1 // indirect
114-
github.com/openshift/client-go v0.0.0-20200325131901-f7baeb993edb // indirect
115114
github.com/patrickmn/go-cache v2.1.1-0.20191004192108-46f407853014+incompatible // indirect
116115
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
117116
github.com/pjbgf/sha1cd v0.3.2 // indirect

go.sum

Lines changed: 2 additions & 221 deletions
Large diffs are not rendered by default.

test/e2e/gitopsservice_test.go

Lines changed: 0 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,19 @@ package e2e
1919
import (
2020
"bytes"
2121
"context"
22-
"crypto/tls"
2322
"fmt"
24-
"io"
25-
"net/http"
26-
"net/url"
2723
"os/exec"
2824
"path/filepath"
2925
"reflect"
3026
"strings"
3127
"time"
3228

33-
b64 "encoding/base64"
34-
"encoding/json"
35-
3629
argoapp "github.com/argoproj-labs/argocd-operator/api/v1beta1"
3730
"github.com/argoproj-labs/argocd-operator/common"
3831
"github.com/argoproj-labs/argocd-operator/controllers/argoutil"
3932
. "github.com/onsi/ginkgo/v2"
4033
. "github.com/onsi/gomega"
41-
osappsv1 "github.com/openshift/api/apps/v1"
4234
configv1 "github.com/openshift/api/config/v1"
43-
routev1 "github.com/openshift/api/route/v1"
44-
templatev1 "github.com/openshift/api/template/v1"
4535
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
4636
pipelinesv1alpha1 "github.com/redhat-developer/gitops-operator/api/v1alpha1"
4737
gitopscommon "github.com/redhat-developer/gitops-operator/common"
@@ -79,14 +69,6 @@ var _ = Describe("GitOpsServiceController", func() {
7969
// update .sso.provider = keycloak to enable RHSSO for default Argo CD instance.
8070
// update verifyTLS = false to ensure operator(when run locally) can create RHSSO resources.
8171
argoCDInstance.Spec.DisableAdmin = true
82-
insecure := false
83-
// remove dex configuration, only one SSO is supported.
84-
argoCDInstance.Spec.SSO = &argoapp.ArgoCDSSOSpec{
85-
Provider: "keycloak",
86-
Keycloak: &argoapp.ArgoCDKeycloakSpec{
87-
VerifyTLS: &insecure,
88-
},
89-
}
9072

9173
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
9274
updatedInstance := &argoapp.ArgoCD{}
@@ -95,7 +77,6 @@ var _ = Describe("GitOpsServiceController", func() {
9577
return err
9678
}
9779
updatedInstance.Spec.DisableAdmin = argoCDInstance.Spec.DisableAdmin
98-
updatedInstance.Spec.SSO = argoCDInstance.Spec.SSO
9980
return k8sClient.Update(context.TODO(), updatedInstance)
10081
})
10182
Expect(err).NotTo(HaveOccurred())
@@ -633,176 +614,6 @@ var _ = Describe("GitOpsServiceController", func() {
633614
})
634615
})
635616

636-
Context("Verify RHSSO installation", func() {
637-
namespace := argoCDNamespace
638-
It("Template instance is created", func() {
639-
tInstance := &templatev1.TemplateInstance{}
640-
checkIfPresent(types.NamespacedName{Name: defaultTemplateIdentifier, Namespace: namespace}, tInstance)
641-
})
642-
643-
It("Keycloak deployment is created", func() {
644-
Eventually(func() error {
645-
dc := osappsv1.DeploymentConfig{}
646-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: defaultKeycloakIdentifier, Namespace: namespace}, &dc)
647-
if err != nil {
648-
return err
649-
}
650-
got := dc.Status.AvailableReplicas
651-
want := int32(1)
652-
if got != want {
653-
return fmt.Errorf("expected %d, got %d", want, got)
654-
}
655-
return nil
656-
}, timeout, interval).ShouldNot(HaveOccurred())
657-
})
658-
659-
It("Keycloak service is created", func() {
660-
svc := &corev1.Service{}
661-
checkIfPresent(types.NamespacedName{Name: defaultKeycloakIdentifier, Namespace: namespace}, svc)
662-
})
663-
664-
It("Keycloak service route is created", func() {
665-
route := &routev1.Route{}
666-
checkIfPresent(types.NamespacedName{Name: defaultKeycloakIdentifier, Namespace: namespace}, route)
667-
})
668-
})
669-
670-
Context("Verify RHSSO configuration", func() {
671-
namespace := argoCDNamespace
672-
673-
It("Verify RHSSO Realm creation", func() {
674-
By("get keycloak URL and credentials")
675-
route := &routev1.Route{}
676-
checkIfPresent(types.NamespacedName{Name: defaultKeycloakIdentifier, Namespace: namespace}, route)
677-
678-
secret := &corev1.Secret{}
679-
checkIfPresent(types.NamespacedName{Name: rhssosecret, Namespace: namespace}, secret)
680-
681-
userEnc := b64.URLEncoding.EncodeToString(secret.Data["SSO_USERNAME"])
682-
user, _ := b64.URLEncoding.DecodeString(userEnc)
683-
684-
passEnc := b64.URLEncoding.EncodeToString(secret.Data["SSO_PASSWORD"])
685-
pass, _ := b64.URLEncoding.DecodeString(passEnc)
686-
687-
By("get auth token from kaycloak")
688-
accessURL := fmt.Sprintf("https://%s%s", route.Spec.Host, authURL)
689-
argoRealmURL := fmt.Sprintf("https://%s%s", route.Spec.Host, realmURL)
690-
691-
accessToken, err := getAccessToken(string(user), string(pass), accessURL)
692-
Expect(err).NotTo(HaveOccurred())
693-
694-
By("create a new https request to verify Realm creation")
695-
client := http.Client{}
696-
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
697-
request, err := http.NewRequest("GET", argoRealmURL, nil)
698-
Expect(err).NotTo(HaveOccurred())
699-
request.Header.Set("Content-Type", "application/json")
700-
request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", accessToken))
701-
702-
By("verify RHSSO realm creation and check if HTTP GET returns 200 ")
703-
response, err := client.Do(request)
704-
Expect(err).NotTo(HaveOccurred())
705-
defer response.Body.Close()
706-
707-
By("verify reponse")
708-
b, err := io.ReadAll(response.Body)
709-
Expect(err).NotTo(HaveOccurred())
710-
711-
m := make(map[string]interface{})
712-
err = json.Unmarshal(b, &m)
713-
Expect(err).NotTo(HaveOccurred())
714-
715-
Expect(m["realm"]).To(Equal("argocd"))
716-
Expect(m["registrationFlow"]).To(Equal("registration"))
717-
Expect(m["browserFlow"]).To(Equal("browser"))
718-
Expect(m["clientAuthenticationFlow"]).To(Equal("clients"))
719-
Expect(m["directGrantFlow"]).To(Equal("direct grant"))
720-
Expect(m["loginWithEmailAllowed"]).To(BeTrue())
721-
722-
idps := m["identityProviders"].([]interface{})
723-
idp := idps[0].(map[string]interface{})
724-
725-
Expect(idp["alias"]).To(Equal("openshift-v4"))
726-
Expect(idp["displayName"]).To(Equal("Login with OpenShift"))
727-
Expect(idp["providerId"]).To(Equal("openshift-v4"))
728-
Expect(idp["firstBrokerLoginFlowAlias"]).To(Equal("first broker login"))
729-
})
730-
731-
It("Verify OIDC Configuration is created", func() {
732-
Eventually(func() error {
733-
cm := &corev1.ConfigMap{}
734-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: argoCDConfigMapName, Namespace: namespace}, cm)
735-
if err != nil {
736-
return err
737-
}
738-
if cm.Data[common.ArgoCDKeyOIDCConfig] == "" {
739-
return fmt.Errorf("expected OIDC configuration to be created")
740-
}
741-
return nil
742-
}, timeout, interval).ShouldNot(HaveOccurred())
743-
})
744-
745-
})
746-
747-
Context("Verify RHSSO uninstallation", func() {
748-
namespace := argoCDNamespace
749-
argocd := &argoapp.ArgoCD{}
750-
It("Remove SSO field from Argo CD CR", func() {
751-
752-
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
753-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: argoCDInstanceName, Namespace: namespace}, argocd)
754-
Expect(err).ToNot(HaveOccurred())
755-
756-
argocd.Spec.SSO = nil
757-
return k8sClient.Update(context.TODO(), argocd)
758-
})
759-
Expect(err).NotTo(HaveOccurred())
760-
})
761-
762-
It("OIDC configuration is removed", func() {
763-
Eventually(func() bool {
764-
cm := &corev1.ConfigMap{}
765-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: argoCDConfigMapName, Namespace: namespace}, cm)
766-
Expect(err).NotTo(HaveOccurred())
767-
return cm.Data[common.ArgoCDKeyOIDCConfig] == ""
768-
}, timeout, interval).Should(BeTrue())
769-
})
770-
771-
It("Template instance is deleted", func() {
772-
Eventually(func() error {
773-
templateInstance := &templatev1.TemplateInstance{}
774-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: defaultTemplateIdentifier, Namespace: namespace}, templateInstance)
775-
if kubeerrors.IsNotFound(err) {
776-
return nil
777-
}
778-
return err
779-
}, timeout, interval).ShouldNot(HaveOccurred())
780-
})
781-
782-
It("Add SSO field back and verify reconcilation", func() {
783-
insecure := false
784-
argocd.Spec.SSO = &argoapp.ArgoCDSSOSpec{
785-
Provider: defaultKeycloakIdentifier,
786-
Keycloak: &argoapp.ArgoCDKeycloakSpec{
787-
VerifyTLS: &insecure,
788-
},
789-
}
790-
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
791-
updatedInstance := &argoapp.ArgoCD{}
792-
err := k8sClient.Get(context.TODO(), types.NamespacedName{Name: argoCDInstanceName, Namespace: argoCDNamespace}, updatedInstance)
793-
if err != nil {
794-
return err
795-
}
796-
updatedInstance.Spec.SSO = argocd.Spec.SSO
797-
return k8sClient.Update(context.TODO(), updatedInstance)
798-
})
799-
Expect(err).NotTo(HaveOccurred())
800-
801-
templateInstance := &templatev1.TemplateInstance{}
802-
checkIfPresent(types.NamespacedName{Name: defaultTemplateIdentifier, Namespace: namespace}, templateInstance)
803-
})
804-
})
805-
806617
Context("Verify Configuring Infrastructure NodeSelector ", func() {
807618
name := "cluster"
808619
gitopsService := &pipelinesv1alpha1.GitopsService{}
@@ -889,61 +700,6 @@ var _ = Describe("GitOpsServiceController", func() {
889700

890701
})
891702

892-
type tokenResponse struct {
893-
AccessToken string `json:"access_token"`
894-
ExpiresIn int `json:"expires_in"`
895-
RefreshExpiresIn int `json:"refresh_expires_in"`
896-
RefreshToken string `json:"refresh_token"`
897-
TokenType string `json:"token_type"`
898-
NotBeforePolicy int `json:"not-before-policy"`
899-
SessionState string `json:"session_state"`
900-
Error string `json:"error"`
901-
ErrorDescription string `json:"error_description"`
902-
}
903-
904-
func getAccessToken(user, pass, accessURL string) (string, error) {
905-
form := url.Values{}
906-
form.Add("username", user)
907-
form.Add("password", pass)
908-
form.Add("client_id", "admin-cli")
909-
form.Add("grant_type", "password")
910-
911-
client := http.Client{}
912-
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
913-
req, err := http.NewRequest(
914-
"POST",
915-
accessURL,
916-
strings.NewReader(form.Encode()),
917-
)
918-
if err != nil {
919-
return "", err
920-
}
921-
922-
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
923-
res, err := client.Do(req)
924-
if err != nil {
925-
return "", err
926-
}
927-
928-
defer res.Body.Close()
929-
body, err := io.ReadAll(res.Body)
930-
if err != nil {
931-
return "", err
932-
}
933-
934-
tokenRes := &tokenResponse{}
935-
err = json.Unmarshal(body, tokenRes)
936-
if err != nil {
937-
return "", err
938-
}
939-
940-
if tokenRes.Error != "" {
941-
return "", err
942-
}
943-
944-
return tokenRes.AccessToken, nil
945-
}
946-
947703
func runCommandWithOutput(cmdList ...string) (string, string, error) {
948704

949705
// Output the commands to be run, so that if the test fails we can determine why

test/e2e/suite_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ const (
8080
consoleLinkName = "argocd"
8181
argoCDInstanceName = "openshift-gitops"
8282
gitopsInstanceName = "cluster"
83-
defaultKeycloakIdentifier = "keycloak"
84-
defaultTemplateIdentifier = "rhsso"
8583
realmURL = "/auth/admin/realms/argocd"
86-
rhssosecret = "keycloak-secret"
8784
clusterConfigEnv = "ARGOCD_CLUSTER_CONFIG_NAMESPACES"
8885
argocdManagedByLabel = "argocd.argoproj.io/managed-by"
8986
timeout = time.Minute * 5

0 commit comments

Comments
 (0)