Documentation ¶
Index ¶
- Constants
- func CheckScore(results ScanResults, configurationObject Configuration) error
- func CopyYaml(configurationObject Configuration, configFolder string) error
- func GetPodSpec(yaml map[string]interface{}) interface{}
- func GetRepoTags(path string) ([]string, error)
- func GetResultsFromCommand(command string, args ...string) (string, error)
- func ProcessHelmTemplates(configurationObject Configuration, configFolder string) error
- func SaveJUnitFile(results ScanResults, filename string) error
- func ScanImagesWithTrivy(images []models.Image, configurationObject Configuration) ([]byte, string, error)
- type Configuration
- type HelmConfig
- type ManifestConfig
- type ReportInfo
- type Resource
- type ScanResults
Constants ¶
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 ¶
GetRepoTags returns the repotags from a tarball of a an image.
func GetResultsFromCommand ¶
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 ¶
ReportInfo is the information about a run of one of the reports.
type Resource ¶
Resource represents a Kubernetes resource with information about what file it came from.
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