mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-06 17:27:08 +00:00
set tokenrequest UID to empty to avoid conflict with the ServiceAccount UID validation (#1423)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
@@ -56,6 +56,9 @@ func (t *TokenRequestService) HandleStatusUpdate(ctx context.Context, evt *cloud
|
||||
|
||||
switch eventType.Action {
|
||||
case types.CreateRequestAction:
|
||||
// Clear the UID to avoid conflict with the ServiceAccount UID validation
|
||||
// introduced by the TokenRequestServiceAccountUIDValidation feature gate (k8s 1.34+).
|
||||
tokenRequest.UID = ""
|
||||
// Create a token for the service account
|
||||
tokenResponse, err := t.client.CoreV1().ServiceAccounts(tokenRequest.Namespace).CreateToken(ctx, tokenRequest.Name, tokenRequest, metav1.CreateOptions{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user