Skip to content

Commit

Permalink
fix(installer): cover nil credential case (#1673)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoryu authored Nov 25, 2021
1 parent 066ddaa commit 1888e23
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/platform/provider/cluster/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ func (p *DelegateProvider) GetRestConfig(ctx context.Context, client platformint
if err != nil {
return nil, err
}
config := cc.RESTConfig(cluster)
config := &rest.Config{}
if cc != nil {
config = cc.RESTConfig(cluster)
}
return config, nil
}

Expand All @@ -469,6 +472,9 @@ func (p *DelegateProvider) GetRestConfigV1(ctx context.Context, client platformv
if err != nil {
return nil, err
}
config := cc.RESTConfig(cluster)
config := &rest.Config{}
if cc != nil {
config = cc.RESTConfig(cluster)
}
return config, nil
}

0 comments on commit 1888e23

Please sign in to comment.