Add restore-from-testing endpoint #11
Reference in New Issue
Block a user
Delete Branch "benvin/testing-restore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Testing-scoped tokens can move a node to
testingbut nothing can move it back without a full-scope token or a terragrunt apply, because the prior environment is never stored.nodes.previous_environment(FK to statuses, set null on delete)DELETE /api/v1/nodes/{certname}/environment/testing(testing tokens allowed): restores and returns the node, 409 if not in testing or nothing recordedclient.RestoreFromTestingandencapi-cli node restore-envRestoreFromTestinghas noErrNoPreviousEnvironmentbranch (restores to""), andSetNodeEnvironment(line 98) never clears on leaving testing; the fake diverges from the real rules → mirror thefakeStoreswitch in internal/server/server_test.go.