Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
fix: login: eliminate possible nil dereference (#2445)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Linville <[email protected]>
  • Loading branch information
g-linville authored Jan 20, 2024
1 parent e2b69a6 commit 07b2490
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func Secrets(ctx context.Context, c client.Client, app *apiv1.App) (*apiv1.App,
if err != nil {
return nil, err
}
app = updatedApp
if updatedApp != nil {
app = updatedApp
}
}
}

Expand Down Expand Up @@ -88,15 +90,14 @@ func bindSecret(ctx context.Context, c client.Client, app *apiv1.App, targetSecr
appName := parts[0]
targetSecretName = strings.Join(parts[1:], ".")

updatedApp, err := c.AppUpdate(ctx, appName, &client.AppUpdateOptions{
return c.AppUpdate(ctx, appName, &client.AppUpdateOptions{
Secrets: []v1.SecretBinding{
{
Secret: overrideSecretName,
Target: targetSecretName,
},
},
})
return updatedApp, err
}

func createSecret(ctx context.Context, c client.Client, app *apiv1.App, secretName string) (*apiv1.App, error) {
Expand Down

0 comments on commit 07b2490

Please sign in to comment.