Skip to content

Commit 29154f5

Browse files
authored
Merge pull request #280 from kmala/health
fix(healthcheck): Parse arguments properly for httpheaders
2 parents 5162e2f + 2b7700d commit 29154f5

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

glide.lock

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ import:
1616
- package: github.com/olekukonko/tablewriter
1717
- package: github.com/arschles/assert
1818
- package: github.com/deis/controller-sdk-go
19-
version: e4abe62d2accc3168b82ff54cb7e8aff2764d03b
19+
version: 578082f82b3460b47d3c7e127313352f7117edfc

parser/healthchecks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Options:
124124
the relative URL path for 'httpGet' probes. [default: /]
125125
--type=<type>
126126
the procType for which the health check needs to be applied.
127-
--header=<header>...
127+
--headers=<headers>...
128128
the HTTP headers to send for 'httpGet' probes, separated by commas.
129129
--initial-delay-timeout=<initial-delay-timeout>
130130
the initial delay timeout for the probe [default: 50]
@@ -154,7 +154,7 @@ Options:
154154
failureThreshold := safeGetInt(args, "--failure-threshold")
155155
headers := []string{}
156156
if args["--headers"] != nil {
157-
headers = args["--headers"].([]string)
157+
headers = strings.Split(args["--headers"].(string), ",")
158158
}
159159
if procType == "" {
160160
procType = defaultProcType
@@ -271,7 +271,7 @@ func parseHeader(header string) (*api.KVPair, error) {
271271
return nil, fmt.Errorf("could not find separator in header (%s)", header)
272272
}
273273
return &api.KVPair{
274-
Key: strings.TrimSpace(headerParts[0]),
274+
Name: strings.TrimSpace(headerParts[0]),
275275
Value: strings.TrimSpace(headerParts[1]),
276276
}, nil
277277
}

parser/healthchecks_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestHealthchecks(t *testing.T) {
5151
expected: "",
5252
},
5353
{
54-
args: []string{"healthchecks:set", "liveness", "httpGet", "80", "--header=test-header:test-value"},
54+
args: []string{"healthchecks:set", "liveness", "httpGet", "80", "--headers=test-header:test-value"},
5555
expected: "",
5656
},
5757
{

0 commit comments

Comments
 (0)