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

Establish /library and /src directory structure #31

Merged
merged 4 commits into from
Nov 11, 2020

Conversation

ctab
Copy link
Member

@ctab ctab commented Nov 6, 2020

Implementing the directory structure for the tooling proposal:

  1. Moved src.rego and src_test.rego files to /src (with same directory structure as library/)

  2. Moving the sample constraints and any examples to library/<group>/<policy>/samples/<constraint name> directory.

  3. Renamed and slight edits to example files:

  • Renamed examples to example_disallowed.yaml1 and made an example_allowed.yaml for some cases where the example had a comment showing what to switch to make it pass.
  • Example resources all now have "disallowed" or "allowed" in the name.
  • Some of the examples depended on a pre-existing namespace "production"; I switched these to use "default" so they could be applied as is.

1 These were originally disallowed_example.yaml and allowed_example.yaml in the proposal doc; I switched it around when I started making them and realized that example_disallowed.yaml and example_allowed.yaml would be next to each other when listing the directory contents, whereas the other format would split them around constraint.yaml.

Signed-off-by: Craig Tabita <ctab@google.com>
Signed-off-by: Craig Tabita <ctab@google.com>
Signed-off-by: Craig Tabita <ctab@google.com>
Signed-off-by: Craig Tabita <ctab@google.com>
@ctab ctab linked an issue Nov 6, 2020 that may be closed by this pull request
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM, @ritazh @sozercan thoughts?

@sozercan
Copy link
Member

sozercan commented Nov 10, 2020

we are missing some allowed examples for PSPs (like users, volumes, selinux, proc-mount etc) do we want to get to this in this PR or in a follow up?

@ctab
Copy link
Member Author

ctab commented Nov 10, 2020

@sozercan that's true. I was hoping to handle that in a separate PR so it would be easier to see new code vs. existing code.

@maxsmythe
Copy link
Contributor

+1 to minimizing deltas in a PR of this scale.

@ctab ctab merged commit ce24dd6 into open-policy-agent:master Nov 11, 2020
@ctab ctab deleted the restructure branch November 11, 2020 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorganize file structure to prepare for tooling implementation
3 participants