From d9c32a9cc377c2433c1bfd7f2d7619c98d4600b4 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:25:44 +0200 Subject: [PATCH 1/3] wip --- olm/build-bundles.sh | 71 +++++++++++++++++++++++------------------- olm/build-manifests.py | 4 +-- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/olm/build-bundles.sh b/olm/build-bundles.sh index d2a1f33..6e49082 100755 --- a/olm/build-bundles.sh +++ b/olm/build-bundles.sh @@ -62,31 +62,37 @@ bundle-clean() { } bundle-build() { - local BUNDLE_NAME="$1" - local INPUT_DIR="$2" - local OUTPUT_DIR="$3" - - mkdir -p "$OUTPUT_DIR" + local OPERATOR="$1" + local VERSION="$2" + local INPUT_DIR="$3" + local OUTPUT_DIR="$4" - # Generate manifests - "${OPERATOR_SDK}" generate bundle \ - --deploy-dir "$INPUT_DIR" \ - --output-dir "$OUTPUT_DIR" \ - --package "$BUNDLE_NAME" + local BUNDLE_NAME="stackable-${OPERATOR}-operator" - # For whatever reason the generated CSV drops the spec.relatedImages and spec.install properties - cp "${INPUT_DIR}"/manifests/*.clusterserviceversion.yaml "$OUTPUT_DIR/manifests" + local CHANNEL="$(echo "$VERSION" | sed 's/\.[^.]*$//')" - # Generate metadata - "${OPERATOR_SDK}" generate bundle \ - --metadata \ - --output-dir "$OUTPUT_DIR" \ - --package "$BUNDLE_NAME" \ - --channels "stable,$CHANNEL" \ - --default-channel "$CHANNEL" - - # The annotations generated by the operator sdk do not include the openshift versions. - grep com.redhat.openshift "$INPUT_DIR"/metadata/annotations.yaml >> "$OUTPUT_DIR"/metadata/annotations.yaml + mkdir -p "$OUTPUT_DIR" + cp -r "${INPUT_DIR}/manifests/" "$OUTPUT_DIR/manifests" + cp -r "${INPUT_DIR}/metadata/" "$OUTPUT_DIR/metadata" + + cat > "${OUTPUT_DIR}/bundle.Dockerfile" < None: dest_file = ( args.dest_dir / "manifests" - / f"{args.op_name}.clusterserviceversion.yaml" + / f"stackable-{args.op_name}.v{args.release}.clusterserviceversion.yaml" ) elif m["kind"] == "CustomResourceDefinition": dest_file = ( @@ -560,7 +560,7 @@ def quay_image(images: list[tuple[str, str]]) -> list[dict[str, str]]: data = json.load(response) if not data["tags"]: raise ManifestException( - f"Could not find manifest digest for release '{release}' on quay.io. Pass '--use-helm-images' to use oci.stackable.tech instead." + f"Could not find manifest digest for release '{release}' on quay.io. Pass '--use-helm-images' to use docker.stackable.tech instead." ) manifest_digest = [ From 586208d80c13a29fd080459d7fd3ecb3187a1a01 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 15 Apr 2025 15:42:50 +0200 Subject: [PATCH 2/3] fix typo --- olm/build-manifests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/olm/build-manifests.py b/olm/build-manifests.py index 5f42228..e143e7f 100755 --- a/olm/build-manifests.py +++ b/olm/build-manifests.py @@ -560,7 +560,7 @@ def quay_image(images: list[tuple[str, str]]) -> list[dict[str, str]]: data = json.load(response) if not data["tags"]: raise ManifestException( - f"Could not find manifest digest for release '{release}' on quay.io. Pass '--use-helm-images' to use docker.stackable.tech instead." + f"Could not find manifest digest for release '{release}' on quay.io. Pass '--use-helm-images' to use oci.stackable.tech instead." ) manifest_digest = [ From f5ed7555eb090b37a453efa8cb3a9ce9cfb4ce07 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 15 Apr 2025 16:57:30 +0200 Subject: [PATCH 3/3] delete metrics bundle labels --- olm/build-bundles.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/olm/build-bundles.sh b/olm/build-bundles.sh index 6e49082..d444432 100755 --- a/olm/build-bundles.sh +++ b/olm/build-bundles.sh @@ -85,9 +85,6 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=stackable-${OPERATOR}-operator LABEL operators.operatorframework.io.bundle.channels.v1=stable,${CHANNEL} LABEL operators.operatorframework.io.bundle.channel.default.v1=${CHANNEL} -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.39.1 -LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 -LABEL operators.operatorframework.io.metrics.project_layout=unknown # Copy files to locations specified by labels. COPY manifests /manifests/