Skip to content

Commit 6179881

Browse files
Merge pull request #2251 from JoelSpeed/ignore-partial-manifests
Ignore partial manifests when running schemacheck
2 parents 4521905 + d7cc995 commit 6179881

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/codegen/pkg/schemacheck/generator.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import (
2020
"k8s.io/klog/v2"
2121
)
2222

23+
const (
24+
// featureGatedCRDManifests is the folder name we use to generate
25+
// partial CRD manifests.
26+
featureGatedCRDManifests = "zz_generated.featuregated-crd-manifests"
27+
)
28+
2329
// Options contains the configuration required for the schemacheck generator.
2430
type Options struct {
2531
// Disabled indicates whether the schemacheck generator is disabled or not.
@@ -230,6 +236,12 @@ func loadSchemaCheckGenerationContextsForVersionFromDir(version generation.APIVe
230236

231237
for _, fileInfo := range dirEntries {
232238
if fileInfo.IsDir() {
239+
if fileInfo.Name() == featureGatedCRDManifests {
240+
// We don't want to check the feature gated manifests.
241+
// All changes will appear in the merged CRD manifests so checking the partial manifests just duplicates errors.
242+
continue
243+
}
244+
233245
subContexts, err := loadSchemaCheckGenerationContextsForVersionFromDir(version, baseCommit, repoBaseDir, filepath.Join(searchPath, fileInfo.Name()), gitBaseSHA)
234246
if err != nil {
235247
errs = append(errs, fmt.Errorf("could not load schema check generation contexts from dir %q: %v", filepath.Join(searchPath, fileInfo.Name()), err))

0 commit comments

Comments
 (0)