From 07a661f7d1c44debb194b01b2e510b1b4a6101d7 Mon Sep 17 00:00:00 2001 From: Hungerdream <1710233908@qq.com> Date: Wed, 29 Jul 2026 18:40:23 +0800 Subject: [PATCH] fix(delivery): accept root@% credential for CloudDM registration PR #128 looks up the root credential with account_host = 'localhost', which never matches under the single root@% account model. Widen the lookup to account_host IN ('%', 'localhost'), consistent with the compatibility strategy in deploymentCredentialVars. --- server/internal/service/delivery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/internal/service/delivery.go b/server/internal/service/delivery.go index 5b58b6f..d92f8b5 100644 --- a/server/internal/service/delivery.go +++ b/server/internal/service/delivery.go @@ -2046,7 +2046,7 @@ func (s *DeliveryService) RegisterCloudDM(ctx context.Context, taskID string) er } var credential model.DeploymentCredential if err := s.db.WithContext(ctx). - Where("task_id = ? AND username = ? AND account_host = ? AND status IN ?", taskID, "root", "localhost", []string{"pending", "available"}). + Where("task_id = ? AND username = ? AND account_host IN ? AND status IN ?", taskID, "root", []string{"%", "localhost"}, []string{"pending", "available"}). First(&credential).Error; err != nil { return fmt.Errorf("CloudDM registration requires the MySQL root credential: %w", err) }