-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: DependsOn files #305
Conversation
{{ range $key, $val := .LocalsBlock }} | ||
{{ $key }} = {{ $val }} | ||
{{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these will always be sorted!
gotemplate sorts maps by keys
golang/go@a5950df
locals { | ||
bar = jsondecode(file("../../../bar.json")) | ||
foofoofoo = yamldecode(file("../../../foofoofoo.yaml")) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding file dependencies makes their content available through locals.
config/v2/validation.go
Outdated
func (c *Config) ValidateFileDependencies(fs afero.Fs) error { | ||
var errs *multierror.Error | ||
c.WalkComponents(func(component string, comms ...Common) { | ||
files := ResolveOptionalStringSlice(DependsOnFilesGetter, comms...) | ||
for _, file := range files { | ||
if _, err := fs.Stat(file); os.IsNotExist(err) { | ||
errs = multierror.Append(err, fmt.Errorf("File does not exist: %s\n", file)) | ||
} | ||
} | ||
}) | ||
|
||
return errs.ErrorOrNil() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fogg validates file dependencies exist
72e8909
to
70f9dcc
Compare
bar = jsondecode(file("../../../bar.json")) | ||
foo_foo_foo = yamldecode(file("../../../foo-fooFoo.yaml")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tf vars are tflint naming convention compliant
config/v2/validation.go
Outdated
if convertedNames[convertedName] { | ||
errs = multierror.Append(errs, fmt.Errorf("files %v, Collision detected for converted filename: %s\n", convertedName, files)) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config validation detects variable name collisions
70f9dcc
to
7043937
Compare
- Add ability to depend on files - Convert file names to terraform naming convention (snake_case). - Validate file name collisions in config implements #304
7043937
to
9fe63c1
Compare
Add ability to depend on files
implements #304