Skip to content

Commit aaef035

Browse files
author
Tim Middleton
authored
Minor health command update (#203)
* Minor health command update * fix unit test
1 parent c9274e1 commit aaef035

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/cmd/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,10 @@ func parseHealthEndpoints(endpointCSV string) ([]string, error) {
685685
for _, v := range endpoints {
686686
_, err := url.ParseRequestURI(v)
687687
if err != nil {
688+
if v == "" {
689+
// ignore invalid URLS
690+
continue
691+
}
688692
return validEndpoints, fmt.Errorf("url [%s] is not valid", v)
689693
}
690694
validEndpoints = append(validEndpoints, v)

pkg/cmd/utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestDecodeMemberDetails(t *testing.T) {
6767
func TestParseHealthEndpoints(t *testing.T) {
6868
g := NewGomegaWithT(t)
6969
_, err := parseHealthEndpoints("")
70-
g.Expect(err).To(HaveOccurred())
70+
g.Expect(err).To(Not(HaveOccurred())) // special empty case
7171

7272
_, err = parseHealthEndpoints("rubbish")
7373
g.Expect(err).To(HaveOccurred())

0 commit comments

Comments
 (0)