Skip to content

Commit

Permalink
fix "panic: runtime error: index out of range" if an ingress manifest…
Browse files Browse the repository at this point in the history
… does

not provide tls hosts

```improvement operator
fix for "Panic if ingress spec.tls.hosts not specified" (issue #6)
```
  • Loading branch information
MartinWeindel committed Nov 19, 2019
1 parent 57894ac commit 80a07c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/40-ingress-echoheaders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Ingress
metadata:
name: echoheaders
namespace: default
annotation:
annotations:
cert.gardener.cloud/purpose: managed
spec:
tls:
Expand Down
4 changes: 2 additions & 2 deletions pkg/cert/source/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (this *sourceReconciler) createEntryFor(logger logger.LogContext, obj resou
if this.targetclass != "" {
resources.SetAnnotation(cert, ANNOT_CLASS, this.targetclass)
}
if len(info.Domains) >= 0 {
if len(info.Domains) > 0 {
cert.Spec.CommonName = &info.Domains[0]
cert.Spec.DNSNames = info.Domains[1:]
}
Expand Down Expand Up @@ -371,7 +371,7 @@ func (this *sourceReconciler) updateEntry(logger logger.LogContext, info CertInf
mod.Modify(changed)
var cn *string
var dnsNames []string
if len(info.Domains) >= 0 {
if len(info.Domains) > 0 {
cn = &info.Domains[0]
dnsNames = info.Domains[1:]
}
Expand Down

0 comments on commit 80a07c0

Please sign in to comment.