mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
Merge pull request #3691 from baude/infoeventlogger
add eventlogger to info
This commit is contained in:
2
API.md
2
API.md
@ -1721,6 +1721,8 @@ kernel [string](https://godoc.org/builtin#string)
|
||||
os [string](https://godoc.org/builtin#string)
|
||||
|
||||
uptime [string](https://godoc.org/builtin#string)
|
||||
|
||||
eventlogger [string](https://godoc.org/builtin#string)
|
||||
### <a name="InfoPodmanBinary"></a>type InfoPodmanBinary
|
||||
|
||||
InfoPodman provides details on the podman binary
|
||||
|
@ -228,7 +228,8 @@ type InfoHost (
|
||||
hostname: string,
|
||||
kernel: string,
|
||||
os: string,
|
||||
uptime: string
|
||||
uptime: string,
|
||||
eventlogger: string
|
||||
)
|
||||
|
||||
# InfoGraphStatus describes the detailed status of the storage driver
|
||||
|
@ -53,6 +53,8 @@ type Eventer interface {
|
||||
Write(event Event) error
|
||||
// Read an event from the backend
|
||||
Read(options ReadOptions) error
|
||||
// String returns the type of event logger
|
||||
String() string
|
||||
}
|
||||
|
||||
// ReadOptions describe the attributes needed to read event logs
|
||||
|
@ -146,3 +146,8 @@ func newEventFromJournalEntry(entry *sdjournal.JournalEntry) (*Event, error) { /
|
||||
}
|
||||
return &newEvent, nil
|
||||
}
|
||||
|
||||
// String returns a string representation of the logger
|
||||
func (e EventJournalD) String() string {
|
||||
return Journald.String()
|
||||
}
|
||||
|
@ -71,3 +71,8 @@ func (e EventLogFile) Read(options ReadOptions) error {
|
||||
close(options.EventChannel)
|
||||
return nil
|
||||
}
|
||||
|
||||
// String returns a string representation of the logger
|
||||
func (e EventLogFile) String() string {
|
||||
return LogFile.String()
|
||||
}
|
||||
|
@ -17,6 +17,10 @@ func (e EventToNull) Read(options ReadOptions) error {
|
||||
// NewNullEventer returns a new null eventer. You should only do this for
|
||||
// the purposes on internal libpod testing.
|
||||
func NewNullEventer() Eventer {
|
||||
e := EventToNull{}
|
||||
return e
|
||||
return EventToNull{}
|
||||
}
|
||||
|
||||
// String returns a string representation of the logger
|
||||
func (e EventToNull) String() string {
|
||||
return "none"
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
|
||||
return nil, errors.Wrapf(err, "error getting hostname")
|
||||
}
|
||||
info["hostname"] = host
|
||||
|
||||
info["eventlogger"] = r.eventer.String()
|
||||
return info, nil
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ var remoteEndpoint *Endpoint
|
||||
|
||||
func (r RemoteRuntime) RemoteEndpoint() (remoteEndpoint *Endpoint, err error) {
|
||||
remoteConfigConnections, err := remoteclientconfig.ReadRemoteConfig(r.config)
|
||||
if errors.Cause(err) != remoteclientconfig.ErrNoConfigationFile {
|
||||
if err != nil && errors.Cause(err) != remoteclientconfig.ErrNoConfigationFile {
|
||||
return nil, err
|
||||
}
|
||||
// If the user defines an env variable for podman_varlink_bridge
|
||||
@ -68,7 +68,6 @@ func (r RemoteRuntime) Connect() (*varlink.Connection, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch ep.Type {
|
||||
case DirectConnection:
|
||||
return varlink.NewConnection(ep.Connection)
|
||||
|
@ -61,6 +61,7 @@ func (i *LibpodAPI) GetInfo(call iopodman.VarlinkCall) error {
|
||||
Kernel: host["kernel"].(string),
|
||||
Os: host["os"].(string),
|
||||
Uptime: host["uptime"].(string),
|
||||
Eventlogger: host["eventlogger"].(string),
|
||||
}
|
||||
podmanInfo.Host = infoHost
|
||||
store := info[1].Data
|
||||
|
Reference in New Issue
Block a user