func (r *ReconcileArgoCD) reconcileClusterMainSecret(cr *argoprojv1a1.ArgoCD) error {
	secret := argoutil.NewSecretWithSuffix(cr.ObjectMeta, "cluster")
	if argoutil.IsObjectFound(r.client, cr.Namespace, secret.Name, secret) {
		return nil // Secret found, do nothing
	}

	adminPassword, err := generateArgoAdminPassword()
	if err != nil {
		return err
	}

	secret.Data = map[string][]byte{
		common.ArgoCDKeyAdminPassword: adminPassword,
	}

	if err := controllerutil.SetControllerReference(cr, secret, r.scheme); err != nil {
		return err
	}
	return r.client.Create(context.TODO(), secret)
}
// reconcileClusterMainSecret will ensure that the main Secret is present for the Argo CD cluster.
reconcileClusterMainSecret will ensure that the main Secret is present for the Argo CD cluster.
// reconcileClusterMainSecret will ensure that the main Secret is present for the Argo CD cluster .
func (r *ReconcileArgoCD) reconcileClusterMainSecret(cr *argoprojv1a1.ArgoCD) error {
	secret := argoutil.NewSecretWithSuffix(cr.ObjectMeta, "cluster")
	if argoutil.IsObjectFound(r.client, cr.Namespace, secret.Name, secret) {
		return nil 
	}
	adminPassword, err := generateArgoAdminPassword()
	if err != nil {
		return err
	}
	secret.Data = map[string][]byte{
		common.ArgoCDKeyAdminPassword: adminPassword,
	}
	if err := controllerutil.SetControllerReference(cr, secret, r.scheme); err != nil {
		return err
	}
	return r.client.Create(context.TODO(), secret)
}
func ( r * ReconcileArgoCD ) reconcileClusterMainSecret ( cr * argoprojv1a1 . ArgoCD ) error { secret := argoutil . NewSecretWithSuffix ( cr . ObjectMeta , " " ) if argoutil . IsObjectFound ( r . client , cr . Namespace , secret . Name , secret ) { return nil } adminPassword , err := generateArgoAdminPassword ( ) if err != nil { return err } secret . Data = map [ string ] [ ] byte { common . ArgoCDKeyAdminPassword : adminPassword , } if err := controllerutil . SetControllerReference ( cr , secret , r . scheme ) ; err != nil { return err } return r . client . Create ( context . TODO ( ) , secret ) }
reconcileClusterMainSecret will ensure that the main Secret is present for the Argo CD cluster.
reconcileClusterMainSecret will ensure that the main Secret is present for the Argo CD cluster .
// Secret found, do nothing