mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
fix: BanzaiCloud KafkaCluster healthcheck to return Progressing during rolling update (#17994)
* Update ClusterRollingUpgrading state to always be in Progressing state regardless of broker status Signed-off-by: Ha Van <musubi7726@gmail.com> * Retrigger CI pipeline Signed-off-by: Ha Van <musubi7726@gmail.com> --------- Signed-off-by: Ha Van <musubi7726@gmail.com> Co-authored-by: Dan Garfield <dan@codefresh.io>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
local health_status = {}
|
||||
if obj.status ~= nil then
|
||||
if obj.status.state == "ClusterRollingUpgrading" then
|
||||
health_status.message = "Kafka Cluster is Rolling Upgrading."
|
||||
health_status.status = "Progressing"
|
||||
return health_status
|
||||
end
|
||||
if obj.status.brokersState ~= nil then
|
||||
local numberBrokers = 0
|
||||
local healthyBrokers = 0
|
||||
@@ -23,11 +28,6 @@ if obj.status ~= nil then
|
||||
health_status.status = "Progressing"
|
||||
return health_status
|
||||
end
|
||||
if obj.status.state == "ClusterRollingUpgrading" then
|
||||
health_status.message = "Kafka Cluster is Rolling Upgrading."
|
||||
health_status.status = "Progressing"
|
||||
return health_status
|
||||
end
|
||||
end
|
||||
else
|
||||
health_status.message = "Broker Config is out of Sync or CruiseControlState is not Ready"
|
||||
@@ -38,4 +38,4 @@ if obj.status ~= nil then
|
||||
end
|
||||
health_status.status = "Progressing"
|
||||
health_status.message = "Waiting for KafkaCluster"
|
||||
return health_status
|
||||
return health_status
|
||||
|
||||
@@ -7,6 +7,10 @@ tests:
|
||||
status: Progressing
|
||||
message: "Waiting for KafkaCluster"
|
||||
inputPath: testdata/updating.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Kafka Cluster is Rolling Upgrading."
|
||||
inputPath: testdata/rollingUpgrade.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Broker Config is out of Sync or CruiseControlState is not Ready"
|
||||
@@ -14,4 +18,4 @@ tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "Kafka Brokers, CruiseControl and cluster are in Healthy State."
|
||||
inputPath: testdata/healthy.yaml
|
||||
inputPath: testdata/healthy.yaml
|
||||
|
||||
48
resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/rollingUpgrade.yaml
vendored
Normal file
48
resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/rollingUpgrade.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: kafka.banzaicloud.io/v1beta1
|
||||
kind: KafkaCluster
|
||||
metadata:
|
||||
finalizers:
|
||||
- finalizer.kafkaclusters.kafka.banzaicloud.io
|
||||
- topics.kafkaclusters.kafka.banzaicloud.io
|
||||
- users.kafkaclusters.kafka.banzaicloud.io
|
||||
generation: 4
|
||||
labels:
|
||||
argocd.argoproj.io/instance: kafka-cluster
|
||||
controller-tools.k8s.io: "1.0"
|
||||
name: kafkacluster
|
||||
namespace: kafka
|
||||
name: kafkacluster
|
||||
namespace: kafka
|
||||
resourceVersion: "31935335"
|
||||
selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster
|
||||
uid: c6affef0-651d-44c7-8bff-638961517c8d
|
||||
spec: {}
|
||||
status:
|
||||
alertCount: 0
|
||||
brokersState:
|
||||
"0":
|
||||
configurationState: ConfigInSync
|
||||
gracefulActionState:
|
||||
cruiseControlState: GracefulUpscaleSucceeded
|
||||
errorMessage: CruiseControlTopicReady
|
||||
rackAwarenessState: |
|
||||
broker.rack=us-east-1,us-east-1c
|
||||
"1":
|
||||
configurationState: ConfigInSync
|
||||
gracefulActionState:
|
||||
cruiseControlState: GracefulUpscaleSucceeded
|
||||
errorMessage: CruiseControlTopicReady
|
||||
rackAwarenessState: |
|
||||
broker.rack=us-east-1,us-east-1b
|
||||
"2":
|
||||
configurationState: ConfigOutOfSync
|
||||
gracefulActionState:
|
||||
cruiseControlState: GracefulUpscaleSucceeded
|
||||
errorMessage: CruiseControlTopicReady
|
||||
rackAwarenessState: |
|
||||
broker.rack=us-east-1,us-east-1a
|
||||
cruiseControlTopicStatus: CruiseControlTopicReady
|
||||
rollingUpgradeStatus:
|
||||
errorCount: 0
|
||||
lastSuccess: ""
|
||||
state: ClusterRollingUpgrading
|
||||
Reference in New Issue
Block a user