Merge pull request #3691 from baude/infoeventlogger

add eventlogger to info
This commit is contained in:
OpenShift Merge Robot
2019-08-05 15:23:05 +02:00
committed by GitHub
9 changed files with 25 additions and 6 deletions

2
API.md
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()
}

View File

@ -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()
}

View File

@ -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"
}

View File

@ -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
}

View File

@ -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)

View File

@ -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