Pebble has never used the warnings system or recorded any warnings. It's getting in the way, so remove it (for one thing, before this PR it means a state lock/unlock on every request to get the warnings summary -- which is always 0).
Warnings (inherited from snapd) assume a single client, which isn't true and doesn't make a lot of sense for Pebble: they have a single lastShown timestamp (on the server) for when they were last shown to the (single) client, whereas notices aren't marked as "shown" on the server. Each server response included pending warnings (pending means not shown or having a lastShown earlier than repeatAfter ago).
This PR:
removes the warnings from state
keeps the /v1/warnings API (but it's hard-coded to return no warnings)
keeps the Go client functions (though again, they're hard-coded to return nothing)
removes the warnings CLI command (okay now just okays notices)
Separately (or in this PR if desired?) we could reinstate the pebble warnings command to use notices of type=warning and save the last warning timestamp locally on the client. But I'm not sure that gains much over the user just using pebble notices --type=warning.
Pebble has never used the warnings system or recorded any warnings. It's getting in the way, so remove it (for one thing, before this PR it means a state lock/unlock on every request to get the warnings summary -- which is always 0).
Warnings (inherited from snapd) assume a single client, which isn't true and doesn't make a lot of sense for Pebble: they have a single lastShown timestamp (on the server) for when they were last shown to the (single) client, whereas notices aren't marked as "shown" on the server. Each server response included pending warnings (pending means not shown or having a lastShown earlier than repeatAfter ago).
This PR:
warnings
CLI command (okay
now just okays notices)Separately (or in this PR if desired?) we could reinstate the
pebble warnings
command to use notices of type=warning and save the last warning timestamp locally on the client. But I'm not sure that gains much over the user just usingpebble notices --type=warning
.