Skip to content

fix: version in CRD files correspond to CRD spec version, not API version #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/quarkus/v1alpha/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (p *createAPISubcommand) PostScaffold() error {
func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
scaffolder := scaffolds.NewCreateAPIScaffolder(p.config, *p.resource)

var s = fmt.Sprintf(makefileBundleCRDFile, p.resource.Plural, p.resource.QualifiedGroup(), p.resource.Version)
var s = fmt.Sprintf(makefileBundleCRDFile, p.resource.Plural, p.resource.QualifiedGroup())
foundLine := findOldFilesForReplacement(filePath, s)

if !foundLine {
Expand All @@ -109,7 +109,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
projectName = strings.ToLower(filepath.Base(dir))
}

makefileBytes = append(makefileBytes, []byte(fmt.Sprintf(makefileBundleVarFragment, p.resource.Plural, p.resource.QualifiedGroup(), p.resource.Version))...)
makefileBytes = append(makefileBytes, []byte(fmt.Sprintf(makefileBundleVarFragment, p.resource.Plural, p.resource.QualifiedGroup()))...)

makefileBytes = append([]byte(fmt.Sprintf(makefileBundleImageFragement, p.config.GetDomain(), projectName)), makefileBytes...)

Expand Down Expand Up @@ -208,7 +208,7 @@ func findOldFilesForReplacement(path, newfile string) bool {
}

const (
makefileBundleCRDFile = `target/kubernetes/%[1]s.%[2]s-%[3]s.yml`
makefileBundleCRDFile = `target/kubernetes/%[1]s.%[2]s-v1.yml`
)

const (
Expand All @@ -217,7 +217,7 @@ const (
.PHONY: bundle
bundle: ## Generate bundle manifests and metadata, then validate generated files.
## marker
cat target/kubernetes/%[1]s.%[2]s-%[3]s.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
cat target/kubernetes/%[1]s.%[2]s-v1.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
operator-sdk bundle validate ./bundle

.PHONY: bundle-build
Expand Down