diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 12c5153761ce8..414ff9d3f3291 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -1836,21 +1836,21 @@ func printAppResources(w io.Writer, app *argoappv1.Application, discoveryClient func mergeDuplicateClusterLevelResources(resourceStates []*versionedResourceState, discoveryClient discovery.DiscoveryInterface) []*versionedResourceState { resourcesByKey := make(map[kube.ResourceKey]*versionedResourceState) + // GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE + // argoproj.io Fake argocd-e2e--test-app-sync-wrong-version-xunes fake-crd-instance OutOfSync Missing The Kubernetes API could not find version "v1alpha2" of argoproj.io/Fake for requested resource argocd-e2e--test-app-sync-wrong-version-xunes/fake-crd-instance. Version "v1alpha1" of argoproj.io/Fake is installed on the destination cluster. + for _, resource := range resourceStates { groupVersion := "" if resource.Group != "" { groupVersion += (resource.Group + "/") } groupVersion += resource.Version - apiResourceList, err := discoveryClient.ServerResourcesForGroupVersion(groupVersion) - if err != nil { - errors.CheckError(fmt.Errorf("unable to retrieve server resources for group and version combination %s: %w", groupVersion, err)) - } - - for _, apiResource := range apiResourceList.APIResources { - if resource.Group == apiResource.Group && resource.Version == apiResource.Version && resource.Kind == apiResource.Kind { - if !apiResource.Namespaced { - resource.Namespace = "" + if apiResourceList, err := discoveryClient.ServerResourcesForGroupVersion(groupVersion); err == nil { + for _, apiResource := range apiResourceList.APIResources { + if resource.Group == apiResource.Group && resource.Version == apiResource.Version && resource.Kind == apiResource.Kind { + if !apiResource.Namespaced { + resource.Namespace = "" + } } } }