Make function to dump PackageRevisionResources a utility function#966
Conversation
…unction and make visible Signed-off-by: liamfallon <liam.fallon@est.tech>
✅ Deploy Preview for porch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Refactors the package rendering path to reuse a shared utility for writing PackageRevisionResources into a kyaml/filesys filesystem, making it easier to dump resources to disk for debugging.
Changes:
- Adds exported
repository.WriteResourcesToFS(fs, rootDir, resources)utility. - Updates the package revision renderer to call the new utility and removes the local helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/repository/util.go | Introduces exported WriteResourcesToFS helper for persisting resource maps into a filesys.FileSystem. |
| controllers/packagerevisions/pkg/controllers/packagerevision/render.go | Switches renderer to use repository.WriteResourcesToFS and deletes the old local implementation. |
Signed-off-by: liamfallon <liam.fallon@est.tech>
Signed-off-by: liamfallon <liam.fallon@est.tech>
There was a problem hiding this comment.
Pull request overview
Refactors the package rendering helper that writes PackageRevisionResources into a kyaml filesystem by moving it into pkg/repository as a public utility (WriteResourcesToFS), and adds documentation + unit tests to support debugging workflows.
Changes:
- Extracts and exports
WriteResourcesToFS()intopkg/repository/util.go. - Updates the package render controller to call the new utility.
- Adds unit tests and troubleshooting docs showing how to dump resources to disk.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
pkg/repository/util.go |
Adds exported WriteResourcesToFS() utility for writing resource maps into a kyaml FileSystem. |
controllers/packagerevisions/pkg/controllers/packagerevision/render.go |
Switches renderer to use repository.WriteResourcesToFS() instead of a local helper. |
pkg/repository/util_test.go |
Adds test coverage for WriteResourcesToFS() behavior (root, nested paths, rootDir). |
docs/content/en/docs/9_troubleshooting_and_faq/lazy-dog/_index.md |
Documents using WriteResourcesToFS() to dump “before/after” resources during render debugging. |
Signed-off-by: liamfallon <liam.fallon@est.tech>
|



Make function to dump PackageRevisionResources a utility function
Description
writeResourcesToFS()function already existed in the package rendering code. This PR moves it out to a utility function and makes it globally visible asWriteResourcesToFS().PackageRevisionResourcesfor a PR to disk while debuggingType of Change
Checklist
AI Disclosure
[x] I have used AI in the creation of this PR.
WriteResourcesToFS()function, the original function had no test coverage.