8000 Add `--query` (shorthand `-q`) flag to all `atmos describe <subcommand>` commands by aknysh · Pull Request #920 · cloudposse/atmos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add --query (shorthand -q) flag to all atmos describe <subcommand> commands #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e367197
updates
aknysh Dec 30, 2024
3e8039f
updates
aknysh Dec 30, 2024
5ee6558
updates
aknysh Dec 30, 2024
3b7cc60
updates
aknysh Jan 1, 2025
56d632b
updates
aknysh Jan 1, 2025
2fd79ca
updates
aknysh Jan 1, 2025
6ad4818
updates
aknysh Jan 1, 2025
387f068
updates
aknysh Jan 1, 2025
58f6d06
updates
aknysh Jan 1, 2025
42d7231
updates
aknysh Jan 2, 2025
c89b649
updates
aknysh Jan 2, 2025
59f560a
updates
aknysh Jan 3, 2025
fff0f25
updates
aknysh Jan 3, 2025
0cfbc03
updates
aknysh Jan 3, 2025
fa94442
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 3, 2025
e9f3cc9
updates
aknysh Jan 3, 2025
9600d7c
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 4, 2025
142a400
updates
aknysh Jan 4, 2025
986f489
updates
aknysh Jan 4, 2025
6bbab1d
updates
aknysh Jan 5, 2025
de5c5fc
updates
aknysh Jan 5, 2025
ad43eea
updates
aknysh Jan 5, 2025
da030d7
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 5, 2025
9ff14e2
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 6, 2025
e1268ea
updates
aknysh Jan 6, 2025
47353e5
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 6, 2025
b42d9e1
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 7, 2025
c3ba221
updates
aknysh Jan 7, 2025
4abfed2
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 7, 2025
98294c6
updates
aknysh Jan 7, 2025
da5a237
updates
aknysh Jan 7, 2025
437af8f
updates
aknysh Jan 8, 2025
7433f93
updates
aknysh Jan 8, 2025
571f30d
updates
aknysh Jan 8, 2025
5ce9afc
updates
aknysh Jan 8, 2025
49c779e
updates
aknysh Jan 8, 2025
1f26f29
updates
aknysh Jan 8, 2025
4853ed1
Merge branch 'main' into add-vars-parameter
aknysh Jan 8, 2025
c01a353
updates
aknysh Jan 8, 2025
f495d77
Merge remote-tracking branch 'origin/main' into add-vars-parameter
aknysh Jan 8, 2025
a8a66f1
updates
aknysh Jan 8, 2025
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2024 Cloud Posse, LLC
Copyright 2020-2025 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# are independent settings (supporting both absolute and relative paths).
# If 'base_path' is provided, 'components.terraform.base_path', 'components.helmfile.base_path', 'stacks.base_path' and 'workflows.base_path'
# are considered paths relative to 'base_path'.
base_path: "."
base_path: ""

vendor:
# Path to vendor configuration file or directory containing vendor files
Expand Down
5 changes: 4 additions & 1 deletion cmd/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ var aboutCmd = &cobra.Command{
return fmt.Errorf("failed to render about documentation: %w", err)
}

fmt.Fprint(os.Stdout, out)
_, err = fmt.Fprint(os.Stdout, out)
if err != nil {
return err
}
return nil
},
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ var describeCmd = &cobra.Command{
}

func init() {
describeCmd.PersistentFlags().StringP("query", "q", "", "Query the results of an 'atmos describe' command using 'yq' expressions: atmos describe <subcommand> --query <yq-expression>")

RootCmd.AddCommand(describeCmd)
}
13 changes: 10 additions & 3 deletions cmd/list_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package cmd
import (
"fmt"

"github.com/fatih/color"
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
"github.com/cloudposse/atmos/pkg/config"
l "github.com/cloudposse/atmos/pkg/list"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/fatih/color"
"github.com/spf13/cobra"
)

// listComponentsCmd lists atmos components
Expand All @@ -23,7 +24,13 @@ var listComponentsCmd = &cobra.Command{
// Check Atmos configuration
checkAtmosConfig()

stackFlag, _ := cmd.Flags().GetString("stack")
flags := cmd.Flags()

stackFlag, err := flags.GetString("stack")
if err != nil {
u.PrintMessageInColor(fmt.Sprintf("Error getting the 'stack' flag: %v", err), color.New(color.FgRed))
return
}

configAndStacksInfo := schema.ConfigAndStacksInfo{}
atmosConfig, err := config.InitCliConfig(configAndStacksInfo, true)
Expand Down
5 changes: 3 additions & 2 deletions cmd/list_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package cmd
import (
"fmt"

"github.com/fatih/color"
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
"github.com/cloudposse/atmos/pkg/config"
l "github.com/cloudposse/atmos/pkg/list"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/fatih/color"
"github.com/spf13/cobra"
)

// listStacksCmd lists atmos stacks
Expand Down
6 changes: 5 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ func init() {
RootCmd.PersistentFlags().String("logs-file", "/dev/stdout", "The file to write Atmos logs to. Logs can be written to any file or any standard file descriptor, including '/dev/stdout', '/dev/stderr' and '/dev/null'")

// Set custom usage template
templates.SetCustomUsageFunc(RootCmd)
err := templates.SetCustomUsageFunc(RootCmd)
if err != nil {
u.LogErrorAndExit(atmosConfig, err)
}

initCobraConfig()
}

Expand Down
6 changes: 5 additions & 1 deletion cmd/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ var supportCmd = &cobra.Command{
return fmt.Errorf("failed to render support documentation: %w", err)
}

fmt.Fprint(os.Stdout, out)
_, err = fmt.Fprint(os.Stdout, out)
if err != nil {
return err
}

return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion examples/quick-start-advanced/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG GEODESIC_OS=debian
# https://atmos.tools/
# https://github.com/cloudposse/atmos
# https://github.com/cloudposse/atmos/releases
ARG ATMOS_VERSION=1.137.0
ARG ATMOS_VERSION=1.140.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.5.7
Expand Down
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require (
github.com/kubescape/go-git-url v0.0.30
github.com/lrstanley/bubblezone v0.0.0-20241221063659-0f12a2876fb2
github.com/mattn/go-isatty v0.0.20
github.com/mikefarah/yq/v4 v4.44.6
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-wordwrap v1.0.1
github.com/mitchellh/mapstructure v1.5.0
Expand All @@ -51,6 +52,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/zclconf/go-cty v1.16.0
golang.org/x/term v0.28.0
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
mvdan.cc/sh/v3 v3.10.0
Expand All @@ -68,9 +70,11 @@ require (
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/Shopify/ejson v1.3.3 // indirect
github.com/a8m/envsubst v1.4.2 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/agnivade/levenshtein v1.2.0 // indirect
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
Expand Down Expand Up @@ -117,13 +121,15 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dlclark/regexp2 v1.11.0 // indirect
github.com/docker/cli v27.1.1+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/libkv v0.2.2-0.20180912205406-458977154600 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad // indirect
github.com/elliotchance/orderedmap v1.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand All @@ -135,6 +141,8 @@ require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/goccy/go-yaml v1.13.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
Expand Down Expand Up @@ -176,6 +184,7 @@ require (
github.com/huandu/xstrings v1.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/joho/godotenv v1.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand All @@ -201,7 +210,7 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down Expand Up @@ -235,6 +244,7 @@ require (
github.com/yashtewari/glob-intersection v0.2.0 // indirect
github.com/yuin/goldmark v1.7.4 // indirect
github.com/yuin/goldmark-emoji v1.0.3 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
github.com/zealic/xignore v0.3.3 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down
Loading
Loading
0