Skip to content

Commit

Permalink
Fix bug with defining connect healthcheck
Browse files Browse the repository at this point in the history
Previously we were setting the alias_service field of alias checks to
the service name instead of the service id. This check would then pass
because Consul would consider an alias for a non-existent service id to
be okay. With hashicorp/consul#7384, now the
check will fail if the service id doesn't exist and so those connect
services will be considered unhealthy and be unroutable.
  • Loading branch information
lkysow committed Jun 4, 2020
1 parent 8267732 commit b9404c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion connect-inject/container_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "{{ .ServiceName }}"
alias_service = "${SERVICE_ID}"
}
}
Expand Down
26 changes: 13 additions & 13 deletions connect-inject/container_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -132,7 +132,7 @@ cp /bin/consul /consul/connect-inject/consul`,
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -304,7 +304,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -350,7 +350,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -396,7 +396,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -443,7 +443,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -502,7 +502,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -635,7 +635,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -703,7 +703,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -772,7 +772,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -850,7 +850,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -928,7 +928,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down Expand Up @@ -1010,7 +1010,7 @@ services {
checks {
name = "Destination Alias"
alias_service = "web"
alias_service = "${SERVICE_ID}"
}
}
Expand Down

0 comments on commit b9404c2

Please sign in to comment.