Fix jwt and PAT not found

[ZITADOPER-1]
This commit is contained in:
Haim Kortovich
2024-05-20 20:21:47 -05:00
parent baaf56b8de
commit 554196961a

View File

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