Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
478 changes: 478 additions & 0 deletions assets/swagger.json

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,8 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
appNamespace string
cluster string
path string
limit int64
offset int64
)
command := &cobra.Command{
Use: "list",
Expand All @@ -1807,16 +1809,30 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
argocd app list -l app.kubernetes.io/instance!=my-app
argocd app list -l app.kubernetes.io/instance
argocd app list -l '!app.kubernetes.io/instance'
argocd app list -l 'app.kubernetes.io/instance notin (my-app,other-app)'`,
argocd app list -l 'app.kubernetes.io/instance notin (my-app,other-app)
# List apps with pagination
argocd app list --limit 50 --offset 100'`,
Run: func(c *cobra.Command, _ []string) {
ctx := c.Context()

conn, appIf := headless.NewClientOrDie(clientOpts, c).NewApplicationClientOrDie()
defer utilio.Close(conn)
apps, err := appIf.List(ctx, &application.ApplicationQuery{

query := application.ApplicationQuery{
Selector: ptr.To(selector),
AppNamespace: &appNamespace,
})
}

if limit > 0 {
if offset < 0 {
offset = 0
}
query.Limit = &limit
query.Offset = &offset
}

apps, err := appIf.List(ctx, &query)

errors.CheckError(err)
appList := apps.Items
Expand Down Expand Up @@ -1854,6 +1870,8 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
command.Flags().StringVarP(&appNamespace, "app-namespace", "N", "", "Only list applications in namespace")
command.Flags().StringVarP(&cluster, "cluster", "c", "", "List apps by cluster name or url")
command.Flags().StringVarP(&path, "path", "P", "", "List apps by path")
command.Flags().Int64Var(&limit, "limit", 0, "Limit the number of results (0 = no limit)")
command.Flags().Int64Var(&offset, "offset", 0, "Offset for pagination (requires --limit)")
return command
}

Expand Down
7 changes: 6 additions & 1 deletion docs/user-guide/commands/argocd_app_list.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,359 changes: 1,168 additions & 191 deletions pkg/apiclient/application/application.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/apiclient/application/forwarder_overwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func processApplicationListField(v any, fields map[string]any, exclude bool) (an
return map[string]any{
"items": items,
"metadata": appList.ListMeta,
"stats": appList.Stats,
}, nil
}
return nil, errors.New("not an application list")
Expand Down
Loading
Loading