Handle length error

[ZITADOPER-1]
This commit is contained in:
Haim Kortovich
2024-05-20 17:38:22 -05:00
parent 98b9f03c52
commit e650da83db

View File

@@ -186,7 +186,7 @@ func (wr *wrappedMachineUserReconciler) reconcilePAT(ctx context.Context, ztdCli
TokenId: wr.MachineUser.Status.PATId, TokenId: wr.MachineUser.Status.PATId,
}) })
if err != nil { if err != nil {
if !strings.Contains(err.Error(), "not found") { if !(strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "length must be between 1 and 200 runes")) {
return fmt.Errorf("Error getting PAT: %v", err) return fmt.Errorf("Error getting PAT: %v", err)
} }
} }
@@ -235,7 +235,7 @@ func (wr *wrappedMachineUserReconciler) reconcileJWT(ctx context.Context, ztdCli
KeyId: wr.MachineUser.Status.KeyId, KeyId: wr.MachineUser.Status.KeyId,
}) })
if err != nil { if err != nil {
if !strings.Contains(err.Error(), "not found") { if !(strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "length must be between 1 and 200 runes")) {
return fmt.Errorf("Error getting JWT: %v", err) return fmt.Errorf("Error getting JWT: %v", err)
} }
} }