mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Add "create" and "remove" events for secrets.
This commit adds the "secret" Event type and emits "create" and "remove" events for this Event type when Secret is created or removed. This can be used for example by podman interfaces to view and manage secrets. Fixes: #24030 Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
@ -191,6 +191,16 @@ func (v *Volume) newVolumeEvent(status events.Status) {
|
||||
}
|
||||
}
|
||||
|
||||
// NewSecretEvent creates a new event for a libpod secret
|
||||
func (r *Runtime) NewSecretEvent(status events.Status, secretID string) {
|
||||
e := events.NewEvent(status)
|
||||
e.ID = secretID
|
||||
e.Type = events.Secret
|
||||
if err := r.eventer.Write(e); err != nil {
|
||||
logrus.Errorf("Unable to write secret event: %q", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Events is a wrapper function for everyone to begin tailing the events log
|
||||
// with options
|
||||
func (r *Runtime) Events(ctx context.Context, options events.ReadOptions) error {
|
||||
|
Reference in New Issue
Block a user