You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on writing a ClusterPolicy that includes a rule with a verifyImages section. I've been trying to source the imageReferences from a context value that contains an array of strings. My policy has failed to validate (without indication why) until I explicitly tried making the value of imageReferences into an array.
At that point, I finally was able to generate the following error
"policy contains invalid variables: rule \"verify-image-signature\" should not have variables in image reference section"
This was extremely frustrating to diagnose, only to run into that error. If variables are not allowed in certain portions of a policy, the documentation (both on the main site and the API documentation for ClusterPolicy and Policy) should indicate that.
Slack discussion
No response
The text was updated successfully, but these errors were encountered:
Imo, it would also be nice to document why variables are not allowed in these areas, but at least documenting that they are not allowed would be a welcome first step.
I appreciate the insights! While my current PR (#1472) addresses the imageReferences field, I see that there are other areas where variable interpolation is not allowed. I updated my PR to include documentation for those sections and also provide a brief explanation of why variables are restricted in these areas. I'll review the validation logic in validate.go and make the necessary changes. Let me know if there are any other sections you'd like to highlight!
Description
I've been working on writing a
ClusterPolicy
that includes a rule with averifyImages
section. I've been trying to source theimageReferences
from a context value that contains an array of strings. My policy has failed to validate (without indication why) until I explicitly tried making the value ofimageReferences
into an array.At that point, I finally was able to generate the following error
Example rule:
This was extremely frustrating to diagnose, only to run into that error. If variables are not allowed in certain portions of a policy, the documentation (both on the main site and the API documentation for
ClusterPolicy
andPolicy
) should indicate that.Slack discussion
No response
The text was updated successfully, but these errors were encountered: