Skip to content

Commit d474ba0

Browse files
bug for command addition in Makefile (#93)
1 parent 95356a3 commit d474ba0

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

pkg/quarkus/v1alpha/api.go

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
109109
projectName = strings.ToLower(filepath.Base(dir))
110110
}
111111

112-
makefileBytes = append(makefileBytes, []byte(fmt.Sprintf(makefileBundleVarFragment, p.resource.Plural, p.resource.QualifiedGroup(), p.resource.Version, projectName))...)
112+
makefileBytes = append(makefileBytes, []byte(fmt.Sprintf(makefileBundleVarFragment, p.resource.Plural, p.resource.QualifiedGroup(), p.resource.Version))...)
113113

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

@@ -217,7 +217,7 @@ const (
217217
.PHONY: bundle
218218
bundle: ## Generate bundle manifests and metadata, then validate generated files.
219219
## marker
220-
cat target/kubernetes/%[1]s.%[2]s-%[3]s.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version 0.1.1 --default-channel=stable --channels=stable --package=%[4]s
220+
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)
221221
operator-sdk bundle validate ./bundle
222222
223223
.PHONY: bundle-build
@@ -233,7 +233,35 @@ bundle-push: ## Push the bundle image.
233233
const (
234234
makefileBundleImageFragement = `
235235
VERSION ?= 0.0.1
236+
237+
# CHANNELS define the bundle channels used in the bundle.
238+
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
239+
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
240+
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
241+
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
242+
ifneq ($(origin CHANNELS), undefined)
243+
BUNDLE_CHANNELS := --channels=$(CHANNELS)
244+
endif
245+
246+
# DEFAULT_CHANNEL defines the default channel used in the bundle.
247+
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable")
248+
# To re-generate a bundle for any other default channel without changing the default setup, you can:
249+
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable)
250+
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable")
251+
ifneq ($(origin DEFAULT_CHANNEL), undefined)
252+
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
253+
endif
254+
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
255+
256+
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
257+
# This variable is used to construct full image tags for bundle and catalog images.
258+
#
259+
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
260+
# %[1]s/%[2]s-bundle:$VERSION and %[1]s/%[2]s-catalog:$VERSION.
236261
IMAGE_TAG_BASE ?= %[1]s/%[2]s
262+
263+
# BUNDLE_IMG defines the image:tag used for the bundle.
264+
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
237265
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
238266
`
239267
)

0 commit comments

Comments
 (0)