-
Notifications
You must be signed in to change notification settings - Fork 172
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
docs: clarify that variables are not allowed in imageReferences field #1472
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: kushal9897 <[email protected]>
Thanks for opening your first Pull Request here! Please check out our Contributing guidelines and confirm that you Signed off. |
Signed-off-by: kushal9897 <[email protected]>
``` | ||
This will result in a validation error because variables are **not allowed** in `imageReferences`. | ||
|
||
#### ** Correct Usage (Using Static Values – Allowed)** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove hashes.
- `preconditions.all` | ||
- `preconditions.any` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to double-check preconditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preconditions
supports variables, have you not been able to verify it?
#### ** Incorrect Usage (Using Variables – Not Allowed)** | ||
```yaml | ||
rules: | ||
- name: restrict-deployment-kinds | ||
match: | ||
resources: | ||
kinds: | ||
- "{{ request.object.kind }}" | ||
``` | ||
**Why is this incorrect?** | ||
- `match.resources.kinds` must contain **static** resource kinds (e.g., `Pod`, `Deployment`). | ||
- Dynamic interpolation using `{{ request.object.kind }}` is **not supported**. | ||
|
||
#### ** Correct Usage (Using Static Values – Allowed)** | ||
```yaml | ||
rules: | ||
- name: restrict-deployment-kinds | ||
match: | ||
resources: | ||
kinds: | ||
- Deployment | ||
- StatefulSet | ||
``` | ||
**Why is this correct?** | ||
- Only predefined, static resource kinds (`Deployment`, `StatefulSet`) are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### ** Incorrect Usage (Using Variables – Not Allowed)** | |
```yaml | |
rules: | |
- name: restrict-deployment-kinds | |
match: | |
resources: | |
kinds: | |
- "{{ request.object.kind }}" | |
``` | |
**Why is this incorrect?** | |
- `match.resources.kinds` must contain **static** resource kinds (e.g., `Pod`, `Deployment`). | |
- Dynamic interpolation using `{{ request.object.kind }}` is **not supported**. | |
#### ** Correct Usage (Using Static Values – Allowed)** | |
```yaml | |
rules: | |
- name: restrict-deployment-kinds | |
match: | |
resources: | |
kinds: | |
- Deployment | |
- StatefulSet | |
``` | |
**Why is this correct?** | |
- Only predefined, static resource kinds (`Deployment`, `StatefulSet`) are used. |
#### **Incorrect Usage** | ||
```yaml | ||
verifyImages: | ||
- imageReferences: ["{{ parse_yaml(allowedregistryprefixes.data.allowedregistryprefixes) }}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate example.
…ield Signed-off-by: kushal9897 <[email protected]>
- `preconditions.all` | ||
- `preconditions.any` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preconditions
supports variables, have you not been able to verify it?
I checked all the preconditions. I will share the logs or attach them with the document. |
Related issue
#1462
Proposed Changes
This PR updates the Verify Images documentation to explicitly state that
variables (
{{ }}
syntax) are not allowed in theimageReferences
field.Checklist