UI : vocabulaire unifié, comptes + mots de passe, choix par élément, clé AES auto
This commit is contained in:
1 parent
ee8343c69f
commit
2ca2f87307
19 files changed
+377
-143
No files matched your search
@@ -29,7 +29,7 @@ func TestCheckSSHHostKeyMismatch(t *testing.T) {
|
||||
SSHHostKey: strings.TrimSpace(string(ssh.MarshalAuthorizedKey(other)))}
|
||||
|
||||
res := CheckCluster(context.Background(), cl, false, false)
|
||||
if res.OK || !res.SSHMismatch || !res.API || res.SSHHostKey != "" || !strings.Contains(res.Error, "clé d'hôte") {
|
||||
if res.OK || !res.SSHMismatch || !res.API || res.SSHHostKey != "" || !strings.Contains(res.Error, "host key") {
|
||||
t.Fatalf("mismatch expected: %+v", res)
|
||||
}
|
||||
res = CheckCluster(context.Background(), cl, false, true)
|
||||
|
||||
@@ -315,7 +315,7 @@ type ClientPlan struct {
|
||||
|
||||
// Plans returns the plans of the given clients restricted to the given objects
|
||||
// (empty: everything), as a dry-run shows them and an apply checks them.
|
||||
func (st *State) Plans(keys []string) []ClientPlan {
|
||||
func (st *State) Plans(keys []string, skip []model.Kind) []ClientPlan {
|
||||
var out []ClientPlan
|
||||
for _, c := range st.Clients {
|
||||
cp := ClientPlan{Client: c.Name}
|
||||
@@ -325,7 +325,7 @@ func (st *State) Plans(keys []string) []ClientPlan {
|
||||
case c.Error != "":
|
||||
cp.Error = c.Error
|
||||
default:
|
||||
cp.Plan = engine.Filter(c.Plan, keys)
|
||||
cp.Plan = engine.Skip(c.Plan, keys, skip)
|
||||
cp.Digest = cp.Plan.Digest()
|
||||
cp.SDN = cp.Plan.HasSDN()
|
||||
}
|
||||
@@ -336,7 +336,7 @@ func (st *State) Plans(keys []string) []ClientPlan {
|
||||
|
||||
// Apply writes one plan on a client, then checks that the selected objects are
|
||||
// in line with the reference (same reference objects as the plan).
|
||||
func (st *State) Apply(ctx context.Context, cp ClientPlan, keys []string, log func(engine.Step)) error {
|
||||
func (st *State) Apply(ctx context.Context, cp ClientPlan, keys []string, skip []model.Kind, log func(engine.Step)) error {
|
||||
cl, ok := st.cfg.Client(cp.Client)
|
||||
if !ok {
|
||||
return fmt.Errorf("unknown client %q", cp.Client)
|
||||
@@ -351,7 +351,7 @@ func (st *State) Apply(ctx context.Context, cp ClientPlan, keys []string, log fu
|
||||
}
|
||||
start := time.Now()
|
||||
err = engine.Verify(ctx, c, func(actual []model.Object) engine.Plan {
|
||||
return engine.Filter(engine.MakePlan(st.cfg, cl, st.ref, actual), keys)
|
||||
return engine.Skip(engine.MakePlan(st.cfg, cl, st.ref, actual), keys, skip)
|
||||
}, st.cfg.Kinds)
|
||||
s := engine.Step{At: start.UTC(), Action: "verify"}
|
||||
if err != nil {
|
||||
@@ -394,7 +394,7 @@ func CheckCluster(ctx context.Context, cl config.Cluster, pinTLS, trust bool) Ch
|
||||
cl.Fingerprint, res.TLSFingerprint = fp, fp
|
||||
}
|
||||
if cl.Insecure {
|
||||
res.Warnings = append(res.Warnings, "certificat TLS non vérifié (labo uniquement)")
|
||||
res.Warnings = append(res.Warnings, "TLS certificate not verified (lab only)")
|
||||
}
|
||||
key := cl.SSHHostKey
|
||||
cl.SSHHostKey = "" // API only for now
|
||||
@@ -433,7 +433,7 @@ func CheckCluster(ctx context.Context, cl config.Cluster, pinTLS, trust bool) Ch
|
||||
if strings.Contains(err.Error(), "host key mismatch") {
|
||||
_, fp, _ := sshx.Scan(ctx, o)
|
||||
res.SSHMismatch, res.SSHFingerprint = true, fp
|
||||
return fail(fmt.Errorf("SSH: le nœud %s présente la clé d'hôte %s au lieu de %s enregistrée", o.Host, fp, sshx.Fingerprint(key)))
|
||||
return fail(fmt.Errorf("SSH: node %s presents host key %s instead of the recorded %s", o.Host, fp, sshx.Fingerprint(key)))
|
||||
}
|
||||
return fail(fmt.Errorf("SSH: %w", err))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user