-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(misconf): variable support for Terraform Plan #7228
Conversation
Signed-off-by: nikpivkin <[email protected]>
if len(v.Msgpack) == 0 { // len(0) because that's the default value for a "bytes" in protobuf | ||
return nil, fmt.Errorf("dynamic value does not have msgpack serialization") | ||
} |
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.
I'm not sure if I understand the comment, we check the len to be zero to ensure that what we are unpacking is msgpack right?
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.
Terraforom stores cty values in msgpack encoding . If the byte length is 0, it means a invalid value is represented. I looked up the implementation in Terraform.
|
||
for _, file := range protoFiles { | ||
if err := sh.RunV("protoc", ".", "paths=source_relative", "--go_out", ".", "--go_opt", | ||
"paths=source_relative", file); err != nil { | ||
return err | ||
} | ||
} |
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.
If it is run in the container, would we need to update https://github.com/aquasecurity/trivy/blob/5e20c115fee9196943a3715c4f85bb3eac9d7d66/Dockerfile.protoc as well?
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.
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.
mage:protoc
command builds an image and runs it. The dockerfile does not need to be updated.
Description
This PR adds support for input variables that are stored in Terraform Plan.
Related issues
Checklist