Skip to content

Enhance Atmos CLI: Add Support for Custom Base Path and Config Paths #1091

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 118 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
7f13ce6
refactor InitCliConfig
haitham911 Feb 17, 2025
9ed97f7
add readConfig function
haitham911 Feb 18, 2025
5389ffc
Merge branch 'main' into Viper-built-in-configuration
haitham911 Feb 18, 2025
1fe3e66
add load config
haitham911 Feb 18, 2025
1cfec36
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 18, 2025
3ad2d48
add default.go & update snapshots
haitham911 Feb 18, 2025
263d14a
resolve comments
haitham911 Feb 18, 2025
2532cfc
remove unused function processConfigFile
haitham911 Feb 19, 2025
86bf3cc
improve log
haitham911 Feb 19, 2025
9de9d7b
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 19, 2025
037560c
add imports
haitham911 Feb 21, 2025
5e134f5
update snapshots
haitham911 Feb 21, 2025
413f955
add import config test
haitham911 Feb 21, 2025
eae3f97
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 21, 2025
6c2f103
refactor LoadConfig into smaller helper functions
haitham911 Feb 21, 2025
0bc7b4a
update Valid_Log_Level snapshots
haitham911 Feb 21, 2025
f87f1e9
update log snapshots
haitham911 Feb 21, 2025
d660739
update snapshots
haitham911 Feb 22, 2025
1858c2b
update snapshots Valid_Log_Level
haitham911 Feb 22, 2025
36cd759
Merge branch 'main' into atmos-import-config
haitham911 Feb 22, 2025
daaa03c
remove //nolint:revive
haitham911 Feb 22, 2025
c0db066
Exclude any line containing "log."
haitham911 Feb 22, 2025
8920e56
fix lint revive.add-constant
haitham911 Feb 22, 2025
09fe32d
update add-constant to include "error","path"
haitham911 Feb 22, 2025
e4b6f24
improve code lint
haitham911 Feb 22, 2025
da8006a
improve log
haitham911 Feb 22, 2025
54bb994
improve log charmbracelet aliased
haitham911 Feb 23, 2025
36ab8e8
Preprocess Atmos config with custom functions
haitham911 Feb 24, 2025
e42aa94
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 24, 2025
19136b0
remove print line
haitham911 Feb 24, 2025
0c95ad9
improve logs
haitham911 Feb 24, 2025
b2669c7
refactor processScalarNode
haitham911 Feb 24, 2025
ab18aab
improve logs
haitham911 Feb 24, 2025
0a9353a
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 24, 2025
462b5bf
fix linter error
haitham911 Feb 24, 2025
55a9b05
fix linter errors
haitham911 Feb 24, 2025
115006b
update snapshots
haitham911 Feb 24, 2025
6180ff5
fix linter errors
haitham911 Feb 24, 2025
6f5d329
fix linter
haitham911 Feb 24, 2025
21ae927
add global --base-path ,--config ,--config-path
haitham911 Feb 25, 2025
982d33f
add embed atmos config
haitham911 Feb 25, 2025
d5c4373
add global --base-path ,--config ,--config-path
haitham911 Feb 25, 2025
6a09b65
enhance code
haitham911 Feb 25, 2025
0b4f71d
go format file
haitham911 Feb 25, 2025
8afa420
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 25, 2025
1cb9623
disable atmos_vendor_pull
haitham911 Feb 25, 2025
d4f7630
update snapshots Valid_Log_Level_in_Environment_Variable
haitham911 Feb 25, 2025
ea71b2f
update snapshots
haitham911 Feb 25, 2025
7ebb430
Merge branch 'atmos-import-config' into DEV-2790
haitham911 Feb 25, 2025
483782e
updates snapshots
haitham911 Feb 25, 2025
729e119
update snapshots
haitham911 Feb 25, 2025
7cda8a4
Merge branch 'main' into atmos-import-config
haitham911 Mar 4, 2025
2ee18b9
set config path dir
haitham911 Mar 4, 2025
25688c6
update snapshots
haitham911 Mar 5, 2025
351c73b
add processStackConfigs on config.go
haitham911 Mar 5, 2025
9ab9d3c
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 5, 2025
eff1fd7
fix linter errors config.go
haitham911 Mar 9, 2025
6c661ac
add nolint:gocritic for InitCliConfig
haitham911 Mar 9, 2025
3bceb0b
Merge branch 'atmos-import-config' into DEV-2790
haitham911 Mar 9, 2025
4a3b34a
Merge branch 'main' into atmos-import-config
osterman Mar 12, 2025
60bed99
fix readEnvAmosConfigPath
haitham911 Mar 12, 2025
2cdd2b9
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 12, 2025
2742bb9
improve log
haitham911 Mar 12, 2025
33f1aec
Merge branch 'main' into atmos-import-config
aknysh Mar 12, 2025
498baca
Merge branch 'main' into atmos-import-config
haitham911 Mar 12, 2025
c8accb4
fix import
haitham911 Mar 12, 2025
23423b3
Merge branch 'main' into atmos-import-config
haitham911 Mar 13, 2025
69269ff
Merge branch 'main' into atmos-import-config
osterman Mar 14, 2025
0043a45
Merge branch 'main' into atmos-import-config
haitham911 Mar 15, 2025
a7ff480
update snapshots
haitham911 Mar 16, 2025
3548783
fix linter error
haitham911 Mar 16, 2025
76b4971
Apply suggestions from code review
osterman Mar 17, 2025
a33f5ab
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 17, 2025
df9c5a6
remove log
haitham911 Mar 17, 2025
a0b0e45
update snap shots
haitham911 Mar 17, 2025
31251b1
Merge branch 'main' into atmos-import-config
haitham911 Mar 17, 2025
501a94b
add ProcessSchemas
haitham911 Mar 17, 2025
2040b9e
resolve comments
haitham911 Mar 17, 2025
f78b7b0
fix base path
haitham911 Mar 17, 2025
85e3d04
add doc
haitham911 Mar 17, 2025
c860c89
move functions to helper
haitham911 Mar 17, 2025
9ffb03d
Merge branch 'main' into atmos-import-config
haitham911 Mar 17, 2025
c936af3
update snapshots
haitham911 Mar 17, 2025
8871f80
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 17, 2025
29d78c2
update snapshot
haitham911 Mar 18, 2025
2bf442b
update snapshots
haitham911 Mar 18, 2025
4b6baad
update snapshots
haitham911 Mar 18, 2025
2bb9e3f
remove repository root configuration from CLI docs
haitham911 Mar 18, 2025
4ca552c
Merge branch 'atmos-import-config' into DEV-2790
haitham911 Mar 18, 2025
2444a40
update snapshots
haitham911 Mar 18, 2025
751240c
update doc
haitham911 Mar 18, 2025
ff38c59
update snapshot
haitham911 Mar 18, 2025
fe627ac
fix test TestExecuteVendorPullCommand
haitham911 Mar 18, 2025
4b3c1cb
fix tests TestExecuteWorkflowCmd,TestExecuteVendorPull
haitham911 Mar 18, 2025
bf346ea
add test cases
haitham911 Mar 18, 2025
9534bd4
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 18, 2025
d3195a0
Merge branch 'main' into DEV-2790
haitham911 Mar 22, 2025
ad754fe
remove comment
haitham911 Mar 27, 2025
3572a9b
Merge branch 'main' into DEV-2790
haitham911 Mar 27, 2025
76e30d3
Merge branch 'main' into DEV-2790
haitham911 Mar 29, 2025
0fa8ddb
fix test
haitham911 Mar 29, 2025
4c9299b
Merge branch 'main' into DEV-2790
haitham911 Apr 1, 2025
6db2c92
set --config as global on editorconfig
haitham911 Apr 1, 2025
0fa7065
Merge branch 'main' into DEV-2790
aknysh Apr 1, 2025
7157821
modify description flag --config --config-path
haitham911 Apr 3, 2025
751c7e7
add test
haitham911 Apr 3, 2025
6409fc8
add test
haitham911 Apr 3, 2025
12808eb
update snapshots
haitham911 Apr 3, 2025
34554ce
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 3, 2025
5718998
update doc
haitham911 Apr 3, 2025
7557d71
update doc
haitham911 Apr 3, 2025
0babbe5
Merge branch 'main' into DEV-2790
haitham911 Apr 4, 2025
d12b369
set configFilePaths value on editorConfigCmd
haitham911 Apr 5, 2025
21b07b9
fix linter error
haitham911 Apr 5, 2025
4b47622
fix linter error
haitham911 Apr 5, 2025
6992777
fix linter
haitham911 Apr 5, 2025
2ce4512
Merge branch 'main' into DEV-2790
aknysh Apr 10, 2025
53afee9
Merge branch 'main' into DEV-2790
aknysh Apr 10, 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
6 changes: 4 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ func init() {
"Errors can be redirected to any file or any standard file descriptor (including `/dev/null`)")

