agent

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackoffMaxTime time.Duration

BackoffMaxTime is the maximum time for which data gatherers will be retried

View Source
var ConfigFilePath string

ConfigFilePath is where the agent will try to load the configuration from

View Source
var CredentialsPath string

CredentialsPath is where the agent will try to loads the credentials. (Experimental)

View Source
var InputPath string

InputPath is where the agent will read data from instead of gathering from clusters if specified

View Source
var OneShot bool

OneShot flag causes agent to run once

View Source
var OutputPath string

OutputPath is where the agent will write data to locally if specified

Period is the time waited between scans

View Source
var StrictMode bool

StrictMode flag causes the agent to fail at the first attempt

Functions

func Run

func Run(cmd *cobra.Command, args []string)

Run starts the agent process

Types

type Config

type Config struct {
	Schedule string        `yaml:"schedule"`
	Period   time.Duration `yaml:"period"`
	// Deprecated: Endpoint is being replaced with Server.
	Endpoint Endpoint `yaml:"endpoint"`
	// Server is the base url for the Preflight server.
	// It defaults to https://preflight.jetstack.io.
	Server string `yaml:"server"`
	// OrganizationID within Preflight that will receive the data.
	OrganizationID string `yaml:"organization_id"`
	// ClusterID is the cluster that the agent is scanning.
	ClusterID     string         `yaml:"cluster_id"`
	DataGatherers []dataGatherer `yaml:"data-gatherers"`
	// InputPath replaces DataGatherers with input data file
	InputPath string `yaml:"input-path"`
	// OutputPath replaces Server with output data file
	OutputPath string `yaml:"output-path"`
}

Config wraps the options for a run of the agent.

func ParseConfig

func ParseConfig(data []byte) (Config, error)

ParseConfig reads config into a struct used to configure running agents

func (*Config) Dump

func (c *Config) Dump() (string, error)

Dump generates a YAML string of the Config object

type Endpoint

type Endpoint struct {
	Protocol string `yaml:"protocol"`
	Host     string `yaml:"host"`
	Path     string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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