Skip to content

Commit

Permalink
fix crash when opts is nil (#90)
Browse files Browse the repository at this point in the history
Signed-off-by: Gang Liu <[email protected]>
  • Loading branch information
izturn authored May 27, 2022
1 parent 4584090 commit ff8c3f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func newClient(options *Options, clientGetter genericclioptions.RESTClientGetter
registryClient, err := registry.NewClient(
registry.ClientOptDebug(settings.Debug),
registry.ClientOptCredentialsFile(settings.RegistryConfig),
)
)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func (c *HelmClient) upgrade(ctx context.Context, spec *ChartSpec, opts *Generic

upgradedRelease, upgradeErr := client.RunWithContext(ctx, spec.ReleaseName, helmChart, values)
if upgradeErr != nil {
if upgradedRelease != nil && opts.RollBack != nil {
if upgradedRelease != nil && opts != nil && opts.RollBack != nil {
return nil, opts.RollBack.RollbackRelease(spec)
}
return nil, upgradeErr
Expand Down

0 comments on commit ff8c3f7

Please sign in to comment.