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

compile: bundle roots can be provided by caller #6088

Merged
merged 1 commit into from Jul 14, 2023

Conversation

kubaj
Copy link
Contributor

@kubaj kubaj commented Jul 12, 2023

Why the changes in this PR are needed?

Previously, bundle roots couldn't be provided and neither .manifest file couldn't be provided, because it was replaced by the .manifest generated by the compiler. This will help to build bundles from using the Go library for more advanced use cases with multiple bundles.

What are the changes in this PR?

Added WithRoots option so caller can provide roots.

Notes to assist PR review:

Further comments:

Fixes: #6085

Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kubaj the changes look good. One comment inline.

@@ -223,6 +224,12 @@ func (c *Compiler) WithMetadata(metadata *map[string]interface{}) *Compiler {
return c
}

// WithRoots sets bundle roots in the .manifest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we update the description to something like WithRoots sets the roots to include in the output bundle manifest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment. Updated.

Previously, bundle roots couldn't be provided and neither .manifest file couldn't be provided, because it was replaced by the .manifest generated by the compiler.

Fixes: open-policy-agent#6085

Signed-off-by: Jakub Kulich <jakubkulich@gmail.com>
Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ashutosh-narkar ashutosh-narkar merged commit 322cdd5 into open-policy-agent:main Jul 14, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compile: add WithRoots compiler option
2 participants