ci

package
v0.0.0-...-40eda91 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ScoreOutOfBoundsMessage = "score out of bounds"

ScoreOutOfBoundsMessage is the message for the error when the score returned by Insights is out of bounds.

Variables

This section is empty.

Functions

func CheckScore

func CheckScore(results ScanResults, configurationObject Configuration) error

CheckScore checks if the score meets all of the thresholds.

func CopyYaml

func CopyYaml(configurationObject Configuration, configFolder string) error

CopyYaml adds all Yaml found in a given spot into the manifest folder.

func GetPodSpec

func GetPodSpec(yaml map[string]interface{}) interface{}

GetPodSpec looks inside arbitrary YAML for a PodSpec

func GetRepoTags

func GetRepoTags(path string) ([]string, error)

GetRepoTags returns the repotags from a tarball of a an image.

func GetResultsFromCommand

func GetResultsFromCommand(command string, args ...string) (string, error)

GetResultsFromCommand executes a command and returns the results as a string.

func ProcessHelmTemplates

func ProcessHelmTemplates(configurationObject Configuration, configFolder string) error

ProcessHelmTemplates turns helm into yaml to be processed by Polaris or the other tools.

func SaveJUnitFile

func SaveJUnitFile(results ScanResults, filename string) error

SaveJUnitFile will save the

func ScanImagesWithTrivy

func ScanImagesWithTrivy(images []models.Image, configurationObject Configuration) ([]byte, string, error)

ScanImagesWithTrivy scans the images and returns a Trivy report ready to send to Insights.

Types

type Configuration

type Configuration struct {
	Images    imageConfig    `yaml:"images"`
	Manifests ManifestConfig `yaml:"manifests"`
	Options   optionConfig   `yaml:"options"`
}

Configuration is a struct representing the config options for Insights CI/CD

func (Configuration) CheckForErrors

func (c Configuration) CheckForErrors() error

CheckForErrors checks to make sure the configuration is valid

func (*Configuration) SetDefaults

func (c *Configuration) SetDefaults()

SetDefaults sets configurationd defaults

type HelmConfig

type HelmConfig struct {
	Name       string                 `yaml:"name"`
	Path       string                 `yaml:"path"`
	ValuesFile string                 `yaml:"valuesFile"`
	Values     map[string]interface{} `yaml:"values"`
}

HelmConfig is the configuration for helm.

type ManifestConfig

type ManifestConfig struct {
	YamlPaths []string     `yaml:"yaml"`
	Helm      []HelmConfig `yaml:"helm"`
}

ManifestConfig is a struct representing the config options for Manifests

type ReportInfo

type ReportInfo struct {
	Report   string
	Version  string
	Filename string
}

ReportInfo is the information about a run of one of the reports.

type Resource

type Resource struct {
	Kind      string
	Name      string
	Filename  string
	Namespace string
}

Resource represents a Kubernetes resource with information about what file it came from.

func GetImagesFromManifest

func GetImagesFromManifest(configFolder string) ([]models.Image, []Resource, error)

GetImagesFromManifest scans a folder of yaml files and returns all of the images used.

type ScanResults

type ScanResults struct {
	NewActionItems   []actionItem
	FixedActionItems []actionItem
	Pass             bool
}

ScanResults is the value returned by the Insights API upon submitting a scan.

func SendResults

func SendResults(reports []ReportInfo, resources []Resource, configurationObject Configuration, token string) (ScanResults, error)

SendResults sends the results to Insights

Jump to

Keyboard shortcuts

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