Skip to content

Commit 452703d

Browse files
committed
review comments
Signed-off-by: rashmi_kh <[email protected]>
1 parent 7b23746 commit 452703d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/authentication/tokengetter.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ type TokenGetter struct {
2222
}
2323

2424
type ServiceAccountNotFoundError struct {
25-
ServiceAccountName string // The name of the missing ServiceAccount.
25+
ServiceAccountName string // The name of the missing ServiceAccount.
26+
ServiceAccountNamespace string // The namespace where the ServiceAccount should exist
2627
}
2728

2829
// Error implements the error interface for ServiceAccountNotFoundError.
2930
func (e *ServiceAccountNotFoundError) Error() string {
30-
return fmt.Sprintf("ServiceAccount \"%s\" not found: Unable to authenticate with the Kubernetes cluster.", e.ServiceAccountName)
31+
return fmt.Sprintf("ServiceAccount \"%s\" not found in namespace \"%s\": Unable to authenticate with the Kubernetes cluster.", e.ServiceAccountName, e.ServiceAccountNamespace)
3132
}
3233

3334
type TokenGetterOption func(*TokenGetter)
@@ -98,7 +99,7 @@ func (t *TokenGetter) getToken(ctx context.Context, key types.NamespacedName) (*
9899
}, metav1.CreateOptions{})
99100
if err != nil {
100101
if errors.IsNotFound(err) {
101-
return nil, &ServiceAccountNotFoundError{ServiceAccountName: key.Name}
102+
return nil, &ServiceAccountNotFoundError{ServiceAccountName: key.Name, ServiceAccountNamespace: key.Namespace}
102103
}
103104
return nil, err
104105
}

internal/controllers/clusterextension_controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1.Cl
209209
setInstallStatus(ext, nil)
210210
var saerr *authentication.ServiceAccountNotFoundError
211211
if errors.As(err, &saerr) {
212-
l.Info("ServiceAccount defined in the ClusterExtension is not found")
213212
err = saerr
214213
}
215214
setInstalledStatusConditionUnknown(ext, err.Error())

0 commit comments

Comments
 (0)