Skip to content

Commit

Permalink
fix: version in CRD files correspond to CRD spec version, not API ver…
Browse files Browse the repository at this point in the history
…sion

Fixes #115

Signed-off-by: Chris Laprun <claprun@redhat.com>
  • Loading branch information
metacosm committed Sep 14, 2023
1 parent 26840be commit fda47f9
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit fda47f9

Please sign in to comment.