Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file.
the operator ClusterRole ([#418]).
- Install default resources regardless of CRD maintenance flag ([#439]).
- File logging no longer crash-loops the operator when the root filesystem is read-only, as it is on OpenShift. Logs are written to an `emptyDir` at `/var/log/listener-operator` ([#444]).
- The OLM bundle declares that the operator provides a CSI driver and sets `createdAt` ([#449]).

[#411]: https://github.com/stackabletech/listener-operator/pull/411
[#416]: https://github.com/stackabletech/listener-operator/pull/416
Expand All @@ -32,6 +33,7 @@ All notable changes to this project will be documented in this file.
[#439]: https://github.com/stackabletech/listener-operator/pull/439
[#441]: https://github.com/stackabletech/listener-operator/pull/441
[#444]: https://github.com/stackabletech/listener-operator/pull/444
[#449]: https://github.com/stackabletech/listener-operator/pull/449
[#450]: https://github.com/stackabletech/listener-operator/pull/450

## [26.7.0] - 2026-07-21
Expand Down
40 changes: 33 additions & 7 deletions scripts/generate-olm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
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)
"""

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" / "listener-operator"
Expand Down Expand Up @@ -1179,9 +1180,7 @@ def build_configmap(
key = "storageclass.yaml"
elif kind == "Service":
key = "service.yaml"
elif kind == "DaemonSet":
key = f"{name}.yaml"
elif kind == "Deployment":
elif kind == "DaemonSet" or kind == "Deployment":
key = f"{name}.yaml"
else:
continue
Expand Down Expand Up @@ -1286,6 +1285,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],
Expand Down Expand Up @@ -1379,7 +1404,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",
Expand All @@ -1392,6 +1417,7 @@ def build_csv(
"capabilities": "Basic Install",
"description": chart["description"],
"repository": "https://github.com/stackabletech/listener-operator",
"createdAt": created_at(),
"com.redhat.openshift.versions": openshift_versions,
},
},
Expand Down
Loading