Files
Zeyad Yasser cea9811778 many: save revision when snap is inhibited (#13174)
* cmd/snaplock/runinhibit: save revision when snap is inhibited

This is handy to be used by "snap run" to get snap info when
the "current" symlink is not available (i.e. during a refresh
after the snap is unlinked).

An extra data JSON file is created <inhibit-dir>/<snap>.<hint>. This is
needed to carry more information that is needed by "snap run" while
the snap is inhibited. It can be expanded to add more data as needed.

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* o/hookstate/hooks: reuse saved inhibit info in gate-auto-refresh hook Done() method

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* cmd/snaplock/runinhibit: update doc comments for InhibitInfo and LockWithHint

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* cmd/snaplock/runinhibit: rename InhibitInfo.Revision to InhibitInfo.Previous

to make it clearer.

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* cmd/snaplock/runinhibit: sync hint file write ops for more reliability

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* cmd/snaplock/runinhibit: refactor Hint and InhibitInfo validation as a type method

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

* cmd/snaplock/runinhibit: change ioutil.WriteFile to os.WriteFile

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>

---------

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
2023-11-01 18:13:39 +02:00
..