[election] - Response content is JSON but `Content-Type` header is `text/plain`
nbrinks opened this issue · 4 comments
Using the leader election sidecar.
# Relevant content
- image: k8s.gcr.io/leader-elector:0.5
imagePullPolicy: IfNotPresent
name: elector
args:
- --election=my-election
- --http=localhost:4040
ports:
- containerPort: 4040
protocol: TCP
resources:
requests:
cpu: 100m
Here is an example response from the sidecar.
some-user@some-pod-569f9cf4c5-pjh4b:/$ curl -v localhost:4040/
* Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 4040 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 4040 (#0)
> GET / HTTP/1.1
> Host: localhost:4040
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 05 Jun 2018 16:55:12 GMT
< Content-Length: 44
< Content-Type: text/plain; charset=utf-8
<
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
{"name":"some-pod-569f9cf4c5-pjh4b"}
I am pretty sure the fix is to place
res.Header().Set("Content-Type", "application/json")
before this line but I am having trouble setting up a development environment to test this.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen
.
Mark the issue as fresh with/remove-lifecycle rotten
.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.