Skip to content

Commit

Permalink
Fix some consts visibility in kafkacluster_types.go (#1053)
Browse files Browse the repository at this point in the history
* Eliminate hardcoded values + move them at the beginning of file

* Added some comments to defaults

* Update pod.go

* Apply suggestions from code review

Co-authored-by: Darren Lau <[email protected]>

* Fix visibility of some consts

* Build fix

---------

Co-authored-by: Darren Lau <[email protected]>
  • Loading branch information
szykes and panyuenlau authored Aug 28, 2023
1 parent da8a72b commit 6cf4c4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/v1beta1/kafkacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const (
// KafkaClusterDeployment.spec.replicas
defaultEnvoyReplicas = 1
// KafkaClusterDeployment.spec.template.spec.container["envoy"].port["tcp-admin"].containerPort
defaultEnvoyAdminPort = 8081
DefaultEnvoyAdminPort = 8081
// KafkaClusterDeployment.spec.template.spec.container["envoy"].port["tcp-health"].containerPort
defaultEnvoyHealthCheckPort = 8080
DefaultEnvoyHealthCheckPort = 8080
// KafkaClusterDeployment.spec.template.spec.container["envoy"].args
defaultEnvoyConcurrency = 0

Expand Down Expand Up @@ -1120,15 +1120,15 @@ func (eConfig *EnvoyConfig) GetEnvoyAdminPort() int32 {
if eConfig.AdminPort != nil {
return *eConfig.AdminPort
}
return defaultEnvoyAdminPort
return DefaultEnvoyAdminPort
}

// GetEnvoyHealthCheckPort returns the envoy admin port
func (eConfig *EnvoyConfig) GetEnvoyHealthCheckPort() int32 {
if eConfig.HealthCheckPort != nil {
return *eConfig.HealthCheckPort
}
return defaultEnvoyHealthCheckPort
return DefaultEnvoyHealthCheckPort
}

// GetCCImage returns the used Cruise Control image
Expand Down

0 comments on commit 6cf4c4e

Please sign in to comment.