Auto: sync versions [release-v1.44] - #5298
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes are low-risk generated embed wrappers; the only feedback is minor naming/documentation clarity in the new admission embed helper.
Pull request overview
Automated update on release-v1.44 to sync in generated/versioned assets by adding small Go wrappers that expose embedded YAML content (CRDs and admission policies) as fs.FS for consumers.
Changes:
- Add
embed.gowrappers for Enterprise projectcalico.org v3 CRDs (v3.projectcalico.org) and v1 CRD-mode CRDs (v1.crd.projectcalico.org). - Add an
embed.gowrapper for Enterprise admission policy YAMLs underpkg/imports/admission/enterprise.
File summaries
| File | Description |
|---|---|
| pkg/imports/crds/enterprise/v3.projectcalico.org/embed.go | Introduces a small fs.FS accessor backed by go:embed for Enterprise v3 projectcalico.org CRD YAMLs. |
| pkg/imports/crds/enterprise/v1.crd.projectcalico.org/embed.go | Introduces a small fs.FS accessor backed by go:embed for Enterprise v1 CRD-mode CRD YAMLs. |
| pkg/imports/admission/enterprise/embed.go | Introduces a small fs.FS accessor backed by go:embed for Enterprise admission policy YAMLs. |
Review details
- Files reviewed: 3/3 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.
| // Package admission serves the generated admission policies to the components | ||
| // that install them, so nothing has to keep a copy of its own. |
| //go:embed *.yaml | ||
| var crds embed.FS | ||
|
|
||
| // FS returns the admission policy YAML in this directory. | ||
| func FS() fs.FS { | ||
| return crds | ||
| } |
41813c6 to
56407f1
Compare
|
Removing "merge-when-ready" label due to new commits |
There was a problem hiding this comment.
🟡 Changes recommended
Newly-added Go files under embedded/iterated YAML directories will be treated as YAML inputs by existing loaders, which can cause runtime panics during CRD/admission policy parsing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
| // Package admission serves the generated admission policies to the components | ||
| // that install them, so nothing has to keep a copy of its own. | ||
| package admission |
| // Package crd serves the generated crd.projectcalico.org CRDs to the components | ||
| // that install them, so nothing has to keep a copy of its own. | ||
| package crd |
| // Package crd serves the generated projectcalico.org v3 CRDs to the components | ||
| // that install them, so nothing has to keep a copy of its own. | ||
| package crd |
56407f1 to
2a7248b
Compare
|
Removing "merge-when-ready" label due to new commits |
There was a problem hiding this comment.
🔵 Needs a closer look
The newly added embed.go files are placed inside directories that existing loaders embed and iterate as YAML-only, which will cause Go source files to be read/parsed as YAML and panic.
Review details
Suppressed comments (3)
pkg/imports/crds/enterprise/v1.crd.projectcalico.org/embed.go:25
- This directory is currently treated as embedded data by pkg/imports/crds/crds.go (
//go:embed enterprise) andgetEnterpriseCRDSource()iteratesReadDir("enterprise/v1.crd.projectcalico.org")without filtering, assuming every entry is YAML. Addingembed.gohere will cause the embedded FS to include a Go source file that then gets read and split/parsed as CRD YAML, leading to a panic inpkg/imports/crds/crds_test.go(and at runtime when CRDs are loaded). The fix should be to keep these CRD directories YAML-only or update the loader to ignore non-*.yaml entries / narrow thego:embedpatterns.
// Package crd serves the generated crd.projectcalico.org CRDs to the components
// that install them, so nothing has to keep a copy of its own.
package crd
import (
"embed"
"io/fs"
)
//go:embed *.yaml
var crds embed.FS
pkg/imports/admission/enterprise/embed.go:25
pkg/imports/admission/admission.goembeds the entireenterprisedirectory (//go:embed enterprise) andgetAdmissionPolicies()iteratesReadDir("enterprise")without filtering, assuming all entries are YAML policy bundles. Adding thisembed.gomeans the embedded FS will include a Go source file that then gets read and parsed as YAML, which will fail (panic) when admission policies are loaded/tests run. Keep this directory YAML-only, or update the loader/embed patterns to exclude non-*.yaml files.
// Package admission serves the generated admission policies to the components
// that install them, so nothing has to keep a copy of its own.
package admission
import (
"embed"
"io/fs"
)
//go:embed *.yaml
var crds embed.FS
pkg/imports/crds/enterprise/v3.projectcalico.org/embed.go:25
- This directory is currently treated as embedded data by pkg/imports/crds/crds.go (
//go:embed enterprise) andgetEnterpriseCRDSource()iteratesReadDir("enterprise/v3.projectcalico.org")without filtering, assuming every entry is YAML. Addingembed.gohere will cause the embedded FS to include a Go source file that then gets read and split/parsed as CRD YAML, leading to a panic inpkg/imports/crds/crds_test.go(and at runtime when CRDs are loaded). The fix should be to keep these CRD directories YAML-only or update the loader to ignore non-*.yaml entries / narrow thego:embedpatterns.
// Package crd serves the generated projectcalico.org v3 CRDs to the components
// that install them, so nothing has to keep a copy of its own.
package crd
import (
"embed"
"io/fs"
)
//go:embed *.yaml
var crds embed.FS
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
2a7248b to
20d105b
Compare
Automated sync of versions and CRDs from Calico and Calico Enterprise into
release-v1.44viamake gen-versions.Triggered by scheduled workflow.