RootCmd.PersistentFlags().String("logs-level", "Info", "Logs level. Supported log levels are Trace, Debug, Info, Warning, Off. If the log level is set to Off, Atmos will not log any messages")
RootCmd.PersistentFlags().String("logs-file", "/dev/stderr", "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`")

RootCmd.PersistentFlags().String("logs-file", "/dev/stderr", "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'")
RootCmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
RootCmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration files (comma-separated or repeated flag)")
RootCmd.PersistentFlags().StringSlice("config-path", []string{}, "Paths to configuration directories (comma-separated or repeated flag)")
// Set custom usage template
err := templates.SetCustomUsageFunc(RootCmd)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion cmd/validate_editorconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
replaceAtmosConfigInConfig(cmd, atmosConfig)

configPaths := []string{}
if cmd.Flags().Changed("config") {
config := cmd.Flags().Lookup("config")
if config != nil {
configFilePaths = strings.Split(config.Value.String(), ",")
}

Check warning on line 57 in cmd/validate_editorconfig.go

View check run for this annotation

Codecov / codecov/patch

cmd/validate_editorconfig.go#L54-L57

Added lines #L54 - L57 were not covered by tests
}
if len(configFilePaths) == 0 {
configPaths = append(configPaths, defaultConfigFileNames...)
} else {
Expand Down Expand Up @@ -179,7 +185,6 @@

// addPersistentFlags adds flags to the root command
func addPersistentFlags(cmd *cobra.Command) {
cmd.PersistentFlags().StringSliceVar(&configFilePaths, "config", defaultConfigFileNames, "Paths to the configuration files")
cmd.PersistentFlags().StringVar(&tmpExclude, "exclude", "", "Regex to exclude files from checking")
cmd.PersistentFlags().BoolVar(&initEditorConfig, "init", false, "Create an initial configuration")

Expand Down
13 changes: 12 additions & 1 deletion internal/exec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@
return configAndStacksInfo, err
}

configAndStacksInfo.BasePath, err = cmd.Flags().GetString("base-path")
if err != nil {
return configAndStacksInfo, err
}

Check warning on line 215 in internal/exec/utils.go

View check run for this annotation

Codecov / codecov/patch

internal/exec/utils.go#L214-L215

Added lines #L214 - L215 were not covered by tests
configAndStacksInfo.AtmosConfigFilesFromArg, err = cmd.Flags().GetStringSlice("config")
if err != nil {
return configAndStacksInfo, err
}

Check warning on line 219 in internal/exec/utils.go

View check run for this annotation

Codecov / codecov/patch

internal/exec/utils.go#L218-L219

Added lines #L218 - L219 were not covered by tests
configAndStacksInfo.AtmosConfigDirsFromArg, err = cmd.Flags().GetStringSlice("config-path")
if err != nil {
return configAndStacksInfo, err
}

Check warning on line 223 in internal/exec/utils.go

View check run for this annotation

Codecov / codecov/patch

internal/exec/utils.go#L222-L223

Added lines #L222 - L223 were not covered by tests
finalAdditionalArgsAndFlags := argsAndFlagsInfo.AdditionalArgsAndFlags
if len(additionalArgsAndFlags) > 0 {
finalAdditionalArgsAndFlags = append(finalAdditionalArgsAndFlags, additionalArgsAndFlags...)
Expand All @@ -220,7 +232,6 @@
configAndStacksInfo.ComponentType = componentType
configAndStacksInfo.ComponentFromArg = argsAndFlagsInfo.ComponentFromArg
configAndStacksInfo.GlobalOptions = argsAndFlagsInfo.GlobalOptions
configAndStacksInfo.BasePath = argsAndFlagsInfo.BasePath
configAndStacksInfo.TerraformCommand = argsAndFlagsInfo.TerraformCommand
configAndStacksInfo.TerraformDir = argsAndFlagsInfo.TerraformDir
configAndStacksInfo.HelmfileCommand = argsAndFlagsInfo.HelmfileCommand
Expand Down
7 changes: 6 additions & 1 deletion internal/exec/vendor_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ func TestExecuteVendorPullCommand(t *testing.T) {
cmd.PersistentFlags().Bool("dry-run", false, "Simulate pulling the latest version of the specified component from the remote repository without making any changes.")
cmd.PersistentFlags().String("tags", "", "Only vendor the components that have the specified tags")
cmd.PersistentFlags().Bool("everything", false, "Vendor all components")

cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
// Execute the command
err = cmd.RunE(cmd, []string{})
assert.NoError(t, err, "'atmos vendor pull' command should execute without error")
Expand Down Expand Up @@ -103,6 +105,9 @@ func TestExecuteVendorPull(t *testing.T) {
}
// set vendor pull command
cmd := cobra.Command{}
cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
flags := cmd.Flags()
flags.String("component", "", "")
flags.String("stack", "", "")
Expand Down
4 changes: 3 additions & 1 deletion internal/exec/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ atmos describe component c1 -s test
cmd.PersistentFlags().Bool("dry-run", false, "Simulate the workflow without making any changes")
cmd.PersistentFlags().String("from-step", "", "Resume the workflow from the specified step")
cmd.PersistentFlags().String("stack", "", "Execute the workflow for the specified stack")

cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
// Execute the command
cmd.SetArgs([]string{"--file", "workflows", "show-all-describe-component-commands"})
err = cmd.Execute()
Expand Down
8 changes: 8 additions & 0 deletions pkg/config/atmos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
logs:
# Can also be set using 'ATMOS_LOGS_FILE' ENV var, or '--logs-file' command-line argument
# File or standard file descriptor to write logs to
# Logs can be written to any file or any standard file descriptor, including `/dev/stdout`, `/dev/stderr` and `/dev/null`
file: "/dev/stderr"
# Supported log levels: Trace, Debug, Info, Warning, Off
# Can also be set using 'ATMOS_LOGS_LEVEL' ENV var, or '--logs-level' command-line argument
level: Info
16 changes: 13 additions & 3 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func TestMergeConfig_ConfigFileNotFound(t *testing.T) {
tempDir := t.TempDir() // Empty directory, no config file

v := viper.New()
err := mergeConfig(v, tempDir, true)
err := mergeConfig(v, tempDir, CliConfigFileName, true)

assert.Error(t, err)
assert.Contains(t, err.Error(), "Config File \"atmos\" Not Found")
Expand All @@ -262,7 +262,7 @@ logs:
createConfigFile(t, tempDir, "atmos.yaml", content)
v := viper.New()
v.SetConfigType("yaml")
err := mergeConfig(v, tempDir, false)
err := mergeConfig(v, tempDir, CliConfigFileName, false)
assert.NoError(t, err)
assert.Equal(t, "./", v.GetString("base_path"))
content2 := `
Expand All @@ -272,10 +272,20 @@ vendor:
`
tempDir2 := t.TempDir()
createConfigFile(t, tempDir2, "atmos.yml", content2)
err = mergeConfig(v, tempDir2, false)
err = mergeConfig(v, tempDir2, CliConfigFileName, false)
assert.NoError(t, err)
assert.Equal(t, "./test", v.GetString("base_path"))
assert.Equal(t, "./test2-vendor.yaml", v.GetString("vendor.base_path"))
assert.Equal(t, "Debug", v.GetString("logs.level"))
assert.Equal(t, filepath.Join(tempDir2, "atmos.yml"), v.ConfigFileUsed())
}

func TestMergeDefaultConfig(t *testing.T) {
v := viper.New()

err := mergeDefaultConfig(v)
assert.Error(t, err, "cannot decode configuration: unable to determine config type")
v.SetConfigType("yaml")
err = mergeDefaultConfig(v)
assert.NoError(t, err, "should not return error if config type is yaml")
}
4 changes: 3 additions & 1 deletion pkg/config/const.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package config

const (
CliConfigFileName = "atmos"
CliConfigFileName = "atmos"
DotCliConfigFileName = ".atmos"

SystemDirConfigFilePath = "/usr/local/etc/atmos"
WindowsAppDataEnvVar = "LOCALAPPDATA"

Expand Down
50 changes: 40 additions & 10 deletions pkg/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import (
"bytes"
_ "embed"
"errors"
"fmt"
"os"
Expand All @@ -16,10 +17,14 @@
"gopkg.in/yaml.v3"
)

//go:embed atmos.yaml
var embeddedConfigData []byte

const MaximumImportLvL = 10

var ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")

// * Embedded atmos.yaml (`atmos/pkg/config/atmos.yaml`)
// * System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
// * Home directory (~/.atmos).
// * Current working directory.
Expand All @@ -31,8 +36,20 @@
v.SetConfigType("yaml")
v.SetTypeByDefaultValue(true)
setDefaultConfiguration(v)
// Load embed atmos.yaml
if err := loadEmbeddedConfig(v); err != nil {
return atmosConfig, err
}

Check warning on line 42 in pkg/config/load.go

View check run for this annotation

Codecov / codecov/patch

pkg/config/load.go#L41-L42

Added lines #L41 - L42 were not covered by tests
if len(configAndStacksInfo.AtmosConfigFilesFromArg) > 0 || len(configAndStacksInfo.AtmosConfigDirsFromArg) > 0 {
err := loadConfigFromCLIArgs(v, configAndStacksInfo, &atmosConfig)
if err != nil {
return atmosConfig, err
}
return atmosConfig, nil
}

// Load configuration from different sources.
if err := loadConfigSources(v, configAndStacksInfo.AtmosCliConfigPath); err != nil {
if err := loadConfigSources(v, configAndStacksInfo); err != nil {
return atmosConfig, err
}
// If no config file is used, fall back to the default CLI config.
Expand Down Expand Up @@ -103,7 +120,7 @@

// loadConfigSources delegates reading configs from each source,
// returning early if any step in the chain fails.
func loadConfigSources(v *viper.Viper, cliConfigPath string) error {
func loadConfigSources(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo) error {
if err := readSystemConfig(v); err != nil {
return err
}
Expand All @@ -120,7 +137,7 @@
return err
}

return readAtmosConfigCli(v, cliConfigPath)
return readAtmosConfigCli(v, configAndStacksInfo.AtmosCliConfigPath)
}

// readSystemConfig load config from system dir .
Expand All @@ -136,7 +153,7 @@
}

if len(configFilePath) > 0 {
err := mergeConfig(v, configFilePath, false)
err := mergeConfig(v, configFilePath, CliConfigFileName, false)
switch err.(type) {
case viper.ConfigFileNotFoundError:
return nil
Expand All @@ -154,7 +171,7 @@
return err
}
configFilePath := filepath.Join(home, ".atmos")
err = mergeConfig(v, configFilePath, true)
err = mergeConfig(v, configFilePath, CliConfigFileName, true)
if err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
Expand All @@ -173,7 +190,7 @@
if err != nil {
return err
}
err = mergeConfig(v, wd, true)
err = mergeConfig(v, wd, CliConfigFileName, true)
if err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
Expand All @@ -190,7 +207,7 @@
if atmosPath == "" {
return nil
}
err := mergeConfig(v, atmosPath, true)
err := mergeConfig(v, atmosPath, CliConfigFileName, true)
if err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
Expand All @@ -209,7 +226,7 @@
if len(atmosCliConfigPath) == 0 {
return nil
}
err := mergeConfig(v, atmosCliConfigPath, true)
err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)

Check warning on line 229 in pkg/config/load.go

View check run for this annotation

Codecov / codecov/patch

pkg/config/load.go#L229

Added line #L229 was not covered by tests
switch err.(type) {
case viper.ConfigFileNotFoundError:
log.Debug("config not found", "file", atmosCliConfigPath)
Expand All @@ -221,11 +238,11 @@
}

// mergeConfig merge config from a specified path directory and process imports. Return error if config file does not exist.
func mergeConfig(v *viper.Viper, path string, processImports bool) error {
func mergeConfig(v *viper.Viper, path string, fileName string, processImports bool) error {
// Create a temporary Viper instance to isolate this configuration load
tempViper := viper.New()
tempViper.AddConfigPath(path)
tempViper.SetConfigName(CliConfigFileName)
tempViper.SetConfigName(fileName)
tempViper.SetConfigType("yaml")
// Read configuration into temporary instance
if err := tempViper.ReadInConfig(); err != nil {
Expand Down Expand Up @@ -413,3 +430,16 @@

return nil
}

// loadEmbeddedConfig loads the embedded atmos.yaml configuration.
func loadEmbeddedConfig(v *viper.Viper) error {
// Create a reader from the embedded YAML data
reader := bytes.NewReader(embeddedConfigData)

// Merge the embedded configuration into Viper
if err := v.MergeConfig(reader); err != nil {
return fmt.Errorf("failed to merge embedded config: %w", err)
}

Check warning on line 442 in pkg/config/load.go

View check run for this annotation

Codecov / codecov/patch

pkg/config/load.go#L441-L442

Added lines #L441 - L442 were not covered by tests

return nil
}
Loading
Loading