Skip to content

Commit

Permalink
Update tokengetter.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmi43 authored Nov 20, 2024
1 parent e8e76c6 commit 3ef45b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/authentication/tokengetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type ServiceAccountNotFoundError struct {
ServiceAccountName string
}

func (e *SANotFoundError) Error() string {
func (e *ServiceAccountNotFoundError) Error() string {
return fmt.Sprintf(" Unable to authenticate with Kubernetes cluster using ServiceAccount \"%s\": ServiceAccount \"%s\" not found.", e.ServiceAccountName, e.ServiceAccountName)
}

Expand Down Expand Up @@ -95,7 +95,7 @@ func (t *TokenGetter) getToken(ctx context.Context, key types.NamespacedName) (*
Spec: authenticationv1.TokenRequestSpec{ExpirationSeconds: ptr.To(int64(t.expirationDuration / time.Second))},
}, metav1.CreateOptions{})
if err != nil {
saErr := &SANotFoundError{key.Name}
saErr := &ServiceAccountNotFoundError{key.Name}
return nil, saErr
}
return &req.Status, nil
Expand Down

0 comments on commit 3ef45b6

Please sign in to comment.