Skip to content

Commit

Permalink
Refresh auth context while polling for clustergroup backupschedule
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Naren Pujari <rnarenpujari@gmail.com>
  • Loading branch information
rnarenpujari committed Mar 27, 2024
1 parent db5c3cd commit ff99714
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/resources/backupschedule/resource_backup_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ func readCGResourceWait(ctx context.Context, config *authctx.TanzuContext,
resourceFullName)

if err != nil || resp == nil || resp.Schedule == nil {
if clienterrors.IsUnauthorizedError(err) {
authctx.RefreshUserAuthContext(config, clienterrors.IsUnauthorizedError, err)
continue
}

return nil, err
}

Expand Down

0 comments on commit ff99714

Please sign in to comment.