Skip to content

Commit 12ebef6

Browse files
committed
address review comments
1 parent bf558b8 commit 12ebef6

13 files changed

Lines changed: 1477 additions & 21 deletions

File tree

api/v1alpha1/keepercluster_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ type KeeperClusterSpec struct {
5858
// +optional
5959
// +kubebuilder:default:="cluster.local"
6060
ClusterDomain string `json:"clusterDomain,omitempty"`
61+
62+
// UpgradeChannel specifies the release channel for major version upgrade checks.
63+
// When empty, only minor updates will be proposed. Allowed values are: stable, lts or specific major.minor version (e.g. 25.8).
64+
// +optional
65+
// +kubebuilder:validation:Pattern=`^(lts|stable|\d+\.\d+)?$`
66+
UpgradeChannel string `json:"upgradeChannel,omitempty"`
67+
68+
// VersionProbeTemplate overrides for the version detection Job.
69+
//
70+
// Deprecated: Keeper version probe Jobs are not used; this field is retained for backward compatibility.
71+
// +optional
72+
VersionProbeTemplate *VersionProbeTemplate `json:"versionProbeTemplate,omitempty"`
6173
}
6274

6375
// WithDefaults sets default values for KeeperClusterSpec fields.
@@ -151,6 +163,16 @@ type KeeperClusterStatus struct {
151163
// ObservedGeneration indicates latest generation observed by controller.
152164
// +operator-sdk:csv:customresourcedefinitions:type=status
153165
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
166+
// Version indicates the version reported by the Keeper server.
167+
// +optional
168+
// +operator-sdk:csv:customresourcedefinitions:type=status
169+
Version string `json:"version,omitempty"`
170+
// VersionProbeRevision is the image hash of the last successful version probe.
171+
//
172+
// Deprecated: Keeper version probe Jobs are not used; this field is retained for backward compatibility.
173+
// +optional
174+
// +operator-sdk:csv:customresourcedefinitions:type=status
175+
VersionProbeRevision string `json:"versionProbeRevision,omitempty"`
154176
}
155177

156178
// KeeperCluster is the Schema for the `keeperclusters` API.
@@ -161,6 +183,7 @@ type KeeperClusterStatus struct {
161183
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message"
162184
// +kubebuilder:printcolumn:name="ReadyReplicas",type="number",JSONPath=".status.readyReplicas"
163185
// +kubebuilder:printcolumn:name="Replicas",type="number",JSONPath=".spec.replicas"
186+
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version"
164187
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
165188
// +operator-sdk:csv:customresourcedefinitions:resources={{Pod,v1}}
166189
// +operator-sdk:csv:customresourcedefinitions:resources={{PersistentVolumeClaim,v1}}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func run() error {
201201
upgradeChecker = upgrade.NewChecker(updater)
202202
}
203203

204-
if err = keeper.SetupWithManager(mgr, zapLogger, nil, env.EnablePDB); err != nil {
204+
if err = keeper.SetupWithManager(mgr, zapLogger, upgradeChecker, nil, env.EnablePDB); err != nil {
205205
return fmt.Errorf("unable to setup KeeperCluster controller: %w", err)
206206
}
207207

config/crd/bases/clickhouse.com_keeperclusters.yaml

Lines changed: 638 additions & 0 deletions
Large diffs are not rendered by default.

config/manifests/bases/clickhouse-operator.clusterserviceversion.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ spec:
8787
displayName: Version Probe Revision
8888
path: versionProbeRevision
8989
version: v1alpha1
90-
- displayName: Keeper Cluster
90+
- description: KeeperCluster is the Schema for the `keeperclusters` API.
91+
displayName: Keeper Cluster
9192
kind: KeeperCluster
9293
name: keeperclusters.clickhouse.com
9394
resources:
@@ -140,6 +141,14 @@ spec:
140141
revision.
141142
displayName: Update Revision
142143
path: updateRevision
144+
- description: Version indicates the version reported by the Keeper server.
145+
displayName: Version
146+
path: version
147+
- description: |-
148+
VersionProbeRevision is the image hash of the last successful version probe.
149+
Deprecated: Keeper version probe Jobs are not used; this field is retained for backward compatibility.
150+
displayName: Version Probe Revision
151+
path: versionProbeRevision
143152
version: v1alpha1
144153
description: |
145154
The ClickHouse Operator is a Kubernetes operator that automates the deployment, configuration, and management of ClickHouse clusters and ClickHouse Keeper clusters on Kubernetes.

dist/chart-cluster/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,12 @@ keeper:
151151
# Configuration parameters for ClickHouse Keeper server.
152152
# settings: {}
153153

154+
# UpgradeChannel specifies the release channel for major version upgrade checks.
155+
# When empty, only minor updates will be proposed. Allowed values are: stable, lts or specific major.minor version (e.g. 25.8).
156+
# upgradeChannel: ""
157+
158+
# VersionProbeTemplate overrides for the version detection Job.
159+
#
160+
# Deprecated: Keeper version probe Jobs are not used; this field is retained for backward compatibility.
161+
# versionProbeTemplate: {}
162+

0 commit comments

Comments
 (0)