mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-20 22:51:18 +02:00
fix: retain recipient suppression after access recovery (#897)
* fix: retain recipient suppression after access recovery * fix: migrate cold starts and fence resource deactivation * docs: stop every writer before alert reconciliation
This commit is contained in:
1 parent
445a479339
commit
772e40debd
12 files changed
+429
-122
No files matched your search
@@ -18,11 +18,11 @@ const args = process.argv.slice(2), state = JSON.parse(fs.readFileSync(process.e
|
||||
fs.appendFileSync(process.env.TASK_DOCKER_LOG, JSON.stringify(args) + "\\n");
|
||||
const finish = (output = "", code = 0) => { fs.writeFileSync(process.env.TASK_DOCKER_STATE, JSON.stringify(state)); process.stdout.write(output); process.exit(code); };
|
||||
if (args[0] === "image" && args[1] === "inspect") {
|
||||
if (args.some(a => a.includes("Labels"))) finish(state.badProtocol ? "<no value>" : "recipient-v1");
|
||||
if (args.some(a => a.includes("Labels"))) finish(state.badProtocol ? "<no value>" : "recipient-v2");
|
||||
finish(state.built ? "sha:new" : "sha:old");
|
||||
}
|
||||
if (args[0] === "inspect") {
|
||||
if (args.some(a => a.includes("Labels"))) finish("<no value>");
|
||||
if (args.some(a => a.includes("Labels"))) finish(state.oldProtocol || "<no value>");
|
||||
if (args.includes("{{.State.Running}}")) finish(state.stopped && !state.refuseStop ? "false" : "true");
|
||||
finish("healthy");
|
||||
}
|
||||
@@ -68,6 +68,14 @@ finish("unexpected docker call", 2);
|
||||
expect(result.calls.slice(up + 1, api).some(args => args[0] === "inspect" && args.at(-1) === name)).to.equal(true);
|
||||
}
|
||||
});
|
||||
it("stops recipient-v1 writers before restoring permanent recipient suppression", () => {
|
||||
const result = deploy({ oldProtocol: "recipient-v1" });
|
||||
expect(result.status, result.stderr).to.equal(0);
|
||||
const stop = result.calls.findIndex(args => args[0] === "compose" && args[1] === "stop");
|
||||
const reconcile = result.calls.findIndex(args => args[0] === "compose" && args[1] === "run");
|
||||
const up = result.calls.findIndex(args => args[0] === "compose" && args[1] === "up");
|
||||
expect(stop).to.be.greaterThan(-1); expect(reconcile).to.be.greaterThan(stop); expect(up).to.be.greaterThan(reconcile);
|
||||
});
|
||||
it("aborts before migration starts if a legacy writer remains running", () => {
|
||||
const result = deploy({ refuseStop: true });
|
||||
expect(result.status).not.to.equal(0);
|
||||
|
||||
Reference in new issue
Block a user