Skip to content

Commit

Permalink
Add process-templates, --process-functions and --skip flags to …
Browse files Browse the repository at this point in the history
…`atmos describe affected`, `atmos describe component` and `atmos describe stacks` commands (#1006)

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
aknysh and autofix-ci[bot] authored Feb 3, 2025
1 parent a6fb9e6 commit f1c0999
Show file tree
Hide file tree
Showing 43 changed files with 423 additions and 230 deletions.
2 changes: 1 addition & 1 deletion cmd/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func executeCustomCommand(
}

// Get the config for the component in the stack
componentConfig, err := e.ExecuteDescribeComponent(component, stack, true)
componentConfig, err := e.ExecuteDescribeComponent(component, stack, true, true, nil)
if err != nil {
u.LogErrorAndExit(err)
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/describe_affected.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ func init() {
"If set to 'false' (default), the target reference will be checked out instead\n"+
"This requires that the target reference is already cloned by Git, and the information about it exists in the '.git' directory")

describeAffectedCmd.PersistentFlags().Bool("process-templates", true, "Enable/disable Go template processing in Atmos stack manifests when executing the command: atmos describe affected --process-templates=false")
describeAffectedCmd.PersistentFlags().Bool("process-functions", true, "Enable/disable YAML functions processing in Atmos stack manifests when executing the command: atmos describe affected --process-functions=false")
describeAffectedCmd.PersistentFlags().StringSlice("skip", nil, "Skip executing a YAML function when processing Atmos stack manifests: atmos describe affected --skip=terraform.output")

describeCmd.AddCommand(describeAffectedCmd)
}
2 changes: 2 additions & 0 deletions cmd/describe_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func init() {
describeComponentCmd.PersistentFlags().StringP("format", "f", "yaml", "The output format: atmos describe component <component> -s <stack> --format=yaml|json ('yaml' is default)")
describeComponentCmd.PersistentFlags().String("file", "", "Write the result to the file: atmos describe component <component> -s <stack> --file component.yaml")
describeComponentCmd.PersistentFlags().Bool("process-templates", true, "Enable/disable Go template processing in Atmos stack manifests when executing the command: atmos describe component <component> -s <stack> --process-templates=false")
describeComponentCmd.PersistentFlags().Bool("process-functions", true, "Enable/disable YAML functions processing in Atmos stack manifests when executing the command: atmos describe component <component> -s <stack> --process-functions=false")
describeComponentCmd.PersistentFlags().StringSlice("skip", nil, "Skip executing a YAML function in the Atmos stack manifests when executing the command: atmos describe component <component> -s <stack> --skip=terraform.output")

err := describeComponentCmd.MarkPersistentFlagRequired("stack")
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions cmd/describe_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func init() {

describeStacksCmd.PersistentFlags().Bool("process-templates", true, "Enable/disable Go template processing in Atmos stack manifests when executing the command: atmos describe stacks --process-templates=false")

describeStacksCmd.PersistentFlags().Bool("process-functions", true, "Enable/disable YAML functions processing in Atmos stack manifests when executing the command: atmos describe stacks --process-functions=false")

describeStacksCmd.PersistentFlags().Bool("include-empty-stacks", false, "Include stacks with no components in the output: atmos describe stacks --include-empty-stacks")

describeStacksCmd.PersistentFlags().StringSlice("skip", nil, "Skip executing a YAML function in the Atmos stack manifests when executing the command: atmos describe stacks --skip=terraform.output")

describeCmd.AddCommand(describeStacksCmd)
}
2 changes: 1 addition & 1 deletion cmd/list_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var listComponentsCmd = &cobra.Command{
return
}

stacksMap, err := e.ExecuteDescribeStacks(atmosConfig, "", nil, nil, nil, false, false, false)
stacksMap, err := e.ExecuteDescribeStacks(atmosConfig, "", nil, nil, nil, false, false, false, false, nil)
if err != nil {
u.PrintMessageInColor(fmt.Sprintf("Error describing stacks: %v", err), theme.Colors.Error)
return
Expand Down
2 changes: 1 addition & 1 deletion cmd/list_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var listStacksCmd = &cobra.Command{
return
}

stacksMap, err := e.ExecuteDescribeStacks(atmosConfig, "", nil, nil, nil, false, false, false)
stacksMap, err := e.ExecuteDescribeStacks(atmosConfig, "", nil, nil, nil, false, false, false, false, nil)
if err != nil {
u.PrintMessageInColor(fmt.Sprintf("Error describing stacks: %v", err), theme.Colors.Error)
return
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.156.0
ARG ATMOS_VERSION=1.158.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.5.7
Expand Down
54 changes: 27 additions & 27 deletions go.mod

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

Loading

0 comments on commit f1c0999

Please sign in to comment.