Skip to content

Commit

Permalink
Fix App Labels for Controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Vaseekaran committed Dec 5, 2024
1 parent 5aa37f3 commit a3cf8a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 10 additions & 2 deletions api/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ func MergeLabels(l ...map[string]string) map[string]string {

// LabelsForKafka returns the labels for selecting the resources
// belonging to the given kafka CR name.
func LabelsForKafka(name string) map[string]string {
return map[string]string{"app": "kafka", "kafka_cr": name}
func LabelsForKafka(name string, isControllerOnly bool) map[string]string {
if isControllerOnly {
return map[string]string{"app": "kafka_controller", "kafka_cr": name}
} else {
return map[string]string{"app": "kafka", "kafka_cr": name}
}
}

func LabelsForKafkaController(name string) map[string]string {
return map[string]string{"app": "kafka_controller", "kafk-cr": name}
}

// StringSliceContains returns true if list contains s
Expand Down
12 changes: 6 additions & 6 deletions api/v1beta1/kafkacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const (
ProcessRolesKey = "processRoles"

// DefaultCruiseControlImage is the default CC image used when users don't specify it in CruiseControlConfig.Image
DefaultCruiseControlImage = "ghcr.io/banzaicloud/cruise-control:2.5.123"
DefaultCruiseControlImage = "docker-pipeline-upstream-mirror.dr-uw2.adobeitc.com/adobe/cruise-control:2.5.133-adbe-20240313"

// DefaultKafkaImage is the default Kafka image used when users don't specify it in KafkaClusterSpec.ClusterImage
DefaultKafkaImage = "ghcr.io/banzaicloud/kafka:2.13-3.4.1"
DefaultKafkaImage = "docker-pipeline-upstream-mirror.dr-uw2.adobeitc.com/adobe/kafka:2.13-3.7.0"

// ControllerNodeProcessRole represents the node is a controller node
ControllerNodeProcessRole = "controller"
Expand Down Expand Up @@ -103,7 +103,7 @@ const (
/* Cruise Control Config */

// CruiseControlDeployment.spec.template.spec.container["%s-cruisecontrol"].image
defaultCruiseControlImage = "ghcr.io/banzaicloud/cruise-control:2.5.123"
defaultCruiseControlImage = "docker-pipeline-upstream-mirror.dr-uw2.adobeitc.com/adobe/cruise-control:2.5.133-adbe-20240313"

// CruiseControlDeployment.spec.template.spec.container["%s-cruisecontrol"].resources
defaultCruiseControlRequestResourceCpu = "200m"
Expand All @@ -119,7 +119,7 @@ const (
defaultKafkaClusterK8sClusterDomain = "cluster.local"

// KafkaBroker.spec.container["kafka"].image
defaultKafkaImage = "ghcr.io/banzaicloud/kafka:2.13-3.4.1"
defaultKafkaImage = "docker-pipeline-upstream-mirror.dr-uw2.adobeitc.com/adobe/kafka:2.13-3.7.0"

/* Istio Ingress Config */

Expand Down Expand Up @@ -1095,10 +1095,10 @@ func (bConfig *BrokerConfig) GetBrokerAnnotations() map[string]string {
}

// GetBrokerLabels returns the labels that are applied to broker pods
func (bConfig *BrokerConfig) GetBrokerLabels(kafkaClusterName string, brokerId int32) map[string]string {
func (bConfig *BrokerConfig) GetBrokerLabels(kafkaClusterName string, brokerId int32, isControllerOnly bool) map[string]string {
return util.MergeLabels(
bConfig.BrokerLabels,
util.LabelsForKafka(kafkaClusterName),
util.LabelsForKafka(kafkaClusterName, isControllerOnly),
map[string]string{
BrokerIdLabelKey: fmt.Sprintf("%d", brokerId),
ProcessRolesKey: strings.Join(bConfig.Roles, "_"),
Expand Down

0 comments on commit a3cf8a5

Please sign in to comment.