Skip to content

Commit 30f734a

Browse files
fix nil pointer dereference (#656)
* fix nil pointer dereference * bump
1 parent f0badb4 commit 30f734a

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.1.17
1+
VERSION=v0.1.18
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/common.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -563,16 +563,18 @@ func setIngressHost(ctx context.Context, opts *RuntimeInstallOptions) error {
563563
return fmt.Errorf("failed to get ingress controller info from your cluster: %w", err)
564564
}
565565

566-
for _, s := range servicesList.Items {
567-
if s.ObjectMeta.Name == opts.IngressController.Name() && s.Spec.Type == "LoadBalancer" {
568-
if len(s.Status.LoadBalancer.Ingress) > 0 {
569-
ingress := s.Status.LoadBalancer.Ingress[0]
570-
if ingress.Hostname != "" {
571-
foundHostName = ingress.Hostname
572-
break
573-
} else {
574-
foundHostName = ingress.IP
575-
break
566+
if opts.IngressController != nil {
567+
for _, s := range servicesList.Items {
568+
if s.ObjectMeta.Name == opts.IngressController.Name() && s.Spec.Type == "LoadBalancer" {
569+
if len(s.Status.LoadBalancer.Ingress) > 0 {
570+
ingress := s.Status.LoadBalancer.Ingress[0]
571+
if ingress.Hostname != "" {
572+
foundHostName = ingress.Hostname
573+
break
574+
} else {
575+
foundHostName = ingress.IP
576+
break
577+
}
576578
}
577579
}
578580
}

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.17/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.18/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.17/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.18/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

0 commit comments

Comments
 (0)