Stackdriver Logging e2e: Explicitly check for docker and kubelet logs presence
This commit is contained in:
@@ -315,23 +315,27 @@ func (p *sdLogProvider) tryGetName(sdLogEntry sd.LogEntry) (string, bool) {
|
||||
return "", false
|
||||
}
|
||||
|
||||
func convertLogEntry(sdLogEntry sd.LogEntry) (utils.LogEntry, error) {
|
||||
func convertLogEntry(sdLogEntry sd.LogEntry) (entry utils.LogEntry, err error) {
|
||||
entry = utils.LogEntry{LogName: sdLogEntry.LogName}
|
||||
if sdLogEntry.TextPayload != "" {
|
||||
return utils.LogEntry{TextPayload: sdLogEntry.TextPayload}, nil
|
||||
entry.TextPayload = sdLogEntry.TextPayload
|
||||
return
|
||||
}
|
||||
|
||||
bytes, err := sdLogEntry.JsonPayload.MarshalJSON()
|
||||
if err != nil {
|
||||
return utils.LogEntry{}, fmt.Errorf("Failed to get jsonPayload from LogEntry %v", sdLogEntry)
|
||||
err = fmt.Errorf("Failed to get jsonPayload from LogEntry %v", sdLogEntry)
|
||||
return
|
||||
}
|
||||
|
||||
var jsonObject map[string]interface{}
|
||||
err = json.Unmarshal(bytes, &jsonObject)
|
||||
if err != nil {
|
||||
return utils.LogEntry{},
|
||||
fmt.Errorf("Failed to deserialize jsonPayload as json object %s", string(bytes[:]))
|
||||
err = fmt.Errorf("Failed to deserialize jsonPayload as json object %s", string(bytes[:]))
|
||||
return
|
||||
}
|
||||
return utils.LogEntry{JSONPayload: jsonObject}, nil
|
||||
entry.JSONPayload = jsonObject
|
||||
return
|
||||
}
|
||||
|
||||
func pullAndAck(service *pubsub.Service, subs *pubsub.Subscription) ([]*pubsub.ReceivedMessage, error) {
|
||||
|
||||
Reference in New Issue
Block a user