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

Unused assignment in example Kubernetes policy #4778

Closed
anderseknert opened this issue Jun 14, 2022 · 0 comments · Fixed by #4783
Closed

Unused assignment in example Kubernetes policy #4778

anderseknert opened this issue Jun 14, 2022 · 0 comments · Fixed by #4783

Comments

@anderseknert
Copy link
Member

This policy example contains unused assignment: https://www.openpolicyagent.org/docs/latest/kubernetes-tutorial/#policy-1-restrict-hostnames

str_parts := split(str, ".")
n_pattern_parts := count(pattern_parts)
n_str_parts := count(str_parts)

Pasting the policy into the Rego playground and evaluating it with strict mode shows this. We should have those removed from the example.

Joffref added a commit to Joffref/opa that referenced this issue Jun 16, 2022
Ref : open-policy-agent#4778
Signed-off-by: Sugate <51022808+Joffref@users.noreply.github.com>
anderseknert pushed a commit that referenced this issue Jun 16, 2022
Fixes #4778

Signed-off-by: Sugate <51022808+Joffref@users.noreply.github.com>
Joffref added a commit to Joffref/opa that referenced this issue Jul 11, 2022
Ref : open-policy-agent#4778
Signed-off-by: Sugate <51022808+Joffref@users.noreply.github.com>
Signed-off-by: Joffref <mariusjoffre@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant