diff --git a/api/v1alpha1/argocd_types.go b/api/v1alpha1/argocd_types.go index c9ac7e14a..88bc85c48 100644 --- a/api/v1alpha1/argocd_types.go +++ b/api/v1alpha1/argocd_types.go @@ -733,6 +733,15 @@ type ArgoCDStatus struct { //+operator-sdk:csv:customresourcedefinitions:type=status,displayName="ApplicationController",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} ApplicationController string `json:"applicationController,omitempty"` + // ApplicationSetController is a simple, high-level summary of where the Argo CD applicationset controller component is in its lifecycle. + // There are five possible ApplicationSetController values: + // Pending: The Argo CD applicationset controller component has been accepted by the Kubernetes system, but one or more of the required resources have not been created. + // Running: All of the required Pods for the Argo CD applicationset controller component are in a Ready state. + // Failed: At least one of the Argo CD applicationset controller component Pods had a failure. + // Unknown: For some reason the state of the Argo CD applicationset controller component could not be obtained. + //+operator-sdk:csv:customresourcedefinitions:type=status,displayName="ApplicationSetController",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + ApplicationSetController string `json:"applicationSetController,omitempty"` + // Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. // There are five possible dex values: // Pending: The Argo CD Dex component has been accepted by the Kubernetes system, but one or more of the required resources have not been created. diff --git a/bundle/manifests/argocd-operator.clusterserviceversion.yaml b/bundle/manifests/argocd-operator.clusterserviceversion.yaml index 59fb1b2a1..35361c0cb 100644 --- a/bundle/manifests/argocd-operator.clusterserviceversion.yaml +++ b/bundle/manifests/argocd-operator.clusterserviceversion.yaml @@ -747,6 +747,19 @@ spec: path: applicationController x-descriptors: - urn:alm:descriptor:com.tectonic.ui:text + - description: 'ApplicationSetController is a simple, high-level summary of + where the Argo CD applicationset controller component is in its lifecycle. + There are five possible ApplicationSetController values: Pending: The Argo + CD applicationset controller component has been accepted by the Kubernetes + system, but one or more of the required resources have not been created. + Running: All of the required Pods for the Argo CD applicationset controller + component are in a Ready state. Failed: At least one of the Argo CD applicationset + controller component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be obtained.' + displayName: ApplicationSetController + path: applicationSetController + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text - description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex values: Pending: The Argo CD Dex component has been accepted by the Kubernetes system, but diff --git a/bundle/manifests/argoproj.io_argocds.yaml b/bundle/manifests/argoproj.io_argocds.yaml index ff9379d6b..0a635d6e5 100644 --- a/bundle/manifests/argoproj.io_argocds.yaml +++ b/bundle/manifests/argoproj.io_argocds.yaml @@ -5998,6 +5998,19 @@ spec: had a failure. Unknown: For some reason the state of the Argo CD application controller component could not be obtained.' type: string + applicationSetController: + description: 'ApplicationSetController is a simple, high-level summary + of where the Argo CD applicationset controller component is in its + lifecycle. There are five possible ApplicationSetController values: + Pending: The Argo CD applicationset controller component has been + accepted by the Kubernetes system, but one or more of the required + resources have not been created. Running: All of the required Pods + for the Argo CD applicationset controller component are in a Ready + state. Failed: At least one of the Argo CD applicationset controller + component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be + obtained.' + type: string dex: description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex diff --git a/common/defaults.go b/common/defaults.go index ec60020a1..df2bd1145 100644 --- a/common/defaults.go +++ b/common/defaults.go @@ -42,6 +42,8 @@ const ( // ArgoCDNotificationsControllerComponent is the name of the Notifications controller control plane component ArgoCDNotificationsControllerComponent = "argocd-notifications-controller" + // ArgoCDApplicationSetControllerComponent is the name of the AppplicationSet controller control plane component + ArgoCDApplicationSetControllerComponent = "argocd-applicationset-controller" // ArgoCDOperatorGrafanaComponent is the name of the Grafana control plane component ArgoCDOperatorGrafanaComponent = "argocd-grafana" diff --git a/config/crd/bases/argoproj.io_argocds.yaml b/config/crd/bases/argoproj.io_argocds.yaml index 03f2eddc7..bad6297e2 100644 --- a/config/crd/bases/argoproj.io_argocds.yaml +++ b/config/crd/bases/argoproj.io_argocds.yaml @@ -6000,6 +6000,19 @@ spec: had a failure. Unknown: For some reason the state of the Argo CD application controller component could not be obtained.' type: string + applicationSetController: + description: 'ApplicationSetController is a simple, high-level summary + of where the Argo CD applicationset controller component is in its + lifecycle. There are five possible ApplicationSetController values: + Pending: The Argo CD applicationset controller component has been + accepted by the Kubernetes system, but one or more of the required + resources have not been created. Running: All of the required Pods + for the Argo CD applicationset controller component are in a Ready + state. Failed: At least one of the Argo CD applicationset controller + component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be + obtained.' + type: string dex: description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex diff --git a/config/manifests/bases/argocd-operator.clusterserviceversion.yaml b/config/manifests/bases/argocd-operator.clusterserviceversion.yaml index 88db44a00..1375fad50 100644 --- a/config/manifests/bases/argocd-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/argocd-operator.clusterserviceversion.yaml @@ -621,6 +621,19 @@ spec: path: applicationController x-descriptors: - urn:alm:descriptor:com.tectonic.ui:text + - description: 'ApplicationSetController is a simple, high-level summary of + where the Argo CD applicationset controller component is in its lifecycle. + There are five possible ApplicationSetController values: Pending: The Argo + CD applicationset controller component has been accepted by the Kubernetes + system, but one or more of the required resources have not been created. + Running: All of the required Pods for the Argo CD applicationset controller + component are in a Ready state. Failed: At least one of the Argo CD applicationset + controller component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be obtained.' + displayName: ApplicationSetController + path: applicationSetController + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text - description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex values: Pending: The Argo CD Dex component has been accepted by the Kubernetes system, but diff --git a/controllers/argocd/applicationset.go b/controllers/argocd/applicationset.go index a9beecf5b..bb9ce8bd0 100644 --- a/controllers/argocd/applicationset.go +++ b/controllers/argocd/applicationset.go @@ -21,6 +21,7 @@ import ( "reflect" corev1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" v1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -73,6 +74,16 @@ func (r *ReconcileArgoCD) reconcileApplicationSetController(cr *argoprojv1a1.Arg return err } + log.Info("reconciling applicationset ingress") + if err := r.reconcileApplicationSetControllerIngress(cr); err != nil { + return err + } + + log.Info("reconciling applicationset routes") + if err := r.reconcileApplicationSetControllerWebhookRoute(cr); err != nil { + return err + } + log.Info("reconciling applicationset service") if err := r.reconcileApplicationSetService(cr); err != nil { return err @@ -136,12 +147,17 @@ func (r *ReconcileArgoCD) reconcileApplicationSetDeployment(cr *argoprojv1a1.Arg }, } - podSpec.Containers = []corev1.Container{ - applicationSetContainer(cr), - } AddSeccompProfileForOpenShift(r.Client, podSpec) - + if cr.Spec.ApplicationSet != nil { + podSpec.Containers = []corev1.Container{ + applicationSetContainer(cr), + } + } if existing := newDeploymentWithSuffix("applicationset-controller", "controller", cr); argoutil.IsObjectFound(r.Client, cr.Namespace, existing.Name, existing) { + if cr.Spec.ApplicationSet == nil { + log.Info(fmt.Sprintf("Deleting Deployment %s as applicationset is disabled", existing.Name)) + return r.Client.Delete(context.TODO(), existing) + } existingSpec := existing.Spec.Template.Spec @@ -255,6 +271,10 @@ func (r *ReconcileArgoCD) reconcileApplicationSetServiceAccount(cr *argoprojv1a1 } if exists { + if cr.Spec.ApplicationSet == nil { + log.Info(fmt.Sprintf("Deleting service account %s as applicationset is disabled", sa.Name)) + return nil, r.Client.Delete(context.TODO(), sa) + } return sa, nil } @@ -359,6 +379,10 @@ func (r *ReconcileArgoCD) reconcileApplicationSetRole(cr *argoprojv1a1.ArgoCD) ( if !errors.IsNotFound(err) { return nil, fmt.Errorf("failed to reconcile the role for the service account associated with %s : %s", role.Name, err) } + if cr.Spec.ApplicationSet == nil { + log.Info(fmt.Sprintf("Deleting role %s as applicationset is disabled", role.Name)) + return nil, r.Client.Delete(context.TODO(), role) + } if err = controllerutil.SetControllerReference(cr, role, r.Scheme); err != nil { return nil, err } @@ -409,6 +433,10 @@ func (r *ReconcileArgoCD) reconcileApplicationSetRoleBinding(cr *argoprojv1a1.Ar } if roleBindingExists { + if cr.Spec.ApplicationSet == nil { + log.Info(fmt.Sprintf("Deleting rolebinding %s as applicationset is disabled", roleBinding.Name)) + return r.Client.Delete(context.TODO(), roleBinding) + } return r.Client.Update(context.TODO(), roleBinding) } @@ -462,13 +490,54 @@ func setAppSetLabels(obj *metav1.ObjectMeta) { obj.Labels["app.kubernetes.io/component"] = "controller" } +//deleteApplicationSetResources Triggers reconciliation of application set resources,logic for deletion of applicationset is in reconcile methods this method triggers the cleanup of resources using the reconcilation logic as CR changes +func (r *ReconcileArgoCD) deleteApplicationSetResources(cr *argoprojv1a1.ArgoCD) error { + + sa := &corev1.ServiceAccount{} + role := &rbacv1.Role{} + + if err := argoutil.FetchObject(r.Client, cr.Namespace, fmt.Sprintf("%s-%s", cr.Name, common.ArgoCDApplicationSetControllerComponent), sa); err != nil { + if !errors.IsNotFound(err) { + return err + } + } + if err := argoutil.FetchObject(r.Client, cr.Namespace, fmt.Sprintf("%s-%s", cr.Name, common.ArgoCDApplicationSetControllerComponent), role); err != nil { + if !errors.IsNotFound(err) { + return err + } + } + + log.Info("reconciling ApplicationSet deployment") + if err := r.reconcileApplicationSetDeployment(cr, sa); err != nil { + return err + } + + log.Info("reconciling ApplicationSet role binding") + if err := r.reconcileApplicationSetRoleBinding(cr, role, sa); err != nil { + return err + } + + log.Info("reconciling ApplicationSet role") + _, err := r.reconcileApplicationSetRole(cr) + if err != nil { + return err + } + + log.Info("reconciling ApplicationSet serviceaccount") + _, err = r.reconcileApplicationSetServiceAccount(cr) + if err != nil { + return err + } + + return nil +} + // reconcileApplicationSetService will ensure that the Service is present for the ApplicationSet webhook and metrics component. func (r *ReconcileArgoCD) reconcileApplicationSetService(cr *argoprojv1a1.ArgoCD) error { log.Info("reconciling applicationset service") svc := newServiceWithSuffix(common.ApplicationSetServiceNameSuffix, common.ApplicationSetServiceNameSuffix, cr) if cr.Spec.ApplicationSet == nil { - if argoutil.IsObjectFound(r.Client, cr.Namespace, svc.Name, svc) { err := argoutil.FetchObject(r.Client, cr.Namespace, svc.Name, svc) if err != nil { diff --git a/controllers/argocd/applicationset_test.go b/controllers/argocd/applicationset_test.go index b99bba014..4ecc29ab6 100644 --- a/controllers/argocd/applicationset_test.go +++ b/controllers/argocd/applicationset_test.go @@ -24,6 +24,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -262,7 +263,6 @@ func TestReconcileApplicationSet_UpdateExistingDeployments(t *testing.T) { // Ensure the updated Deployment has the expected properties checkExpectedDeploymentValues(t, deployment, &sa, a) - } func TestReconcileApplicationSet_Deployments_resourceRequirements(t *testing.T) { @@ -405,8 +405,8 @@ func TestReconcileApplicationSet_ServiceAccount(t *testing.T) { func TestReconcileApplicationSet_Role(t *testing.T) { logf.SetLogger(ZapLogger(true)) a := makeTestArgoCD() + a.Spec.ApplicationSet = &v1alpha1.ArgoCDApplicationSet{} r := makeTestReconciler(t, a) - roleRet, err := r.reconcileApplicationSetRole(a) assert.NoError(t, err) @@ -451,6 +451,7 @@ func TestReconcileApplicationSet_Role(t *testing.T) { func TestReconcileApplicationSet_RoleBinding(t *testing.T) { logf.SetLogger(ZapLogger(true)) a := makeTestArgoCD() + a.Spec.ApplicationSet = &v1alpha1.ArgoCDApplicationSet{} r := makeTestReconciler(t, a) role := &rbacv1.Role{ObjectMeta: metav1.ObjectMeta{Name: "role-name"}} @@ -472,7 +473,6 @@ func TestReconcileApplicationSet_RoleBinding(t *testing.T) { assert.Equal(t, roleBinding.RoleRef.Name, role.Name) assert.Equal(t, roleBinding.Subjects[0].Name, sa.Name) - } func appsetAssertExpectedLabels(t *testing.T, meta *metav1.ObjectMeta) { @@ -487,6 +487,65 @@ func setProxyEnvVars(t *testing.T) { t.Setenv("NO_PROXY", ".cluster.local") } +func TestReconcileApplicationSet_DeleteDeployment(t *testing.T) { + logf.SetLogger(ZapLogger(true)) + a := makeTestArgoCD() + a.Spec.ApplicationSet = &v1alpha1.ArgoCDApplicationSet{} + r := makeTestReconciler(t, a) + sa := corev1.ServiceAccount{} + + assert.NoError(t, r.reconcileApplicationSetDeployment(a, &sa)) + + deployment := &appsv1.Deployment{} + assert.NoError(t, r.Client.Get( + context.TODO(), + types.NamespacedName{ + Name: "argocd-applicationset-controller", + Namespace: a.Namespace, + }, + deployment)) + + a.Spec.ApplicationSet = nil + r = makeTestReconciler(t, a) + checkdeployment := &appsv1.Deployment{} + assert.Error(t, r.Client.Get( + context.TODO(), + types.NamespacedName{ + Name: "argocd-applicationset-controller", + Namespace: a.Namespace, + }, + checkdeployment)) + assert.Equal(t, checkdeployment.Name, "") + checkrole := &v1.Role{} + assert.Error(t, r.Client.Get( + context.TODO(), + types.NamespacedName{ + Name: "argocd-applicationset-controller", + Namespace: a.Namespace, + }, + checkrole)) + assert.Equal(t, checkrole.Name, "") + + checksa := &corev1.ServiceAccount{} + assert.Error(t, r.Client.Get( + context.TODO(), + types.NamespacedName{ + Name: "argocd-applicationset-controller", + Namespace: a.Namespace, + }, + checksa)) + assert.Equal(t, checksa.Name, "") + checkroleBinding := &v1.RoleBinding{} + assert.Error(t, r.Client.Get( + context.TODO(), + types.NamespacedName{ + Name: "argocd-applicationset-controller", + Namespace: a.Namespace, + }, + checkroleBinding)) + assert.Equal(t, checkroleBinding.Name, "") +} + func TestReconcileApplicationSet_Service(t *testing.T) { logf.SetLogger(ZapLogger(true)) a := makeTestArgoCD() diff --git a/controllers/argocd/status.go b/controllers/argocd/status.go index 7d02d879c..6b7136eec 100644 --- a/controllers/argocd/status.go +++ b/controllers/argocd/status.go @@ -32,6 +32,10 @@ func (r *ReconcileArgoCD) reconcileStatus(cr *argoprojv1a1.ArgoCD) error { return err } + if err := r.reconcileStatusApplicationSetController(cr); err != nil { + return err + } + if err := r.reconcileStatusSSOConfig(cr); err != nil { return err } @@ -312,3 +316,24 @@ func (r *ReconcileArgoCD) reconcileStatusHost(cr *argoprojv1a1.ArgoCD) error { } return r.Client.Status().Update(context.TODO(), cr) } + +// reconcileStatusApplicationController will ensure that the ApplicationController Status is updated for the given ArgoCD. +func (r *ReconcileArgoCD) reconcileStatusApplicationSetController(cr *argoprojv1a1.ArgoCD) error { + status := "Unknown" + deploy := newDeploymentWithSuffix("applicationset-controller", "controller", cr) + if argoutil.IsObjectFound(r.Client, cr.Namespace, deploy.Name, deploy) { + status = "Pending" + + if deploy.Spec.Replicas != nil { + if deploy.Status.ReadyReplicas == *deploy.Spec.Replicas { + status = "Running" + } + } + } + + if cr.Status.ApplicationSetController != status { + cr.Status.ApplicationSetController = status + return r.Client.Status().Update(context.TODO(), cr) + } + return nil +} diff --git a/controllers/argocd/status_test.go b/controllers/argocd/status_test.go index 9512a57ad..4011fc9cf 100644 --- a/controllers/argocd/status_test.go +++ b/controllers/argocd/status_test.go @@ -231,3 +231,22 @@ func TestReconcileArgoCD_reconcileStatusNotificationsController(t *testing.T) { assert.NoError(t, r.reconcileStatusNotifications(a)) assert.Equal(t, "", a.Status.NotificationsController) } + +func TestReconcileArgoCD_reconcileStatusApplicationSetController(t *testing.T) { + logf.SetLogger(ZapLogger(true)) + a := makeTestArgoCD() + r := makeTestReconciler(t, a) + + assert.NoError(t, r.reconcileStatusApplicationSetController(a)) + assert.Equal(t, "Unknown", a.Status.ApplicationSetController) + + a.Spec.ApplicationSet = &v1alpha1.ArgoCDApplicationSet{} + assert.NoError(t, r.reconcileApplicationSetController(a)) + assert.NoError(t, r.reconcileStatusApplicationSetController(a)) + assert.Equal(t, "Pending", a.Status.ApplicationSetController) + + a.Spec.ApplicationSet = nil + assert.NoError(t, r.deleteApplicationSetResources(a)) + assert.NoError(t, r.reconcileStatusApplicationSetController(a)) + assert.Equal(t, "Unknown", a.Status.ApplicationSetController) +} diff --git a/controllers/argocd/util.go b/controllers/argocd/util.go index b49a434e3..5e20bf432 100644 --- a/controllers/argocd/util.go +++ b/controllers/argocd/util.go @@ -1025,8 +1025,31 @@ func (r *ReconcileArgoCD) setResourceWatches(bldr *builder.Builder, clusterResou }, } + // Add new predicate to delete Notifications Resources. The predicate watches the Argo CD CR for changes to the `.spec.Notifications.Enabled` + // field. When a change is detected that results in notifications being disabled, we trigger deletion of notifications resources + deleteAppSetPred := predicate.Funcs{ + UpdateFunc: func(e event.UpdateEvent) bool { + newCR, ok := e.ObjectNew.(*argoprojv1a1.ArgoCD) + if !ok { + return false + } + oldCR, ok := e.ObjectOld.(*argoprojv1a1.ArgoCD) + if !ok { + return false + } + if !reflect.DeepEqual(oldCR.Spec.ApplicationSet, newCR.Spec.ApplicationSet) && newCR.Spec.ApplicationSet == nil { + err := r.deleteApplicationSetResources(newCR) + if err != nil { + log.Error(err, fmt.Sprintf("Failed to delete application set resources for ArgoCD %s in namespace %s", + newCR.Name, newCR.Namespace)) + } + } + return true + }, + } + // Watch for changes to primary resource ArgoCD - bldr.For(&argoprojv1a1.ArgoCD{}, builder.WithPredicates(deleteSSOPred, deleteNotificationsPred)) + bldr.For(&argoprojv1a1.ArgoCD{}, builder.WithPredicates(deleteSSOPred, deleteNotificationsPred, deleteAppSetPred)) // Watch for changes to ConfigMap sub-resources owned by ArgoCD instances. bldr.Owns(&corev1.ConfigMap{}) diff --git a/deploy/olm-catalog/argocd-operator/0.4.0/argocd-operator.v0.4.0.clusterserviceversion.yaml b/deploy/olm-catalog/argocd-operator/0.4.0/argocd-operator.v0.4.0.clusterserviceversion.yaml index 92f0ab6be..d3e59ea82 100644 --- a/deploy/olm-catalog/argocd-operator/0.4.0/argocd-operator.v0.4.0.clusterserviceversion.yaml +++ b/deploy/olm-catalog/argocd-operator/0.4.0/argocd-operator.v0.4.0.clusterserviceversion.yaml @@ -747,6 +747,19 @@ spec: path: applicationController x-descriptors: - urn:alm:descriptor:com.tectonic.ui:text + - description: 'ApplicationController is a simple, high-level summary of where + the Argo CD application controller component is in its lifecycle. There + are five possible ApplicationController values: Pending: The Argo CD application + controller component has been accepted by the Kubernetes system, but one + or more of the required resources have not been created. Running: All of + the required Pods for the Argo CD application controller component are in + a Ready state. Failed: At least one of the Argo CD application controller + component Pods had a failure. Unknown: For some reason the state of the + Argo CD application controller component could not be obtained.' + displayName: ApplicationController + path: applicationSetController + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text - description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex values: Pending: The Argo CD Dex component has been accepted by the Kubernetes system, but diff --git a/deploy/olm-catalog/argocd-operator/0.4.0/argoproj.io_argocds.yaml b/deploy/olm-catalog/argocd-operator/0.4.0/argoproj.io_argocds.yaml index d869c2ec8..4dc79df6b 100644 --- a/deploy/olm-catalog/argocd-operator/0.4.0/argoproj.io_argocds.yaml +++ b/deploy/olm-catalog/argocd-operator/0.4.0/argoproj.io_argocds.yaml @@ -5995,6 +5995,18 @@ spec: had a failure. Unknown: For some reason the state of the Argo CD application controller component could not be obtained.' type: string + applicationSetController: + description: 'ApplicationController is a simple, high-level summary + of where the Argo CD application controller component is in its + lifecycle. There are five possible ApplicationController values: + Pending: The Argo CD application controller component has been accepted + by the Kubernetes system, but one or more of the required resources + have not been created. Running: All of the required Pods for the + Argo CD application controller component are in a Ready state. Failed: + At least one of the Argo CD application controller component Pods + had a failure. Unknown: For some reason the state of the Argo CD + application controller component could not be obtained.' + type: string dex: description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex diff --git a/deploy/olm-catalog/argocd-operator/0.5.0/argocd-operator.v0.5.0.clusterserviceversion.yaml b/deploy/olm-catalog/argocd-operator/0.5.0/argocd-operator.v0.5.0.clusterserviceversion.yaml index 59fb1b2a1..35361c0cb 100644 --- a/deploy/olm-catalog/argocd-operator/0.5.0/argocd-operator.v0.5.0.clusterserviceversion.yaml +++ b/deploy/olm-catalog/argocd-operator/0.5.0/argocd-operator.v0.5.0.clusterserviceversion.yaml @@ -747,6 +747,19 @@ spec: path: applicationController x-descriptors: - urn:alm:descriptor:com.tectonic.ui:text + - description: 'ApplicationSetController is a simple, high-level summary of + where the Argo CD applicationset controller component is in its lifecycle. + There are five possible ApplicationSetController values: Pending: The Argo + CD applicationset controller component has been accepted by the Kubernetes + system, but one or more of the required resources have not been created. + Running: All of the required Pods for the Argo CD applicationset controller + component are in a Ready state. Failed: At least one of the Argo CD applicationset + controller component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be obtained.' + displayName: ApplicationSetController + path: applicationSetController + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text - description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex values: Pending: The Argo CD Dex component has been accepted by the Kubernetes system, but diff --git a/deploy/olm-catalog/argocd-operator/0.5.0/argoproj.io_argocds.yaml b/deploy/olm-catalog/argocd-operator/0.5.0/argoproj.io_argocds.yaml index ff9379d6b..0a635d6e5 100644 --- a/deploy/olm-catalog/argocd-operator/0.5.0/argoproj.io_argocds.yaml +++ b/deploy/olm-catalog/argocd-operator/0.5.0/argoproj.io_argocds.yaml @@ -5998,6 +5998,19 @@ spec: had a failure. Unknown: For some reason the state of the Argo CD application controller component could not be obtained.' type: string + applicationSetController: + description: 'ApplicationSetController is a simple, high-level summary + of where the Argo CD applicationset controller component is in its + lifecycle. There are five possible ApplicationSetController values: + Pending: The Argo CD applicationset controller component has been + accepted by the Kubernetes system, but one or more of the required + resources have not been created. Running: All of the required Pods + for the Argo CD applicationset controller component are in a Ready + state. Failed: At least one of the Argo CD applicationset controller + component Pods had a failure. Unknown: For some reason the state + of the Argo CD applicationset controller component could not be + obtained.' + type: string dex: description: 'Dex is a simple, high-level summary of where the Argo CD Dex component is in its lifecycle. There are five possible dex diff --git a/tests/k8s/1-001_validate_basic/07-errors.yaml b/tests/k8s/1-001_validate_basic/07-errors.yaml new file mode 100644 index 000000000..208f1abff --- /dev/null +++ b/tests/k8s/1-001_validate_basic/07-errors.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: example-argocd-applicationset-controller +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: example-argocd-applicationset-controller +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: example-argocd-applicationset-controller +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: example-argocd-applicationset-controller +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: example-argocd-applicationset-controller \ No newline at end of file diff --git a/tests/k8s/1-001_validate_basic/07-remove-applicationset.yaml b/tests/k8s/1-001_validate_basic/07-remove-applicationset.yaml new file mode 100644 index 000000000..90e94c724 --- /dev/null +++ b/tests/k8s/1-001_validate_basic/07-remove-applicationset.yaml @@ -0,0 +1,7 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: +# patches to disable applicationset +- script: | + kubectl patch -n $NAMESPACE argocd/example-argocd --type='json' -p='[{"op": "remove", "path": "/spec/applicationSet"}]' +- script: sleep 10 \ No newline at end of file