Skip to content

Commit

Permalink
updated warning message when policy base path and rego sub path aren'…
Browse files Browse the repository at this point in the history
…t specified together
  • Loading branch information
devang-gaur committed Mar 18, 2021
1 parent cc3b4bb commit 85e6077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/config/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ func LoadGlobalConfig(configFile string) error {
}

if len(configReader.getPolicyConfig().BasePath) > 0 && len(configReader.getPolicyConfig().RepoPath) == 0 {
zap.S().Warnf("policy base path specified in configfile %s, but rego_subdir path not specified.", configFile)
zap.S().Warnf("policy base path specified in configfile '%s', but rego_subdir path not specified. applying default rego_subdir value '%s'", configFile, GetPolicyRepoPath())
}

if len(configReader.getPolicyConfig().RepoPath) > 0 && len(configReader.getPolicyConfig().BasePath) == 0 {
zap.S().Warnf("policy rego_subdir specified in configfile %s, but base path not specified.", configFile)
zap.S().Warnf("policy rego_subdir specified in configfile '%s', but base path not specified. applying default base path value '%s'", configFile, GetPolicyBasePath())
}

if len(configReader.getPolicyConfig().BasePath) > 0 {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/init/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var (

testPolicyRepoPath = filepath.Join(utils.GetHomeDir(), ".terrascan-test")
testRegoSubDirPath = filepath.Join(testPolicyRepoPath, "pkg", "policies", "opa", "rego")
warnNoBasePath = "policy rego_subdir specified in configfile config/relative_rego_subdir.toml, but base path not specified."
warnNoSubDirPath = "policy base path specified in configfile config/home_prefixed_path.toml, but rego_subdir path not specified."
warnNoBasePath = "policy rego_subdir specified in configfile 'config/relative_rego_subdir.toml', but base path not specified. applying default base path value"
warnNoSubDirPath = "policy base path specified in configfile 'config/home_prefixed_path.toml', but rego_subdir path not specified. applying default rego_subdir value"
)

var _ = Describe("Init", func() {
Expand Down

0 comments on commit 85e6077

Please sign in to comment.