Skip to content

Commit

Permalink
fixing linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
srahul3 committed Jun 16, 2023
1 parent 31c1506 commit 9a25cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion control-plane/catalog/to-consul/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ const (
// annotationServiceWeight is the key of the annotation that determines
// the traffic weight of the service which is spanned over multiple k8s cluster.
// e.g. Service `backend` in k8s cluster `A` receives 25% of the traffic
// compared to same `backend` service in k8s cluster `B`
// compared to same `backend` service in k8s cluster `B`.
annotationServiceWeight = "consul.hashicorp.com/service-weight"
)
6 changes: 3 additions & 3 deletions control-plane/catalog/to-consul/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ func (t *ServiceResource) generateRegistrations(key string) {
r.Service.ID = serviceID(r.Service.Service, ip)
r.Service.Address = ip
// Adding information about service weight.
// Overrides the existing weight if present
// Overrides the existing weight if present.
if weight, ok := svc.Annotations[annotationServiceWeight]; ok && weight != "" {
weightI, err := getServiceWeight(weight)
if err == nil {
Expand Down Expand Up @@ -561,7 +561,7 @@ func (t *ServiceResource) generateRegistrations(key string) {
r.Service.Address = addr

// Adding information about service weight.
// Overrides the existing weight if present
// Overrides the existing weight if present.
if weight, ok := svc.Annotations[annotationServiceWeight]; ok && weight != "" {
weightI, err := getServiceWeight(weight)
if err == nil {
Expand Down Expand Up @@ -1028,7 +1028,7 @@ func consulHealthCheckID(k8sNS string, serviceID string) string {

// Calculates the passing service weight.
func getServiceWeight(weight string) (int, error) {
// error validation if the input param is a number
// error validation if the input param is a number.
weightI, err := strconv.Atoi(weight)
if err != nil {
return -1, err
Expand Down

0 comments on commit 9a25cbf

Please sign in to comment.