github.com/argoproj/argo-cd/v3@v3.2.1/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health.lua (about)

     1  local health_status = {}
     2  if obj.status ~= nil then
     3    if obj.status.state == "ClusterRollingUpgrading" then
     4      health_status.message = "Kafka Cluster is Rolling Upgrading."
     5      health_status.status = "Progressing"
     6      return health_status
     7    end
     8    if obj.status.brokersState ~= nil then
     9      local numberBrokers = 0
    10      local healthyBrokers = 0
    11      for _, broker in pairs(obj.status.brokersState) do
    12        numberBrokers = numberBrokers + 1
    13        if broker.configurationState == "ConfigInSync" then
    14          if broker.gracefulActionState.cruiseControlState == "GracefulUpscaleSucceeded" or broker.gracefulActionState.cruiseControlState == "GracefulDownscaleSucceeded" then
    15            healthyBrokers = healthyBrokers + 1
    16          end
    17        end
    18      end
    19      if numberBrokers == healthyBrokers then
    20        if obj.status.cruiseControlTopicStatus == "CruiseControlTopicReady" and obj.status.state == "ClusterRunning" then
    21          health_status.message = "Kafka Brokers, CruiseControl and cluster are in Healthy State."
    22          health_status.status = "Healthy"
    23          return health_status
    24        end
    25        if obj.status.cruiseControlTopicStatus == "CruiseControlTopicNotReady" or obj.status.cruiseControlTopicStatus == nil then
    26          if obj.status.state == "ClusterReconciling" then
    27            health_status.message = "Kafka Cluster is Reconciling."
    28            health_status.status = "Progressing"
    29            return health_status
    30          end
    31        end
    32      else
    33        health_status.message = "Broker Config is out of Sync or CruiseControlState is not Ready"
    34        health_status.status = "Degraded"
    35        return health_status
    36      end
    37    end
    38  end
    39  health_status.status = "Progressing"
    40  health_status.message = "Waiting for KafkaCluster"
    41  return health_status