@@ -109,7 +109,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
109
109
projectName = strings .ToLower (filepath .Base (dir ))
110
110
}
111
111
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 ))... )
113
113
114
114
makefileBytes = append ([]byte (fmt .Sprintf (makefileBundleImageFragement , p .config .GetDomain (), projectName )), makefileBytes ... )
115
115
@@ -217,7 +217,7 @@ const (
217
217
.PHONY: bundle
218
218
bundle: ## Generate bundle manifests and metadata, then validate generated files.
219
219
## 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)
221
221
operator-sdk bundle validate ./bundle
222
222
223
223
.PHONY: bundle-build
@@ -233,7 +233,35 @@ bundle-push: ## Push the bundle image.
233
233
const (
234
234
makefileBundleImageFragement = `
235
235
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.
236
261
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>)
237
265
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
238
266
`
239
267
)
0 commit comments