fix(worker): harden control-plane lifecycle
Все проверки выполнены успешно
CI / test (push) Successful in 2m32s
Docker / Build and publish worker image (push) Successful in 18m17s
Все проверки выполнены успешно
CI / test (push) Successful in 2m32s
Docker / Build and publish worker image (push) Successful in 18m17s
- reconnect safely after token rotation and retry leased results - reject malformed tasks and remove production cluster debug mutation - validate environment files and require immutable container images BREAKING CHANGE: Docker install, deploy, and Compose now require an immutable repository@sha256 image reference.
Этот коммит содержится в:
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/ed25519"
|
||||
"crypto/rand"
|
||||
"net"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
@@ -39,3 +40,16 @@ func TestKnownHostsMissingFile(t *testing.T) {
|
||||
t.Fatal("missing known_hosts file accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeployRejectsMutableDockerImageBeforeConnecting(t *testing.T) {
|
||||
err := Deploy(DeployOptions{
|
||||
Host: "unreachable.example.test",
|
||||
User: "deploy",
|
||||
Token: "token",
|
||||
Docker: true,
|
||||
Image: "reg.rsxx.ru/rsmon/rsmon-worker:latest",
|
||||
})
|
||||
if err == nil || !strings.Contains(err.Error(), "immutable") {
|
||||
t.Fatalf("Deploy() error = %v, want immutable image error", err)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user