From e15539495c7dbe2c76168a1868c44912a1f6408f Mon Sep 17 00:00:00 2001 From: tengu-alt Date: Wed, 28 Feb 2024 11:20:39 +0200 Subject: [PATCH] total nodes number displaying for clusters was implemented --- .secrets.baseline | 78 ++++++------------- apis/clusters/v1beta1/cadence_types.go | 15 ++++ apis/clusters/v1beta1/cassandra_types.go | 16 ++++ apis/clusters/v1beta1/generic_status.go | 1 + apis/clusters/v1beta1/kafka_types.go | 17 ++++ apis/clusters/v1beta1/kafkaconnect_types.go | 17 ++++ apis/clusters/v1beta1/opensearch_types.go | 15 ++++ apis/clusters/v1beta1/postgresql_types.go | 15 ++++ apis/clusters/v1beta1/redis_types.go | 16 ++++ apis/clusters/v1beta1/structs.go | 1 + apis/clusters/v1beta1/zookeeper_types.go | 17 ++++ .../clusters.instaclustr.com_cadences.yaml | 5 ++ .../clusters.instaclustr.com_cassandras.yaml | 5 ++ ...lusters.instaclustr.com_kafkaconnects.yaml | 5 ++ .../clusters.instaclustr.com_kafkas.yaml | 5 ++ ...clusters.instaclustr.com_opensearches.yaml | 5 ++ .../clusters.instaclustr.com_postgresqls.yaml | 5 ++ .../bases/clusters.instaclustr.com_redis.yaml | 5 ++ .../clusters.instaclustr.com_zookeepers.yaml | 5 ++ .../samples/clusters_v1beta1_cassandra.yaml | 4 +- .../samples/clusters_v1beta1_postgresql.yaml | 10 +-- 21 files changed, 201 insertions(+), 61 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 8cfeef9ca..8c2f2d68e 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -169,14 +169,14 @@ "filename": "apis/clusters/v1beta1/cadence_types.go", "hashed_secret": "a242f4a16b957f7ff99eb24e189e94d270d2348b", "is_verified": false, - "line_number": 292 + "line_number": 293 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/cadence_types.go", "hashed_secret": "a57ce131bd944bdf8ba2f2f93e179dc416ed0315", "is_verified": false, - "line_number": 301 + "line_number": 302 } ], "apis/clusters/v1beta1/cassandra_types.go": [ @@ -185,21 +185,21 @@ "filename": "apis/clusters/v1beta1/cassandra_types.go", "hashed_secret": "331cc743251c3b9504229de4d139c539da121a33", "is_verified": false, - "line_number": 238 + "line_number": 253 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/cassandra_types.go", "hashed_secret": "0ad8d7005e084d4f028a4277b73c6fab24269c17", "is_verified": false, - "line_number": 324 + "line_number": 340 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/cassandra_types.go", "hashed_secret": "e0a46b27231f798fe22dc4d5d82b5feeb5dcf085", "is_verified": false, - "line_number": 411 + "line_number": 427 } ], "apis/clusters/v1beta1/cassandra_webhook.go": [ @@ -217,14 +217,14 @@ "filename": "apis/clusters/v1beta1/kafka_types.go", "hashed_secret": "964c67cddfe8e6707157152dcf319126502199dc", "is_verified": false, - "line_number": 271 + "line_number": 274 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafka_types.go", "hashed_secret": "589a0ad3cc6bc886a00c46a22e5065c48bd8e1b2", "is_verified": false, - "line_number": 417 + "line_number": 434 } ], "apis/clusters/v1beta1/kafkaconnect_types.go": [ @@ -233,84 +233,70 @@ "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "46fe9b29395041087f91b33bd8c5c6177cd42fd1", "is_verified": false, - "line_number": 253 + "line_number": 268 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "4b3af1508421e2fa591c5b260c36dd06fdd872a5", "is_verified": false, - "line_number": 297 + "line_number": 312 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "cf45830dd81b7e1a8b5ffbc2d95b112771524117", "is_verified": false, - "line_number": 307 + "line_number": 322 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "138905ac46675150bf790088ec56b2efc6a64697", "is_verified": false, - "line_number": 318 + "line_number": 333 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "3948059919ffeee8ecc42149cb386f43d2f06f74", "is_verified": false, - "line_number": 323 + "line_number": 338 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "87f1180476a944c4162d1af55efedc8f3e3b609c", "is_verified": false, - "line_number": 474 + "line_number": 489 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "f0f06c9167ce61a586749bb183ac6a3756dd6010", "is_verified": false, - "line_number": 484 + "line_number": 499 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "2042128e13ef5ede4af44271160c72f64564c632", "is_verified": false, - "line_number": 495 + "line_number": 510 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "82dc9ca8ba09262ce948227aeb5d9db8084eeb5d", "is_verified": false, - "line_number": 500 + "line_number": 515 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", "hashed_secret": "5f915325aef923cdc945f639f14c2f854b4214d6", "is_verified": false, - "line_number": 524 - }, - { - "type": "Secret Keyword", - "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", - "hashed_secret": "5ffe533b830f08a0326348a9160afafc8ada44db", - "is_verified": false, - "line_number": 557 - }, - { - "type": "Secret Keyword", - "filename": "apis/clusters/v1beta1/kafkaconnect_types.go", - "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", - "is_verified": false, - "line_number": 562 + "line_number": 539 } ], "apis/clusters/v1beta1/postgresql_types.go": [ @@ -319,21 +305,21 @@ "filename": "apis/clusters/v1beta1/postgresql_types.go", "hashed_secret": "5ffe533b830f08a0326348a9160afafc8ada44db", "is_verified": false, - "line_number": 370 + "line_number": 371 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/postgresql_types.go", "hashed_secret": "a3d7d4a96d18c8fc5a1cf9c9c01c45b4690b4008", "is_verified": false, - "line_number": 376 + "line_number": 377 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/postgresql_types.go", "hashed_secret": "a57ce131bd944bdf8ba2f2f93e179dc416ed0315", "is_verified": false, - "line_number": 425 + "line_number": 440 } ], "apis/clusters/v1beta1/redis_types.go": [ @@ -342,21 +328,21 @@ "filename": "apis/clusters/v1beta1/redis_types.go", "hashed_secret": "bc1c5ae5fd4a238d86261f422e62c489de408c22", "is_verified": false, - "line_number": 169 + "line_number": 171 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/redis_types.go", "hashed_secret": "d62d56668a8c859e768e8250ed2fb690d03cead3", "is_verified": false, - "line_number": 225 + "line_number": 227 }, { "type": "Secret Keyword", "filename": "apis/clusters/v1beta1/redis_types.go", "hashed_secret": "d0e8e6fc5dce4d2b452e344ae41900b566ac01d1", "is_verified": false, - "line_number": 270 + "line_number": 272 } ], "apis/clusters/v1beta1/redis_webhook.go": [ @@ -368,22 +354,6 @@ "line_number": 322 } ], - "apis/clusters/v1beta1/zookeeper_types.go": [ - { - "type": "Secret Keyword", - "filename": "apis/clusters/v1beta1/zookeeper_types.go", - "hashed_secret": "5ffe533b830f08a0326348a9160afafc8ada44db", - "is_verified": false, - "line_number": 235 - }, - { - "type": "Secret Keyword", - "filename": "apis/clusters/v1beta1/zookeeper_types.go", - "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", - "is_verified": false, - "line_number": 240 - } - ], "apis/clusters/v1beta1/zz_generated.deepcopy.go": [ { "type": "Secret Keyword", @@ -1146,5 +1116,5 @@ } ] }, - "generated_at": "2024-02-26T13:44:13Z" + "generated_at": "2024-02-28T09:07:57Z" } diff --git a/apis/clusters/v1beta1/cadence_types.go b/apis/clusters/v1beta1/cadence_types.go index 2591faf80..448d6c853 100644 --- a/apis/clusters/v1beta1/cadence_types.go +++ b/apis/clusters/v1beta1/cadence_types.go @@ -150,6 +150,7 @@ type CadenceDataCentreStatus struct { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // Cadence is the Schema for the cadences API type Cadence struct { @@ -412,6 +413,20 @@ func (cs *CadenceStatus) FromInstAPI(instaModel *models.CadenceCluster) { cs.GenericStatus.FromInstAPI(&instaModel.GenericClusterFields) cs.targetSecondaryFromInstAPI(instaModel.TargetSecondaryCadence) cs.DCsFromInstAPI(instaModel.DataCentres) + cs.GetNodeCount() +} + +func (cs *CadenceStatus) GetNodeCount() { + var total, running int + for _, dc := range cs.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + cs.NodeCount = fmt.Sprintf("%v/%v", running, total) } func (cs *CadenceStatus) targetSecondaryFromInstAPI(instaModels []*models.CadenceDependencyTarget) { diff --git a/apis/clusters/v1beta1/cassandra_types.go b/apis/clusters/v1beta1/cassandra_types.go index 0b14dcbe6..c4ffcea1b 100644 --- a/apis/clusters/v1beta1/cassandra_types.go +++ b/apis/clusters/v1beta1/cassandra_types.go @@ -17,6 +17,7 @@ limitations under the License. package v1beta1 import ( + "fmt" "strconv" k8scorev1 "k8s.io/api/core/v1" @@ -113,6 +114,19 @@ func (s *CassandraStatus) DataCentresEqual(o *CassandraStatus) bool { return true } +func (cs *CassandraStatus) GetNodeCount() { + var total, running int + for _, dc := range cs.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + cs.NodeCount = fmt.Sprintf("%v/%v", running, total) +} + type CassandraDataCentre struct { GenericDataCentreSpec `json:",inline"` @@ -246,6 +260,7 @@ func (c *CassandraSpec) IsEqual(o *CassandraSpec) bool { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // Cassandra is the Schema for the cassandras API type Cassandra struct { @@ -470,6 +485,7 @@ func (cs *CassandraSpec) AreDCsEqual(dcs []*CassandraDataCentre) bool { func (cs *CassandraStatus) FromInstAPI(instModel *models.CassandraCluster) { cs.GenericStatus.FromInstAPI(&instModel.GenericClusterFields) cs.dcsFromInstAPI(instModel.DataCentres) + cs.GetNodeCount() } func (cs *CassandraStatus) dcsFromInstAPI(instModels []*models.CassandraDataCentre) { diff --git a/apis/clusters/v1beta1/generic_status.go b/apis/clusters/v1beta1/generic_status.go index 35b674a47..c0b5e5300 100644 --- a/apis/clusters/v1beta1/generic_status.go +++ b/apis/clusters/v1beta1/generic_status.go @@ -11,6 +11,7 @@ type GenericStatus struct { ID string `json:"id,omitempty"` State string `json:"state,omitempty"` CurrentClusterOperationStatus string `json:"currentClusterOperationStatus,omitempty"` + NodeCount string `json:"nodeCount,omitempty"` MaintenanceEvents []*v1beta1.ClusteredMaintenanceEventStatus `json:"maintenanceEvents,omitempty"` } diff --git a/apis/clusters/v1beta1/kafka_types.go b/apis/clusters/v1beta1/kafka_types.go index 9b42c0b57..d368eb8b2 100644 --- a/apis/clusters/v1beta1/kafka_types.go +++ b/apis/clusters/v1beta1/kafka_types.go @@ -17,6 +17,8 @@ limitations under the License. package v1beta1 import ( + "fmt" + k8scorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -185,6 +187,7 @@ func (s *KafkaStatus) ToOnPremises() ClusterStatus { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // Kafka is the Schema for the kafkas API type Kafka struct { @@ -377,6 +380,20 @@ func (ks *KafkaSpec) FromInstAPI(instaModel *models.KafkaCluster) { func (ks *KafkaStatus) FromInstAPI(instaModel *models.KafkaCluster) { ks.GenericStatus.FromInstAPI(&instaModel.GenericClusterFields) ks.DCsFromInstAPI(instaModel.DataCentres) + ks.GetNodeCount() +} + +func (ks *KafkaStatus) GetNodeCount() { + var total, running int + for _, dc := range ks.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + ks.NodeCount = fmt.Sprintf("%v/%v", running, total) } func (ks *KafkaSpec) DCsFromInstAPI(instaModels []*models.KafkaDataCentre) { diff --git a/apis/clusters/v1beta1/kafkaconnect_types.go b/apis/clusters/v1beta1/kafkaconnect_types.go index a01f6e3e0..990e4cbc9 100644 --- a/apis/clusters/v1beta1/kafkaconnect_types.go +++ b/apis/clusters/v1beta1/kafkaconnect_types.go @@ -17,6 +17,8 @@ limitations under the License. package v1beta1 import ( + "fmt" + k8scorev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -141,6 +143,7 @@ type KafkaConnectDataCentreStatus struct { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // KafkaConnect is the Schema for the kafkaconnects API type KafkaConnect struct { @@ -207,6 +210,20 @@ func (ks *KafkaConnectSpec) FromInstAPI(instaModel *models.KafkaConnectCluster) func (ks *KafkaConnectStatus) FromInstAPI(instaModel *models.KafkaConnectCluster) { ks.GenericStatus.FromInstAPI(&instaModel.GenericClusterFields) ks.DCsFromInstAPI(instaModel.DataCentres) + ks.GetNodeCount() +} + +func (ks *KafkaConnectStatus) GetNodeCount() { + var total, running int + for _, dc := range ks.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + ks.NodeCount = fmt.Sprintf("%v/%v", running, total) } func (ks *KafkaConnectSpec) DCsFromInstAPI(instaModels []*models.KafkaConnectDataCentre) { diff --git a/apis/clusters/v1beta1/opensearch_types.go b/apis/clusters/v1beta1/opensearch_types.go index 97e83b317..4adfa437e 100644 --- a/apis/clusters/v1beta1/opensearch_types.go +++ b/apis/clusters/v1beta1/opensearch_types.go @@ -409,6 +409,20 @@ func (oss *OpenSearchStatus) FromInstAPI(instaModel *models.OpenSearchCluster) { d.FromInstAPI(dc) oss.DataCentres = append(oss.DataCentres, d) } + oss.GetNodeCount() +} + +func (oss *OpenSearchStatus) GetNodeCount() { + var total, running int + for _, dc := range oss.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + oss.NodeCount = fmt.Sprintf("%v/%v", running, total) } type OpenSearchDataCentreStatus struct { @@ -522,6 +536,7 @@ func (oss *OpenSearchStatus) Equals(o *OpenSearchStatus) bool { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // OpenSearch is the Schema for the opensearches API type OpenSearch struct { diff --git a/apis/clusters/v1beta1/postgresql_types.go b/apis/clusters/v1beta1/postgresql_types.go index 62c34ec8c..a928026e0 100644 --- a/apis/clusters/v1beta1/postgresql_types.go +++ b/apis/clusters/v1beta1/postgresql_types.go @@ -113,6 +113,7 @@ type PgDataCentreStatus struct { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // PostgreSQL is the Schema for the postgresqls API type PostgreSQL struct { @@ -403,6 +404,20 @@ func (pgs *PgSpec) DCsFromInstAPI(instaModels []*models.PGDataCentre) { func (pgs *PgStatus) FromInstAPI(instaModel *models.PGCluster) { pgs.GenericStatus.FromInstAPI(&instaModel.GenericClusterFields) pgs.DCsFromInstAPI(instaModel.DataCentres) + pgs.GetNodeCount() +} + +func (pgs *PgStatus) GetNodeCount() { + var total, running int + for _, dc := range pgs.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + pgs.NodeCount = fmt.Sprintf("%v/%v", running, total) } func (pgs *PgStatus) DCsFromInstAPI(instaModels []*models.PGDataCentre) { diff --git a/apis/clusters/v1beta1/redis_types.go b/apis/clusters/v1beta1/redis_types.go index c3828e765..ef31ce1c8 100644 --- a/apis/clusters/v1beta1/redis_types.go +++ b/apis/clusters/v1beta1/redis_types.go @@ -17,6 +17,7 @@ limitations under the License. package v1beta1 import ( + "fmt" "strconv" k8scorev1 "k8s.io/api/core/v1" @@ -103,6 +104,7 @@ type RedisStatus struct { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // Redis is the Schema for the redis API type Redis struct { @@ -296,6 +298,20 @@ func (rdc *RedisDataCentre) FromInstAPI(instaModel *models.RedisDataCentre) { func (rs *RedisStatus) FromInstAPI(instaModel *models.RedisCluster) { rs.GenericStatus.FromInstAPI(&instaModel.GenericClusterFields) rs.DCsFromInstAPI(instaModel.DataCentres) + rs.GetNodeCount() +} + +func (rs *RedisStatus) GetNodeCount() { + var total, running int + for _, dc := range rs.DataCentres { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + rs.NodeCount = fmt.Sprintf("%v/%v", running, total) } func (rs *RedisStatus) DCsFromInstAPI(instaModels []*models.RedisDataCentre) { diff --git a/apis/clusters/v1beta1/structs.go b/apis/clusters/v1beta1/structs.go index 1ee67ea71..164758108 100644 --- a/apis/clusters/v1beta1/structs.go +++ b/apis/clusters/v1beta1/structs.go @@ -103,6 +103,7 @@ type ClusterStatus struct { Options *Options `json:"options,omitempty"` CurrentClusterOperationStatus string `json:"currentClusterOperationStatus,omitempty"` MaintenanceEvents []*clusterresource.ClusteredMaintenanceEventStatus `json:"maintenanceEvents,omitempty"` + NodeCount string `json:"nodeCount,omitempty"` } type ClusteredMaintenanceEvent struct { diff --git a/apis/clusters/v1beta1/zookeeper_types.go b/apis/clusters/v1beta1/zookeeper_types.go index d5fb93258..b5b7d1a9c 100644 --- a/apis/clusters/v1beta1/zookeeper_types.go +++ b/apis/clusters/v1beta1/zookeeper_types.go @@ -18,6 +18,8 @@ package v1beta1 import ( "encoding/json" + "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -49,6 +51,7 @@ type ZookeeperStatus struct { //+kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" //+kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.id" //+kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +//+kubebuilder:printcolumn:name="Node count",type="string",JSONPath=".status.nodeCount" // Zookeeper is the Schema for the zookeepers API type Zookeeper struct { @@ -135,10 +138,24 @@ func (zs *ZookeeperStatus) FromInstAPI(iZook *models.ZookeeperCluster) Zookeeper DataCentres: zs.DCsFromInstAPI(iZook.DataCentres), CurrentClusterOperationStatus: iZook.CurrentClusterOperationStatus, MaintenanceEvents: zs.MaintenanceEvents, + NodeCount: zs.GetNodeCount(iZook.DataCentres), }, } } +func (zs *ZookeeperStatus) GetNodeCount(dcs []*models.ZookeeperDataCentre) string { + var total, running int + for _, dc := range dcs { + for _, node := range dc.Nodes { + total++ + if node.Status == models.RunningStatus { + running++ + } + } + } + return fmt.Sprintf("%v/%v", running, total) +} + func (zs *ZookeeperSpec) DCsFromInstAPI(iDCs []*models.ZookeeperDataCentre) (dcs []*ZookeeperDataCentre) { for _, iDC := range iDCs { dcs = append(dcs, &ZookeeperDataCentre{ diff --git a/config/crd/bases/clusters.instaclustr.com_cadences.yaml b/config/crd/bases/clusters.instaclustr.com_cadences.yaml index 24f8c18ae..08c1a7299 100644 --- a/config/crd/bases/clusters.instaclustr.com_cadences.yaml +++ b/config/crd/bases/clusters.instaclustr.com_cadences.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -589,6 +592,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string targetSecondaryCadence: diff --git a/config/crd/bases/clusters.instaclustr.com_cassandras.yaml b/config/crd/bases/clusters.instaclustr.com_cassandras.yaml index 78f78d177..54bb7d321 100644 --- a/config/crd/bases/clusters.instaclustr.com_cassandras.yaml +++ b/config/crd/bases/clusters.instaclustr.com_cassandras.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -548,6 +551,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string type: object diff --git a/config/crd/bases/clusters.instaclustr.com_kafkaconnects.yaml b/config/crd/bases/clusters.instaclustr.com_kafkaconnects.yaml index 2ad0321c3..1efa3c34b 100644 --- a/config/crd/bases/clusters.instaclustr.com_kafkaconnects.yaml +++ b/config/crd/bases/clusters.instaclustr.com_kafkaconnects.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -554,6 +557,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string type: object diff --git a/config/crd/bases/clusters.instaclustr.com_kafkas.yaml b/config/crd/bases/clusters.instaclustr.com_kafkas.yaml index faf584408..24bb40720 100644 --- a/config/crd/bases/clusters.instaclustr.com_kafkas.yaml +++ b/config/crd/bases/clusters.instaclustr.com_kafkas.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -553,6 +556,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string type: object diff --git a/config/crd/bases/clusters.instaclustr.com_opensearches.yaml b/config/crd/bases/clusters.instaclustr.com_opensearches.yaml index 1688290ab..605e47edc 100644 --- a/config/crd/bases/clusters.instaclustr.com_opensearches.yaml +++ b/config/crd/bases/clusters.instaclustr.com_opensearches.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -555,6 +558,8 @@ spec: type: array type: object type: array + nodeCount: + type: string privateEndpoint: type: string publicEndpoint: diff --git a/config/crd/bases/clusters.instaclustr.com_postgresqls.yaml b/config/crd/bases/clusters.instaclustr.com_postgresqls.yaml index 0974b2c51..b23ec1e80 100644 --- a/config/crd/bases/clusters.instaclustr.com_postgresqls.yaml +++ b/config/crd/bases/clusters.instaclustr.com_postgresqls.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -510,6 +513,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string userRefs: diff --git a/config/crd/bases/clusters.instaclustr.com_redis.yaml b/config/crd/bases/clusters.instaclustr.com_redis.yaml index 757936350..b9dd7cc62 100644 --- a/config/crd/bases/clusters.instaclustr.com_redis.yaml +++ b/config/crd/bases/clusters.instaclustr.com_redis.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -518,6 +521,8 @@ spec: type: array type: object type: array + nodeCount: + type: string state: type: string type: object diff --git a/config/crd/bases/clusters.instaclustr.com_zookeepers.yaml b/config/crd/bases/clusters.instaclustr.com_zookeepers.yaml index 5118677e6..d0f887e7b 100644 --- a/config/crd/bases/clusters.instaclustr.com_zookeepers.yaml +++ b/config/crd/bases/clusters.instaclustr.com_zookeepers.yaml @@ -28,6 +28,9 @@ spec: - jsonPath: .status.state name: State type: string + - jsonPath: .status.nodeCount + name: Node count + type: string name: v1beta1 schema: openAPIV3Schema: @@ -347,6 +350,8 @@ spec: type: array type: object type: array + nodeCount: + type: string options: properties: dataNodeSize: diff --git a/config/samples/clusters_v1beta1_cassandra.yaml b/config/samples/clusters_v1beta1_cassandra.yaml index 43adb8b72..57a663df3 100644 --- a/config/samples/clusters_v1beta1_cassandra.yaml +++ b/config/samples/clusters_v1beta1_cassandra.yaml @@ -3,8 +3,8 @@ kind: Cassandra metadata: name: cassandra-cluster spec: - name: "example-cassandra" #(immutable) - version: "4.1.3" #(immutable) + name: "username-cassandra" #(immutable) + version: "4.1.13" #(immutable) privateNetwork: false #(immutable) dataCentres: - name: "AWS_cassandra" #(mutable) diff --git a/config/samples/clusters_v1beta1_postgresql.yaml b/config/samples/clusters_v1beta1_postgresql.yaml index 4b78bdc61..cc2aa792c 100644 --- a/config/samples/clusters_v1beta1_postgresql.yaml +++ b/config/samples/clusters_v1beta1_postgresql.yaml @@ -14,7 +14,7 @@ spec: cloudProvider: "AWS_VPC" # nodeSize: "PGS-DEV-t4g.medium-30" nodeSize: "PGS-DEV-t4g.small-5" - nodesNumber: 2 + numberOfNodes: 2 clientEncryption: false name: "testDC1" intraDataCentreReplication: @@ -48,11 +48,11 @@ spec: # userRefs: # - namespace: default # name: postgresqluser-sample - privateNetworkCluster: false + privateNetwork: false synchronousModeStrict: false - extensions: - - name: PgVector - enabled: true +# extensions: +# - name: PgVector +# enabled: true # resizeSettings: # - notifySupportContacts: false # concurrency: 1 \ No newline at end of file