diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index c4626081b7d00..2fcc720ddf3dc 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -3327,6 +3327,14 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob log.Fatalf("Unknown source type '%s'", source) } + // If no resources are found, there are two possible reasons + // either the application doesn't have manifests associated with it + // OR the redis cache is empty. Hence it is better to return early + if len(unstructureds) == 0 { + log.Infof("no Kubernetes resources found for application %q:"+ + " manifests may not exist or the Redis cache is empty", appName) + return + } for _, obj := range unstructureds { fmt.Println("---") yamlBytes, err := yaml.Marshal(obj)