utils

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaultLabels

func ApplyDefaultLabels(p plugin.Interface, labels map[string]string) map[string]string

ApplyDefaultLabels applies a default label set to the given map[string]string. All our resources should have a commmon label set, particularly a unique sesssion ID for sonobuoy run. This can allow fallback cleanup for this session by deleting any resources with `sonobuoy-run=<sessionID>`

func IsPodFailing

func IsPodFailing(pod *v1.Pod) (bool, string)

IsPodFailing returns whether a plugin's pod is failing and isn't likely to succeed. TODO: this may require more revisions as we get more experience with various types of failures that can occur.

func MakeErrorResult

func MakeErrorResult(resultType string, errdata map[string]interface{}, nodeName string) *plugin.Result

MakeErrorResult constructs a plugin.Result given an error message and error data. errdata is a map that will be placed in the sonobuoy results tarball for this plugin as a JSON file, so it's what users will see for why the plugin failed. If errdata["error"] is not set, it will be filled in with an "Unknown error" string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL