Skip to content
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

Do not process stack configs when executing command atmos vendor pull and the --stack flag is not specified #740

Merged
merged 13 commits into from
Oct 30, 2024
Merged
8 changes: 6 additions & 2 deletions cmd/vendor_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
cfg "github.com/cloudposse/atmos/pkg/config"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
)
Expand All @@ -16,9 +17,12 @@ var vendorPullCmd = &cobra.Command{
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Run: func(cmd *cobra.Command, args []string) {
// Check Atmos configuration
checkAtmosConfig()
haitham911 marked this conversation as resolved.
Show resolved Hide resolved
haitham911 marked this conversation as resolved.
Show resolved Hide resolved
cliConfig, err := cfg.InitCliConfig(schema.ConfigAndStacksInfo{}, false)
if err != nil {
u.LogErrorAndExit(cliConfig, err)
}

err := e.ExecuteVendorPullCmd(cmd, args)
err = e.ExecuteVendorPullCmd(cmd, args)
if err != nil {
u.LogErrorAndExit(schema.CliConfiguration{}, err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/vendor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func ExecuteVendorPullCommand(cmd *cobra.Command, args []string) error {
// system dir, home dir, current dir, ENV vars, command-line arguments
cliConfig, err := cfg.InitCliConfig(info, processStacks)
if err != nil {
return err
return fmt.Errorf("failed to initialize CLI config: %w", err)
}

dryRun, err := flags.GetBool("dry-run")
Expand Down