This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new e7148820181 NO-ISSUE: [sonataflow-operator] - Adjust bundle generation 
to receive parameters and remove redundancy (#2776)
e7148820181 is described below

commit e71488201816b909882f87ebf15505701f36d67c
Author: Ricardo Zanini <[email protected]>
AuthorDate: Fri Nov 29 10:34:42 2024 -0500

    NO-ISSUE: [sonataflow-operator] - Adjust bundle generation to receive 
parameters and remove redundancy (#2776)
    
    Signed-off-by: Ricardo Zanini 
<[email protected]>
---
 packages/sonataflow-operator/Makefile            | 10 ++++++----
 packages/sonataflow-operator/images/bundle.yaml  |  6 +++++-
 packages/sonataflow-operator/images/manager.yaml |  2 +-
 packages/sonataflow-operator/package.json        |  3 +++
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/packages/sonataflow-operator/Makefile 
b/packages/sonataflow-operator/Makefile
index b1b274401a5..d95b8592b66 100644
--- a/packages/sonataflow-operator/Makefile
+++ b/packages/sonataflow-operator/Makefile
@@ -309,19 +309,21 @@ endef
 
 
 .PHONY: bundle
-bundle: manifests kustomize install-operator-sdk ## Generate bundle manifests 
and metadata, then validate generated files.
+PACKAGE_NAME = "sonataflow-operator"
+bundle: kustomize install-operator-sdk ## Generate bundle manifests and 
metadata, then validate generated files.
        @echo "📦 Generating bundle manifests and metadata..."
-       @operator-sdk generate kustomize manifests -q > /dev/null 2>&1
+       @operator-sdk generate kustomize manifests --package=$(PACKAGE_NAME) -q 
> /dev/null 2>&1
        @echo "🔧 Setting controller image in Kustomize..."
        @cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) > 
/dev/null 2>&1
        @echo "🔨 Building Kustomize and generating bundle..."
-       @$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle 
$(BUNDLE_GEN_FLAGS) > /dev/null 2>&1
+       @$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle 
$(BUNDLE_GEN_FLAGS) --package=$(PACKAGE_NAME) > /dev/null 2>&1
        @echo "🛠️  Validating generated bundle..."
        @operator-sdk bundle validate ./bundle > /dev/null 2>&1
 
 .PHONY: bundle-build
+BUNDLE_DESCRIPTOR = "images/bundle.yaml"
 bundle-build: ## Build the bundle image
-       cekit -v --descriptor images/bundle.yaml build ${build_options} 
$(BUILDER) --no-squash --build-arg SOURCE_DATE_EPOCH="$(shell git log -1 
--pretty=%ct)"
+       cekit -v --descriptor $(BUNDLE_DESCRIPTOR) build ${build_options} 
$(BUILDER) --no-squash --build-arg SOURCE_DATE_EPOCH="$(shell git log -1 
--pretty=%ct)"
 ifneq ($(ignore_tag),true)
        $(BUILDER) tag sonataflow-operator-bundle:latest $(BUNDLE_IMG)
 endif
diff --git a/packages/sonataflow-operator/images/bundle.yaml 
b/packages/sonataflow-operator/images/bundle.yaml
index 8681e732d98..bcb6e40522e 100644
--- a/packages/sonataflow-operator/images/bundle.yaml
+++ b/packages/sonataflow-operator/images/bundle.yaml
@@ -18,9 +18,13 @@
 schema_version: 1
 name: "sonataflow-operator-bundle"
 description: "SonataFlow Operator Bundle"
-version: 0.0.0"
+version: 0.0.0
 from: "scratch"
 
+args:
+  - name: SOURCE_DATE_EPOCH
+    description: Preserve timestamp while copying files
+
 labels:
   - name: maintainer
     value: [email protected]
diff --git a/packages/sonataflow-operator/images/manager.yaml 
b/packages/sonataflow-operator/images/manager.yaml
index bf89d56a31c..ca60f1df2a6 100644
--- a/packages/sonataflow-operator/images/manager.yaml
+++ b/packages/sonataflow-operator/images/manager.yaml
@@ -16,7 +16,7 @@
 # under the License.
 
 - name: operator-builder
-  version: 0.0.0"
+  version: 0.0.0
   from: "golang:1.22"
   description: Builder Image for the Operator
 
diff --git a/packages/sonataflow-operator/package.json 
b/packages/sonataflow-operator/package.json
index 7d35c014f2a..615fabf297e 100644
--- a/packages/sonataflow-operator/package.json
+++ b/packages/sonataflow-operator/package.json
@@ -26,6 +26,9 @@
     "image:build": "run-script-os",
     "image:build:darwin:win32": "echo 'Image build not supported on Windows 
and macOS'",
     "image:build:linux": ". 
./node_modules/@kie-tools/python-venv/venv/bin/activate && run-script-if --bool 
\"$(build-env containerImages.build)\" --then \"make container-build\"",
+    "image:bundle:build": "run-script-os",
+    "image:bundle:build:darwin:win32": "echo 'Build Operator bundle image not 
supported on Windows and macOS'",
+    "image:bundle:build:linux": ". 
./node_modules/@kie-tools/python-venv/venv/bin/activate && run-script-if --bool 
\"$(build-env containerImages.build)\" --then \"make bundle bundle-build\"",
     "install": "run-script-os",
     "install:darwin:linux": "rimraf bin && go work sync && go mod tidy && node 
install.js && pnpm bump-version && pnpm format",
     "install:win32": "echo 'Install not supported on Windows'",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to