Skip to content

Commit

Permalink
fix(registry): fix nil pointer exception when TLS not set
Browse files Browse the repository at this point in the history
Signed-off-by: Jason-ZW <zhenyang@rancher.com>
  • Loading branch information
rancher-sy-bot authored and niusmallnan committed Mar 31, 2021
1 parent 375aae3 commit b1dbfdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@ func registryTLSMap(registry *templates.Registry) (m map[string]map[string][]byt
if _, ok := m[r]; !ok {
m[r] = map[string][]byte{}
}
if c.TLS == nil {
continue
}
if c.TLS.CertFile != "" {
b, err := ioutil.ReadFile(c.TLS.CertFile)
if err != nil {
Expand Down

0 comments on commit b1dbfdb

Please sign in to comment.