Skip to content

docs: add custom image extractor example for ImageValidatingPolicy#1993

Open
Pittu-Sharma wants to merge 8 commits into
kyverno:mainfrom
Pittu-Sharma:fix/mermaid-diagram-rendering
Open

docs: add custom image extractor example for ImageValidatingPolicy#1993
Pittu-Sharma wants to merge 8 commits into
kyverno:mainfrom
Pittu-Sharma:fix/mermaid-diagram-rendering

Conversation

@Pittu-Sharma
Copy link
Copy Markdown
Contributor

Related issue

Fixes #1915

Proposed Changes

This PR addresses the documentation gap identified in issue #1915 by adding a comprehensive and functional example of an ImageValidatingPolicy that utilizes the custom image extractor field (spec.images).

Key changes:

  • Added a new Custom Image Extractor section to the ImageValidatingPolicy documentation.
  • Provided a logically complete YAML example demonstrating how to extract images from a custom resource (example.io/v1/myresources) and perform subsequent signature verification.
  • Expanded existing YAML snippets throughout the document to be logically complete policies (removing partial # ... patches) to improve documentation quality and ensure examples are copy-paste ready.

Checklist

  • I have read the contributing guidelines.
  • I have inspected the website preview for accuracy.
  • I have signed off my issue (using git commit -s).

Pittu-Sharma and others added 2 commits April 23, 2026 11:46
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @JimBugwadia, I have completed the documentation for issue #1915. I've added a functional example for the custom image extractor (spec.images) and also took the opportunity to expand the existing YAML snippets in the file into logically complete policies to improve the documentation's utility.

I have verified the changes locally using npm run dev and ensured the build and link checks pass. Please let me know if any further refinements are needed. Thanks!

Moved the 'Mutate Existing Resources' content from mutate.md into a
dedicated page (mutate-existing.md) to improve discoverability and
allow for deeper coverage of the topic.

The new page expands on the original content with additional sections
covering how triggers work, target selection methods, the permissions
requirement for the background controller, policy update behavior, and
a troubleshooting section with UpdateRequest examples.

A brief summary and link to the new page has been added to mutate.md
to preserve navigation continuity.

The new page is also added to the sidebar in astro.config.mjs under
the ClusterPolicy section.

Closes kyverno#1296

Signed-off-by: Pittu Sharma <pittusharma47@gmail.com>
…isting

Signed-off-by: Pittu Sharma <pittusharma47@gmail.com>
@Suhani95
Copy link
Copy Markdown
Contributor

Suhani95 commented May 18, 2026

Hey @Pittu-Sharma , I noticed this PR includes several changes outside the documentation scope:

  • Hostname matching updates in src/utils/versions.ts
  • Plugin/integration changes in astro.config.mjs

Could we split the programmatic/config/dependency changes into a separate PR and keep this one focused on the .mdx documentation updates?

@Suhani95
Copy link
Copy Markdown
Contributor

could we add a small sample custom resource object near the example to show what object.foo.bar maps to? That would make the CEL extraction path easier to understand for users working with CRDs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation webhook labels May 18, 2026
Signed-off-by: pittu sharma <pittusharma47@gmail.com>
@Pittu-Sharma Pittu-Sharma force-pushed the fix/mermaid-diagram-rendering branch from 6c968f9 to c3ebd28 Compare May 23, 2026 09:53
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @Suhani95,

Thank you for the review and the suggestions! I've updated the PR to address both of your points:

  1. Focused Scope: I've removed the programmatic and configuration changes (src/utils/versions.ts, astro.config.mjs, and the dependency lockfiles) from this branch so that this PR is now strictly focused on the .mdx documentation updates. I'll be opening a separate PR for those other updates.
  2. Custom Resource Example: I've added a small sample custom resource YAML snippet right before the custom image extractor policy example. This clearly demonstrates what the object.foo.bar CEL expression maps to, which should make it much easier for users working with CRDs to understand the extraction path.

Please let me know if anything else needs adjusting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config documentation Improvements or additions to documentation webhook

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Create an example for an image validating policy that uses a custom image extractor

3 participants