diff --git a/USERS.md b/USERS.md index f69f8ae071e7b..afde781f8c38c 100644 --- a/USERS.md +++ b/USERS.md @@ -113,6 +113,7 @@ Currently, the following organizations are **officially** using Argo CD: 1. [Optoro](https://www.optoro.com/) 1. [Orbital Insight](https://orbitalinsight.com/) 1. [Packlink](https://www.packlink.com/) +1. [PagerDuty](https://www.pagerduty.com/) 1. [PayPay](https://paypay.ne.jp/) 1. [Peloton Interactive](https://www.onepeloton.com/) 1. [Pipefy](https://www.pipefy.com/) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index c1d4c98bd4ca9..dcb6dfeb8895b 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -1951,8 +1951,10 @@ func printOperationResult(opState *argoappv1.OperationState) { // NewApplicationManifestsCommand returns a new instance of an `argocd app manifests` command func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var ( - source string - revision string + source string + revision string + local string + localRepoRoot string ) var command = &cobra.Command{ Use: "manifests APPNAME", @@ -1963,7 +1965,8 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob os.Exit(1) } appName := args[0] - conn, appIf := headless.NewClientOrDie(clientOpts, c).NewApplicationClientOrDie() + clientset := headless.NewClientOrDie(clientOpts, c) + conn, appIf := clientset.NewApplicationClientOrDie() defer argoio.Close(conn) ctx := context.Background() resources, err := appIf.ManagedResources(context.Background(), &applicationpkg.ResourcesQuery{ApplicationName: &appName}) @@ -1972,7 +1975,22 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob var unstructureds []*unstructured.Unstructured switch source { case "git": - if revision != "" { + if local != "" { + app, err := appIf.Get(context.Background(), &applicationpkg.ApplicationQuery{Name: &appName}) + errors.CheckError(err) + + settingsConn, settingsIf := clientset.NewSettingsClientOrDie() + defer argoio.Close(settingsConn) + argoSettings, err := settingsIf.Get(context.Background(), &settingspkg.SettingsQuery{}) + errors.CheckError(err) + + clusterConn, clusterIf := clientset.NewClusterClientOrDie() + defer argoio.Close(clusterConn) + cluster, err := clusterIf.Get(context.Background(), &clusterpkg.ClusterQuery{Name: app.Spec.Destination.Name, Server: app.Spec.Destination.Server}) + errors.CheckError(err) + + unstructureds = getLocalObjects(app, local, localRepoRoot, argoSettings.AppLabelKey, cluster.ServerVersion, cluster.Info.APIVersions, argoSettings.KustomizeOptions, argoSettings.ConfigManagementPlugins, argoSettings.TrackingMethod) + } else if revision != "" { q := applicationpkg.ApplicationManifestQuery{ Name: &appName, Revision: revision, @@ -2007,6 +2025,8 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob } command.Flags().StringVar(&source, "source", "git", "Source of manifests. One of: live|git") command.Flags().StringVar(&revision, "revision", "", "Show manifests at a specific revision") + command.Flags().StringVar(&local, "local", "", "Show local manifests") + command.Flags().StringVar(&localRepoRoot, "local-repo-root", "/", "Path to the repository root. Used together with --local allows setting the repository root") return command } diff --git a/docs/user-guide/commands/argocd_app_manifests.md b/docs/user-guide/commands/argocd_app_manifests.md index c369bbd0781b5..1c0ec17f2be71 100644 --- a/docs/user-guide/commands/argocd_app_manifests.md +++ b/docs/user-guide/commands/argocd_app_manifests.md @@ -9,9 +9,11 @@ argocd app manifests APPNAME [flags] ### Options ``` - -h, --help help for manifests - --revision string Show manifests at a specific revision - --source string Source of manifests. One of: live|git (default "git") + -h, --help help for manifests + --local string Show local manifests + --local-repo-root string Path to the repository root. Used together with --local allows setting the repository root (default "/") + --revision string Show manifests at a specific revision + --source string Source of manifests. One of: live|git (default "git") ``` ### Options inherited from parent commands