From 783abf00273324ecb7674286ddaa172253a07854 Mon Sep 17 00:00:00 2001 From: Lars Francke Date: Tue, 3 Nov 2026 00:15:45 +0100 Subject: [PATCH 1/2] feat(olm): Set createdAt and the CSI feature annotation --- scripts/generate-olm.py | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/scripts/generate-olm.py b/scripts/generate-olm.py index 93c17066..281035d8 100755 --- a/scripts/generate-olm.py +++ b/scripts/generate-olm.py @@ -20,19 +20,20 @@ Requirements: - uv (https://docs.astral.sh/uv/) — installs PyYAML automatically - helm (https://helm.sh) + - git (createdAt is the commit date of the checked-out release tag) - cargo (Rust toolchain) """ import argparse -import subprocess +import datetime import json -import urllib.request +import subprocess import urllib.error +import urllib.request from pathlib import Path import yaml - SCRIPT_DIR = Path(__file__).parent.resolve() REPO_ROOT = SCRIPT_DIR.parent HELM_CHART = REPO_ROOT / "deploy" / "helm" / "secret-operator" @@ -1302,6 +1303,32 @@ def min_kube_version(release: str) -> str: return lowest_kube_version(platforms) +def created_at() -> str: + """Return the commit date of the checked-out commit, so createdAt stays the same when the bundle is rebuilt.""" + try: + result = subprocess.run( + ["git", "log", "-1", "--format=%ct"], + capture_output=True, + text=True, + check=True, + cwd=REPO_ROOT, + ) + except subprocess.CalledProcessError as exc: + raise RuntimeError(f"Failed to read the commit date: {exc.stderr}") from exc + return format_created_at(int(result.stdout)) + + +def format_created_at(epoch_seconds: int) -> str: + """Format a Unix timestamp the way OLM bundles write createdAt, in UTC. + + >>> format_created_at(1784628000) + '2026-07-21T10:00:00Z' + """ + return datetime.datetime.fromtimestamp(epoch_seconds, tz=datetime.UTC).strftime( + "%Y-%m-%dT%H:%M:%SZ" + ) + + def build_csv( version: str, helm_docs: list[dict], @@ -1392,7 +1419,7 @@ def build_csv( "operatorframework.io/suggested-namespace": "stackable-operators", "features.operators.openshift.io/cnf": "false", "features.operators.openshift.io/cni": "false", - "features.operators.openshift.io/csi": "false", + "features.operators.openshift.io/csi": "true", "features.operators.openshift.io/disconnected": "false", "features.operators.openshift.io/fips-compliant": "false", "features.operators.openshift.io/proxy-aware": "false", @@ -1405,6 +1432,7 @@ def build_csv( "capabilities": "Basic Install", "description": chart["description"], "repository": "https://github.com/stackabletech/secret-operator", + "createdAt": created_at(), "com.redhat.openshift.versions": openshift_versions, }, }, From 2fdbb4a958814f695b2ebc3be4cde1214ff356be Mon Sep 17 00:00:00 2001 From: Lars Francke Date: Wed, 18 Nov 2026 17:33:39 +0100 Subject: [PATCH 2/2] chore: Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2149a0e7..29534a2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ All notable changes to this project will be documented in this file. indefinitely, even though cert-manager had long since renewed it in the Secret. The restart is scheduled halfway between cert-manager's own `status.renewalTime` and the expiry ([#752]). - Install default resources regardless of CRD maintenance flag ([#762]). +- The OLM bundle declares that the operator provides a CSI driver and sets `createdAt` ([#779]). [#730]: https://github.com/stackabletech/secret-operator/pull/730 [#735]: https://github.com/stackabletech/secret-operator/pull/735 @@ -46,6 +47,7 @@ All notable changes to this project will be documented in this file. [#770]: https://github.com/stackabletech/secret-operator/pull/770 [#773]: https://github.com/stackabletech/secret-operator/pull/773 [#775]: https://github.com/stackabletech/secret-operator/pull/775 +[#779]: https://github.com/stackabletech/secret-operator/pull/779 ## [26.7.0] - 2026-07-21