Skip to content

Commit

Permalink
Merge pull request #165 from projectsyn/fix/argocd-listing-no-crd
Browse files Browse the repository at this point in the history
Fix listing of ArgoCD custom resource when CRD isn't installed
  • Loading branch information
simu authored Feb 17, 2025
2 parents 2e1d3d5 + 5b89240 commit 9b76901
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/argocd/argocd.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ func Apply(ctx context.Context, config *rest.Config, namespace, operatorNamespac
Resource: "argocds",
}

argos, err := dynamicClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{})

if err != nil && !errors.IsNotFound(err) {
if err = applyAdditionalRootApps(ctx, clientset, config, namespace, additionalRootAppsConfigMapName, cluster); err != nil {
return err
}

if err = applyAdditionalRootApps(ctx, clientset, config, namespace, additionalRootAppsConfigMapName, cluster); err != nil {
argos, err := dynamicClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{})

if err != nil && !errors.IsNotFound(err) {
return err
}

if err == nil && len(argos.Items) > 0 {
// An ArgoCD custom resource exists in our namespace
err = fixArgoOperatorDeadlock(ctx, clientset, config, namespace, operatorNamespace)
Expand Down

0 comments on commit 9b76901

Please sign in to comment.