This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiline lock reason yaml corruption
Lock reason messages can be spread over multiple lines. YAML's multiline output omits indentation for empty lines. The regex looking for a fragment to replace did not include these lines and therefore was not removing the full multiline content but just until the first empty line. One implication was that the `flux.weave.works/locked_user` annotation was never cleared and the original locker wrongfully returned as the author of the current lock. This PR expands matching for existing annotations to include these empty lines. User locked with multiline and empty line: ``` metadata: annotations: flux.weave.works/locked: "true" flux.weave.works/locked_msg: |- first second flux.weave.works/locked_user: test <test@test.test> ``` After removing lock: ``` metadata: annotations: second flux.weave.works/locked_user: test <test@test.test> ``` Another person locks: ``` metadata: annotations: flux.weave.works/locked: "true" flux.weave.works/locked_msg: Do not update. flux.weave.works/locked_user: someone <else@test.test> second flux.weave.works/locked_user: test <test@test.test> ```
- Loading branch information