From 3461816d242481c85e2b760b2cda1666ddc1bfee Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sat, 7 Oct 2023 14:21:18 +0530 Subject: [PATCH 01/14] feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 27 +++++++++++++++++++ docs/user-guide/commands/argocd_app_get.md | 30 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 921e976135a79..09715211d37eb 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -50,6 +50,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/grpc" argoio "github.com/argoproj/argo-cd/v2/util/io" "github.com/argoproj/argo-cd/v2/util/manifeststream" + "github.com/argoproj/argo-cd/v2/util/templates" "github.com/argoproj/argo-cd/v2/util/text/label" ) @@ -317,6 +318,32 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com var command = &cobra.Command{ Use: "get APPNAME", Short: "Get application details", + Example: templates.Examples(` + # Get basic details about the application "my-app" in wide format + argocd app get my-app + + # Get detailed information about the application "my-app" in YAML format + argocd app get my-app -o yaml + + # Get application details and include information about the current operation + argocd app get my-app --show-operation + + # Show application parameters and overrides + argocd app get my-app --show-params + + # Refresh application data when retrieving + argocd app get my-app --refresh + + # Perform a hard refresh, including refreshing application data and target manifests cache + argocd app get my-app --hard-refresh + + # Get application details and display them in a tree format + argocd app get my-app --output tree + + # Get application details and display them in a detailed tree format + argocd app get my-app --output tree=detailed + `), + Run: func(c *cobra.Command, args []string) { ctx := c.Context() if len(args) == 0 { diff --git a/docs/user-guide/commands/argocd_app_get.md b/docs/user-guide/commands/argocd_app_get.md index 33787d8083f22..5dc168fd57754 100644 --- a/docs/user-guide/commands/argocd_app_get.md +++ b/docs/user-guide/commands/argocd_app_get.md @@ -8,6 +8,36 @@ Get application details argocd app get APPNAME [flags] ``` +### Examples + +``` + + # Get basic details about the application "my-app" in wide format + argocd app get my-app + + # Get detailed information about the application "my-app" in YAML format + argocd app get my-app -o yaml + + # Get application details and include information about the current operation + argocd app get my-app --show-operation + + # Show application parameters and overrides + argocd app get my-app --show-params + + # Refresh application data when retrieving + argocd app get my-app --refresh + + # Perform a hard refresh, including refreshing application data and target manifests cache + argocd app get my-app --hard-refresh + + # Get application details and display them in a tree format + argocd app get my-app --output tree + + # Get application details and display them in a detailed tree format + argocd app get my-app --output tree=detailed`, + +``` + ### Options ``` From 6c0a89df86ca29ba4b1ee3f7a6690c28168eb91e Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sat, 7 Oct 2023 14:25:36 +0530 Subject: [PATCH 02/14] feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 09715211d37eb..406f46a0c5afa 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -319,30 +319,30 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com Use: "get APPNAME", Short: "Get application details", Example: templates.Examples(` - # Get basic details about the application "my-app" in wide format - argocd app get my-app + # Get basic details about the application "my-app" in wide format + argocd app get my-app - # Get detailed information about the application "my-app" in YAML format - argocd app get my-app -o yaml + # Get detailed information about the application "my-app" in YAML format + argocd app get my-app -o yaml - # Get application details and include information about the current operation - argocd app get my-app --show-operation + # Get application details and include information about the current operation + argocd app get my-app --show-operation - # Show application parameters and overrides - argocd app get my-app --show-params + # Show application parameters and overrides + argocd app get my-app --show-params - # Refresh application data when retrieving - argocd app get my-app --refresh + # Refresh application data when retrieving + argocd app get my-app --refresh - # Perform a hard refresh, including refreshing application data and target manifests cache - argocd app get my-app --hard-refresh + # Perform a hard refresh, including refreshing application data and target manifests cache + argocd app get my-app --hard-refresh - # Get application details and display them in a tree format - argocd app get my-app --output tree + # Get application details and display them in a tree format + argocd app get my-app --output tree - # Get application details and display them in a detailed tree format - argocd app get my-app --output tree=detailed - `), + # Get application details and display them in a detailed tree format + argocd app get my-app --output tree=detailed + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From 825a41ff7b648cbacf821a3d0dfa7a135f25beab Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sat, 7 Oct 2023 14:25:57 +0530 Subject: [PATCH 03/14] Update app.go Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 406f46a0c5afa..b66a20325fb81 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -319,7 +319,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com Use: "get APPNAME", Short: "Get application details", Example: templates.Examples(` - # Get basic details about the application "my-app" in wide format + # Get basic details about the application "my-app" in wide format argocd app get my-app # Get detailed information about the application "my-app" in YAML format @@ -342,7 +342,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - `), + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From 07647514e058b49c1724746a71eac308030f3266 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sat, 7 Oct 2023 14:30:09 +0530 Subject: [PATCH 04/14] Update argocd_app_get.md Signed-off-by: Ratan Gulati --- docs/user-guide/commands/argocd_app_get.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/user-guide/commands/argocd_app_get.md b/docs/user-guide/commands/argocd_app_get.md index 5dc168fd57754..30ac9a8725353 100644 --- a/docs/user-guide/commands/argocd_app_get.md +++ b/docs/user-guide/commands/argocd_app_get.md @@ -11,31 +11,29 @@ argocd app get APPNAME [flags] ### Examples ``` - # Get basic details about the application "my-app" in wide format argocd app get my-app - + # Get detailed information about the application "my-app" in YAML format argocd app get my-app -o yaml - + # Get application details and include information about the current operation argocd app get my-app --show-operation - + # Show application parameters and overrides argocd app get my-app --show-params - + # Refresh application data when retrieving argocd app get my-app --refresh - + # Perform a hard refresh, including refreshing application data and target manifests cache argocd app get my-app --hard-refresh - + # Get application details and display them in a tree format argocd app get my-app --output tree # Get application details and display them in a detailed tree format - argocd app get my-app --output tree=detailed`, - + argocd app get my-app --output tree=detailed ``` ### Options From 268f73f617616f8da0b792b59b6f16d22c7bee5b Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 12:22:30 +0530 Subject: [PATCH 05/14] Update argocd_app_get.md Signed-off-by: Ratan Gulati --- docs/user-guide/commands/argocd_app_get.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user-guide/commands/argocd_app_get.md b/docs/user-guide/commands/argocd_app_get.md index 30ac9a8725353..6022ec1166004 100644 --- a/docs/user-guide/commands/argocd_app_get.md +++ b/docs/user-guide/commands/argocd_app_get.md @@ -34,6 +34,7 @@ argocd app get APPNAME [flags] # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed + ``` ### Options From 791b3017e7f8637f190556a761fac18add5fb0f4 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 12:24:45 +0530 Subject: [PATCH 06/14] updated app.go Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index b66a20325fb81..b6af21cd66f1f 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -50,7 +50,6 @@ import ( "github.com/argoproj/argo-cd/v2/util/grpc" argoio "github.com/argoproj/argo-cd/v2/util/io" "github.com/argoproj/argo-cd/v2/util/manifeststream" - "github.com/argoproj/argo-cd/v2/util/templates" "github.com/argoproj/argo-cd/v2/util/text/label" ) @@ -318,7 +317,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com var command = &cobra.Command{ Use: "get APPNAME", Short: "Get application details", - Example: templates.Examples(` + Example: ` # Get basic details about the application "my-app" in wide format argocd app get my-app @@ -342,7 +341,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - `), + `, Run: func(c *cobra.Command, args []string) { ctx := c.Context() From 87d5fe6423eca9674bf68153e05920a6bbdf5d0f Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 12:58:39 +0530 Subject: [PATCH 07/14] Update app.go Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index b6af21cd66f1f..784441ea8b7b9 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -50,6 +50,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/grpc" argoio "github.com/argoproj/argo-cd/v2/util/io" "github.com/argoproj/argo-cd/v2/util/manifeststream" + "github.com/argoproj/argo-cd/v2/util/templates" "github.com/argoproj/argo-cd/v2/util/text/label" ) @@ -317,7 +318,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com var command = &cobra.Command{ Use: "get APPNAME", Short: "Get application details", - Example: ` + Example: templates.Examples(` # Get basic details about the application "my-app" in wide format argocd app get my-app @@ -341,7 +342,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - `, + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From d1d7a2a2b21cfc26c8dca1847ace5669fe1c5021 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 13:30:18 +0530 Subject: [PATCH 08/14] Update argocd_app_get.md Signed-off-by: Ratan Gulati --- docs/user-guide/commands/argocd_app_get.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/user-guide/commands/argocd_app_get.md b/docs/user-guide/commands/argocd_app_get.md index 6022ec1166004..30ac9a8725353 100644 --- a/docs/user-guide/commands/argocd_app_get.md +++ b/docs/user-guide/commands/argocd_app_get.md @@ -34,7 +34,6 @@ argocd app get APPNAME [flags] # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - ``` ### Options From a203336b97d705007df1e2eadd4f05267bcc3cf3 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 13:30:20 +0530 Subject: [PATCH 09/14] Update app.go Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 784441ea8b7b9..b66a20325fb81 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -342,7 +342,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - `), + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From ceab89b5642498a1a32b634a33b6a53b71172e2d Mon Sep 17 00:00:00 2001 From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Date: Sun, 8 Oct 2023 10:39:37 -0400 Subject: [PATCH 10/14] docs: clarify health inheritance (#15799) * docs: resource health inheritance Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * write more better Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: Ratan Gulati --- docs/operator-manual/health.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/operator-manual/health.md b/docs/operator-manual/health.md index ad37e06437e17..5cc80de6538c5 100644 --- a/docs/operator-manual/health.md +++ b/docs/operator-manual/health.md @@ -173,3 +173,36 @@ To test the implemented custom health checks, run `go test -v ./util/lua/`. The [PR#1139](https://github.com/argoproj/argo-cd/pull/1139) is an example of Cert Manager CRDs custom health check. Please note that bundled health checks with wildcards are not supported. + +## Health Checks + +An Argo CD App's health is inferred from the health of its immediate child resources (the resources represented in +source control). + +But the health of a resource is not inherited from child resources - it is calculated using only information about the +resource itself. A resource's status field may or may not contain information about the health of a child resource, and +the resource's health check may or may not take that information into account. + +The lack of inheritance is by design. A resource's health can't be inferred from its children because the health of a +child resource may not be relevant to the health of the parent resource. For example, a Deployment's health is not +necessarily affected by the health of its Pods. + +``` +App (healthy) +└── Deployment (healthy) + └── ReplicaSet (healthy) + └── Pod (healthy) + └── ReplicaSet (unhealthy) + └── Pod (unhealthy) +``` + +If you want the health of a child resource to affect the health of its parent, you need to configure the parent's health +check to take the child's health into account. Since only the parent resource's state is available to the health check, +the parent resource's controller needs to make the child resource's health available in the parent resource's status +field. + +``` +App (healthy) +└── CustomResource (healthy) <- This resource's health check needs to be fixed to mark the App as unhealthy + └── CustomChildResource (unhealthy) +``` From 551c77bce58a3bd19156fb36b3e8befdae665f92 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 23:15:18 +0530 Subject: [PATCH 11/14] updated file Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index b66a20325fb81..a9797f7567812 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -342,7 +342,8 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - `), + + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From f198abcd03c198178806640bbe248b6e9ad7e7e9 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Sun, 8 Oct 2023 23:15:50 +0530 Subject: [PATCH 12/14] Update app.go Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index a9797f7567812..b66a20325fb81 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -342,8 +342,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get application details and display them in a detailed tree format argocd app get my-app --output tree=detailed - - `), + `), Run: func(c *cobra.Command, args []string) { ctx := c.Context() From 48ef49c624765f82279c224fe52b504cbad0d4ef Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Wed, 11 Oct 2023 12:16:14 +0530 Subject: [PATCH 13/14] updated get-APPNAME Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index b66a20325fb81..2f0b896d5e314 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -325,6 +325,9 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com # Get detailed information about the application "my-app" in YAML format argocd app get my-app -o yaml + # Get details of the application "my-app" in JSON format + argocd get my-app -o json + # Get application details and include information about the current operation argocd app get my-app --show-operation From ace3aecbf6cbaf12a673b050ad4f4cb23faa615c Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Wed, 11 Oct 2023 12:18:02 +0530 Subject: [PATCH 14/14] updated get-APPNAME Signed-off-by: Ratan Gulati --- cmd/argocd/commands/app.go | 2 +- docs/user-guide/commands/argocd_app_get.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 2f0b896d5e314..88b7262c19631 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -320,7 +320,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com Short: "Get application details", Example: templates.Examples(` # Get basic details about the application "my-app" in wide format - argocd app get my-app + argocd app get my-app -o wide # Get detailed information about the application "my-app" in YAML format argocd app get my-app -o yaml diff --git a/docs/user-guide/commands/argocd_app_get.md b/docs/user-guide/commands/argocd_app_get.md index 30ac9a8725353..cf766ed9eb0d7 100644 --- a/docs/user-guide/commands/argocd_app_get.md +++ b/docs/user-guide/commands/argocd_app_get.md @@ -12,11 +12,14 @@ argocd app get APPNAME [flags] ``` # Get basic details about the application "my-app" in wide format - argocd app get my-app + argocd app get my-app -o wide # Get detailed information about the application "my-app" in YAML format argocd app get my-app -o yaml + # Get details of the application "my-app" in JSON format + argocd get my-app -o json + # Get application details and include information about the current operation argocd app get my-app --show-operation