worker

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package worker is responsible for the logic behind submitting results data back to a sonobuoy master. This is intended for plugins to leverage, to avoid uploading data manually.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(url string, client *http.Client, callback func() (io.Reader, string, error)) error

DoRequest calls the given callback which returns an io.Reader, and submits the results, with error handling, and falls back on uploading JSON with the error message if the callback fails. (This way, problems gathering data don't result in the server waiting forever for results that will never come.)

func GatherResults

func GatherResults(waitfile string, url string, client *http.Client, stopc <-chan struct{}) error

GatherResults is the consumer of a co-scheduled container that agrees on the following contract:

1. Output data will be placed into an agreed upon results directory. 2. The Job will wait for a done file 3. The done file contains a single string of the results to be sent to the master

func LoadConfig

func LoadConfig() (*plugin.WorkerConfig, error)

LoadConfig loads the configuration for the sonobuoy worker from environment variables, returning a plugin.WorkerConfig struct with defaults applied

Types

This section is empty.

Jump to

Keyboard shortcuts

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