Repository navigation
Auto: sync versions [master] - #5297
github-actions[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes are straightforward, compile-time safe embed wrappers with only minor naming clarity nits identified.
Pull request overview
This PR is an automated make gen-versions sync into master, adding small Go helper packages that embed generated Calico / Enterprise CRD YAMLs and admission policy YAMLs so other code can consume them via fs.FS.
Changes:
- Add
embed.gohelpers for Calico and Enterprise CRD directories (v1.crd.projectcalico.organdv3.projectcalico.org). - Add
embed.gohelpers for Calico and Enterprise admission policy YAML directories.
File summaries
| File | Description |
|---|---|
| pkg/imports/crds/enterprise/v3.projectcalico.org/embed.go | Embeds Enterprise v3 projectcalico.org CRD YAMLs and exposes them via FS(). |
| pkg/imports/crds/enterprise/v1.crd.projectcalico.org/embed.go | Embeds Enterprise v1 crd.projectcalico.org CRD YAMLs and exposes them via FS(). |
| pkg/imports/crds/calico/v3.projectcalico.org/embed.go | Embeds Calico v3 projectcalico.org CRD YAMLs and exposes them via FS(). |
| pkg/imports/crds/calico/v1.crd.projectcalico.org/embed.go | Embeds Calico v1 crd.projectcalico.org CRD YAMLs and exposes them via FS(). |
| pkg/imports/admission/enterprise/embed.go | Embeds Enterprise admission policy YAMLs and exposes them via FS(). |
| pkg/imports/admission/calico/embed.go | Embeds Calico admission policy YAMLs and exposes them via FS(). |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the admission policy YAML in this directory. | ||
| func FS() fs.FS { | ||
| return crds | ||
| } |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the admission policy YAML in this directory. | ||
| func FS() fs.FS { | ||
| return crds | ||
| } |
192df98 to
f1156f1
Compare
|
Removing "merge-when-ready" label due to new commits |
There was a problem hiding this comment.
🟡 Changes recommended
New embed.go files are placed inside directories that existing code embeds and iterates as YAML-only, which can cause YAML unmarshal panics at runtime.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 6
- Review effort level: Lite
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the admission policy YAML in this directory. | ||
| func FS() fs.FS { | ||
| return crds |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the admission policy YAML in this directory. | ||
| func FS() fs.FS { | ||
| return crds |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the CRD YAML generated into this directory. | ||
| func FS() fs.FS { | ||
| return crds |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the CRD YAML generated into this directory. | ||
| func FS() fs.FS { | ||
| return crds |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the CRD YAML generated into this directory. | ||
| func FS() fs.FS { | ||
| return crds |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the CRD YAML generated into this directory. | ||
| func FS() fs.FS { | ||
| return crds |
Automated sync of versions and CRDs from Calico and Calico Enterprise into
masterviamake gen-versions.Triggered by scheduled workflow.