Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion cmd/aws_eks_update_kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html
},
}

// https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html
// https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html.
func init() {
awsEksCmdUpdateKubeconfigCmd.DisableFlagParsing = false
AddStackCompletion(awsEksCmdUpdateKubeconfigCmd)
Expand Down
26 changes: 13 additions & 13 deletions cmd/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"
"time"

log "github.com/cloudposse/atmos/pkg/logger"
"github.com/go-git/go-git/v5"
"github.com/samber/lo"
"github.com/spf13/cobra"
Expand All @@ -18,6 +17,7 @@ import (
e "github.com/cloudposse/atmos/internal/exec"
tuiUtils "github.com/cloudposse/atmos/internal/tui/utils"
cfg "github.com/cloudposse/atmos/pkg/config"
log "github.com/cloudposse/atmos/pkg/logger"
"github.com/cloudposse/atmos/pkg/schema"
"github.com/cloudposse/atmos/pkg/telemetry"
"github.com/cloudposse/atmos/pkg/ui/theme"
Expand All @@ -43,7 +43,7 @@ func WithStackValidation(check bool) AtmosValidateOption {
}
}

// processCustomCommands processes and executes custom commands
// processCustomCommands processes and executes custom commands.
func processCustomCommands(
atmosConfig schema.AtmosConfiguration,
commands []schema.Command,
Expand Down Expand Up @@ -127,7 +127,7 @@ func processCustomCommands(
return nil
}

// addCommandWithAlias adds a command hierarchy based on the full command
// addCommandWithAlias adds a command hierarchy based on the full command.
func addCommandWithAlias(parentCmd *cobra.Command, alias string, parts []string) {
if len(parts) == 0 {
return
Expand Down Expand Up @@ -156,7 +156,7 @@ func addCommandWithAlias(parentCmd *cobra.Command, alias string, parts []string)
}
}

// processCommandAliases processes the command aliases
// processCommandAliases processes the command aliases.
func processCommandAliases(
atmosConfig schema.AtmosConfiguration,
aliases schema.CommandAliases,
Expand Down Expand Up @@ -201,7 +201,7 @@ func processCommandAliases(
return nil
}

// preCustomCommand is run before a custom command is executed
// preCustomCommand is run before a custom command is executed.
func preCustomCommand(
cmd *cobra.Command,
args []string,
Expand Down Expand Up @@ -288,7 +288,7 @@ func preCustomCommand(
}
}

// getTopLevelCommands returns the top-level commands
// getTopLevelCommands returns the top-level commands.
func getTopLevelCommands() map[string]*cobra.Command {
existingTopLevelCommands := make(map[string]*cobra.Command)

Expand All @@ -299,7 +299,7 @@ func getTopLevelCommands() map[string]*cobra.Command {
return existingTopLevelCommands
}

// executeCustomCommand executes a custom command
// executeCustomCommand executes a custom command.
func executeCustomCommand(
atmosConfig schema.AtmosConfiguration,
cmd *cobra.Command,
Expand Down Expand Up @@ -458,7 +458,7 @@ func extractTrailingArgs(args []string, osArgs []string) ([]string, string) {
return mainArgs, trailingArgs
}

// cloneCommand clones a custom command config into a new struct
// cloneCommand clones a custom command config into a new struct.
func cloneCommand(orig *schema.Command) (*schema.Command, error) {
origJSON, err := json.Marshal(orig)
if err != nil {
Expand All @@ -473,7 +473,7 @@ func cloneCommand(orig *schema.Command) (*schema.Command, error) {
return &clone, nil
}

// checkAtmosConfig checks Atmos config
// checkAtmosConfig checks Atmos config.
func checkAtmosConfig(opts ...AtmosValidateOption) {
vCfg := &ValidateConfig{
CheckStack: true, // Default value true to check the stack
Expand All @@ -496,7 +496,7 @@ func checkAtmosConfig(opts ...AtmosValidateOption) {
}
}

// printMessageForMissingAtmosConfig prints Atmos logo and instructions on how to configure and start using Atmos
// printMessageForMissingAtmosConfig prints Atmos logo and instructions on how to configure and start using Atmos.
func printMessageForMissingAtmosConfig(atmosConfig schema.AtmosConfiguration) {
c1 := theme.Colors.Info
c2 := theme.Colors.Success
Expand Down Expand Up @@ -590,12 +590,12 @@ func CheckForAtmosUpdateAndPrintMessage(atmosConfig schema.AtmosConfiguration) {
}
}

// Check Atmos is version command
// Check Atmos is version command.
func isVersionCommand() bool {
return len(os.Args) > 1 && os.Args[1] == "version"
}

// handleHelpRequest shows help content and exits only if the first argument is "help" or "--help" or "-h"
// handleHelpRequest shows help content and exits only if the first argument is "help" or "--help" or "-h".
func handleHelpRequest(cmd *cobra.Command, args []string) {
if (len(args) > 0 && args[0] == "help") || Contains(args, "--help") || Contains(args, "-h") {
cmd.Help()
Expand Down Expand Up @@ -630,7 +630,7 @@ func showFlagUsageAndExit(cmd *cobra.Command, err error) error {
return nil
}

// getConfigAndStacksInfo processes the CLI config and stacks
// getConfigAndStacksInfo processes the CLI config and stacks.
func getConfigAndStacksInfo(commandName string, cmd *cobra.Command, args []string) schema.ConfigAndStacksInfo {
// Check Atmos configuration
checkAtmosConfig()
Expand Down
4 changes: 4 additions & 0 deletions cmd/describe_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func setCliArgsForDescribeStackCli(flags *pflag.FlagSet, describe *exec.Describe
"skip": &describe.Skip,
}

// `true` by default.
describe.ProcessTemplates = true
describe.ProcessYamlFunctions = true

var err error
for k := range flagsKeyValue {
if !flags.Changed(k) {
Expand Down
15 changes: 10 additions & 5 deletions cmd/describe_stacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ func TestSetFlagValueInDescribeStacksCliArgs(t *testing.T) {
},
describe: &exec.DescribeStacksArgs{},
expected: &exec.DescribeStacksArgs{
Format: "json",
ProcessTemplates: true,
Skip: []string{"tests"},
Format: "json",
ProcessTemplates: true,
ProcessYamlFunctions: true,
Skip: []string{"tests"},
},
},
{
Expand All @@ -71,7 +72,9 @@ func TestSetFlagValueInDescribeStacksCliArgs(t *testing.T) {
},
describe: &exec.DescribeStacksArgs{},
expected: &exec.DescribeStacksArgs{
Format: "yaml",
Format: "yaml",
ProcessTemplates: true,
ProcessYamlFunctions: true,
},
},
{
Expand All @@ -81,7 +84,9 @@ func TestSetFlagValueInDescribeStacksCliArgs(t *testing.T) {
},
describe: &exec.DescribeStacksArgs{},
expected: &exec.DescribeStacksArgs{
Format: "json",
Format: "json",
ProcessTemplates: true,
ProcessYamlFunctions: true,
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/terraform_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra"
)

// getTerraformCommands returns an array of statically defined Terraform commands with flags
// getTerraformCommands returns an array of statically defined Terraform commands with flags.
func getTerraformCommands() []*cobra.Command {
// List of Terraform commands
return []*cobra.Command{
Expand Down Expand Up @@ -267,7 +267,7 @@ Arguments:
}
}

// attachTerraformCommands attaches static Terraform commands to a provided parent command
// attachTerraformCommands attaches static Terraform commands to a provided parent command.
func attachTerraformCommands(parentCmd *cobra.Command) {
parentCmd.PersistentFlags().String("append-user-agent", "", fmt.Sprintf("Sets the TF_APPEND_USER_AGENT environment variable to customize the User-Agent string in Terraform provider requests. Example: `Atmos/%s (Cloud Posse; +https://atmos.tools)`. This flag works with almost all commands.", version.Version))
parentCmd.PersistentFlags().Bool("skip-init", false, "Skip running `terraform init` before executing terraform commands")
Expand Down
8 changes: 4 additions & 4 deletions cmd/validate_editorconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"strings"

log "github.com/cloudposse/atmos/pkg/logger"
"github.com/editorconfig-checker/editorconfig-checker/v3/pkg/config"
er "github.com/editorconfig-checker/editorconfig-checker/v3/pkg/error"
"github.com/editorconfig-checker/editorconfig-checker/v3/pkg/files"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/spf13/cobra"

errUtils "github.com/cloudposse/atmos/errors"
log "github.com/cloudposse/atmos/pkg/logger"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/cloudposse/atmos/pkg/version"
Expand Down Expand Up @@ -47,7 +47,7 @@ var editorConfigCmd *cobra.Command = &cobra.Command{
},
}

// initializeConfig breaks the initialization cycle by separating the config setup
// initializeConfig breaks the initialization cycle by separating the config setup.
func initializeConfig(cmd *cobra.Command) {
replaceAtmosConfigInConfig(cmd, atmosConfig)

Expand Down Expand Up @@ -149,7 +149,7 @@ func replaceAtmosConfigInConfig(cmd *cobra.Command, atmosConfig schema.AtmosConf
}
}

// runMainLogic contains the main logic
// runMainLogic contains the main logic.
func runMainLogic() {
config := *currentConfig
log.Debug(config.String())
Expand Down Expand Up @@ -191,7 +191,7 @@ func checkVersion(config config.Config) error {
return nil
}

// addPersistentFlags adds flags to the root command
// addPersistentFlags adds flags to the root command.
func addPersistentFlags(cmd *cobra.Command) {
cmd.PersistentFlags().StringVar(&tmpExclude, "exclude", "", "Regex to exclude files from checking")
cmd.PersistentFlags().BoolVar(&initEditorConfig, "init", false, "Create an initial configuration")
Expand Down
2 changes: 1 addition & 1 deletion demo/screengrabs/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INSTALL_PATH ?= ../../website/src/components/Screengrabs
all: build-all install

# Write to /website/static/screengrab/
# Write to website/src/components/Screengrabs/
install:
@echo "Installing screengrabs to $(INSTALL_PATH)"
@mkdir -p $(INSTALL_PATH)
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.193.0
ARG ATMOS_VERSION=1.194.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.5.7
Expand Down
2 changes: 1 addition & 1 deletion go.mod

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

4 changes: 2 additions & 2 deletions go.sum

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

5 changes: 3 additions & 2 deletions internal/exec/describe_affected.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ type describeAffectedExec struct {
processTemplates bool,
processYamlFunctions bool,
skip []string,
onlyInStack string,
) error
printOrWriteToFile func(
atmosConfig *schema.AtmosConfiguration,
Expand Down Expand Up @@ -273,9 +274,9 @@ func (d *describeAffectedExec) Execute(a *DescribeAffectedCmdArgs) error {
return err
}

// Add dependent components and stacks for each affected component
// Add dependent components and stacks for each affected component.
if len(affected) > 0 && a.IncludeDependents {
err = d.addDependentsToAffected(a.CLIConfig, &affected, a.IncludeSettings, a.ProcessTemplates, a.ProcessYamlFunctions, a.Skip)
err = d.addDependentsToAffected(a.CLIConfig, &affected, a.IncludeSettings, a.ProcessTemplates, a.ProcessYamlFunctions, a.Skip, a.Stack)
if err != nil {
return err
}
Expand Down
Loading