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

Conftest policy_sets "<CODE_DIRECTORY>" path clarification #1739

Closed
gmaghera opened this issue Aug 5, 2021 · 5 comments · Fixed by #1925
Closed

Conftest policy_sets "<CODE_DIRECTORY>" path clarification #1739

gmaghera opened this issue Aug 5, 2021 · 5 comments · Fixed by #1925

Comments

@gmaghera
Copy link
Contributor

gmaghera commented Aug 5, 2021

I'm having a hard time deciphering this from the docs, for getting started with conftest:

policies:
  owners:
    users:
      - nishkrishnan
  policy_sets:
    - name: null_resource_warning
      path: <CODE_DIRECTORY>/policies/null_resource_warning/
      source: local

What is <CODE_DIRECTORY> here? We are deploying Atlantis as a Helm chart, and use a custom image which installs Terragrunt atop of the official image.

Would I have to bake the rego files into my Atlantis image and provide an absolute path to the directory containing them? Is there any relation to the Git repository which is integrated with Atlantis for its MR review process? (that is what code directory suggests to me)

@david-heward-unmind
Copy link
Contributor

I can't answer you definitively. Though I can tell you we do exactly that. Bake the rego files (from a different repo) into the image at image build time. Then reference the absolute path in atlantis repo.yml.

@gmaghera
Copy link
Contributor Author

gmaghera commented Aug 6, 2021

Thank you @davidh-unmind, that sure helps! 🙇

@guillermotti
Copy link

Hi @davidh-unmind !

Could you add those lines to the docs? I had the same problem, there is no clarification about what <CODE_DIRECTORY> is.

Thanks in advance!

@LuigiClemente-Awin
Copy link

It would be nice to have more clarity and better documentation on this new feature, please.
Some examples are needed.
Also, please integrate this into the official documentation: https://githubmemory.com/repo/runatlantis/atlantis/issues/1576.
Not clear how you would run a test inside the workflow as well: what command would you use?

Thanks,
Luigi

@davehewy
Copy link
Contributor

I've made a start on a PR (link above).

This is derived from my own learnings. Thoughts welcome.

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 a pull request may close this issue.

5 participants