linter

package
v0.0.0-...-e51861b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCommand

func CheckCommand(conf *config.Config, container *yaml.Container) error

CheckCommand checks that a container is not overriding the entypoint.

func CheckCommands

func CheckCommands(conf *config.Config, container *yaml.Container) error

CheckCommands checks the container commands to not conflict with the container entrypoint and command blocks.

func CheckEntrypoint

func CheckEntrypoint(conf *config.Config, container *yaml.Container) error

CheckEntrypoint checks that a container is not overriding the entypoint.

func CheckImage

func CheckImage(conf *config.Config, container *yaml.Container) error

CheckImage checks the container image attribute is not empty.

func CheckPipeline

func CheckPipeline(conf *config.Config) error

CheckPipeline checks the pipeline block is not empty.

func IsDataVolume

func IsDataVolume(conf *config.Config, volume *yaml.Volume) bool

IsDataVolume returns true if the volume mapping is a data volume.

func IsService

func IsService(conf *config.Config, container *yaml.Container) bool

IsService returns true if the container is a service.

Types

type Check

type Check func(*config.Config) error

Check returns an error if the configuration is invalid.

func CheckContainer

func CheckContainer(check func(*config.Config, *yaml.Container) error) Check

CheckContainer is an adapter to perform a check for every container in the configuration. If a check fails the function halts and returns an error.

TODO(bradrydzewski) if check container accepted a slice of checks, we could chain the checks together to reduce the number of iterations.

func CheckNetworks

func CheckNetworks(trusted bool) Check

CheckNetworks prevents a configuration from defining custom networks in untrusted mode.

func CheckTrusted

func CheckTrusted(trusted bool) Check

CheckTrusted checks that a container is not using any restricted settings that require elevated permissions.

func CheckVolumes

func CheckVolumes(trusted bool) Check

CheckVolumes limits the configuration to only using custom local volumes in untrusted mode.

type Linter

type Linter struct {
	// contains filtered or unexported fields
}

A Linter lints a pipeline configuration.

func New

func New(checks ...Check) *Linter

New returns a new Linter that executes checks sequentially.

func NewDefault

func NewDefault(trusted bool) *Linter

NewDefault returns a new Linter that executes default checks.

func (*Linter) Lint

func (l *Linter) Lint(conf *config.Config) error

Lint evaluates the linter rules against the given configuration.

Jump to

Keyboard shortcuts

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