Skip to content

Commit

Permalink
Add changes from Iryna's review.
Browse files Browse the repository at this point in the history
- Improve changelog wording.
- Make useProxyHealthCheck check for all truthy values.
  • Loading branch information
thisisnotashwin committed Jan 18, 2023
1 parent f77b0e5 commit 500a500
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMPROVEMENTS:
* Add the `envoyExtensions` field to the `ProxyDefaults` and `ServiceDefaults` CRD. [[GH-1823]](https://github.com/hashicorp/consul-k8s/pull/1823)
* Add the `balanceInboundConnections` field to the `ServiceDefaults` CRD. [[GH-1823]](https://github.com/hashicorp/consul-k8s/pull/1823)
* Control-Plane
* Add support for the annotation `consul.hashicorp.com/use-proxy-health-check`. When this annotation is used by a service, it configures a readiness endpoint on Consul Dataplane and queries it instead of the application for its readiness. [[GH-1824](https://github.com/hashicorp/consul-k8s/pull/1824)], [[GH-1841](https://github.com/hashicorp/consul-k8s/pull/1824)]
* Add support for the annotation `consul.hashicorp.com/use-proxy-health-check`. When this annotation is used by a service, it configures a readiness endpoint on Consul Dataplane and queries it instead of the proxy's inbound port which forwards requests to the application. [[GH-1824](https://github.com/hashicorp/consul-k8s/pull/1824)], [[GH-1841](https://github.com/hashicorp/consul-k8s/pull/1824)]
* Add health check for synced services based on the status of the Kubernetes readiness probe on synced pod. [[GH-1821](https://github.com/hashicorp/consul-k8s/pull/1821)]

BUG FIXES:
Expand Down
10 changes: 7 additions & 3 deletions control-plane/connect-inject/webhook/consul_dataplane_sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,14 @@ func (w *MeshWebhook) sidecarResources(pod corev1.Pod) (corev1.ResourceRequireme
}

// useProxyHealthCheck returns true if the pod has the annotation 'consul.hashicorp.com/use-proxy-health-check'
// set to "true".
// set to truthy values.
func useProxyHealthCheck(pod corev1.Pod) bool {
if v, ok := pod.Annotations[constants.AnnotationUseProxyHealthCheck]; ok || v == "true" {
return true
if v, ok := pod.Annotations[constants.AnnotationUseProxyHealthCheck]; ok {
useProxyHealthCheck, err := strconv.ParseBool(v)
if err != nil {
return false
}
return useProxyHealthCheck
}
return false
}

0 comments on commit 500a500

Please sign in to comment.