Skip to content

Commit c40ae34

Browse files
committed
Check for empty username in ImportCredentialsSecret
Unset username was handled correctly, but empty username resulted in an unclear error: "Error 405 (Error 405 from RabbitMQ: EOF):".
1 parent 5af4f43 commit c40ae34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/user_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (r *UserReconciler) importCredentials(ctx context.Context, secretName, secr
162162
}
163163

164164
username, ok := credentialsSecret.Data["username"]
165-
if !ok {
165+
if !ok || len(username) == 0 {
166166
return credentials, fmt.Errorf("could not find username key in credentials secret: %s", credentialsSecret.Name)
167167
}
168168
credentials.Username = string(username)

0 commit comments

Comments
 (0)