validate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Secrets for validating secret references in Build objects
	Secrets = "secrets"
	// Strategies for validating strategy references in Build objects
	Strategies = "strategy"
	// SourceURL for validating the source URL in Build objects
	SourceURL = "sourceurl"
	// Runtime for validating the runtime definition in Build objects
	Runtime = "runtime"
	// OwnerReferences for validating the ownerreferences between a Build
	// and BuildRun objects
	OwnerReferences = "ownerreferences"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildPath

type BuildPath interface {
	ValidatePath(ctx context.Context) error
}

BuildPath is an interface that holds a ValidaPath() function for validating different Build spec paths

func NewValidation

func NewValidation(
	validationType string,
	build *build.Build,
	client client.Client,
	scheme *runtime.Scheme,
) (BuildPath, error)

NewValidation returns an specific Structure that implements BuildPath interface

type OwnerRef

type OwnerRef struct {
	Build  *build.Build
	Client client.Client
	Scheme *runtime.Scheme
}

OwnerRef contains all required fields to validate a Build OwnerReference definition

func (OwnerRef) ValidatePath

func (o OwnerRef) ValidatePath(ctx context.Context) error

ValidatePath implements BuildPath interface and validates setting the ownershipReference between a Build and a BuildRun

type RuntimeRef

type RuntimeRef struct {
	Build  *build.Build
	Client client.Client
}

RuntimeRef contains all required fields to validate a Build spec runtime definition

func (RuntimeRef) ValidatePath

func (r RuntimeRef) ValidatePath(ctx context.Context) error

ValidatePath implements BuildPath interface and validates that the Build spec runtime definition is properly populated

type SecretRef

type SecretRef struct {
	Build  *build.Build
	Client client.Client
}

SecretRef contains all required fields to validate a Build spec secrets definitions

func (SecretRef) ValidatePath

func (s SecretRef) ValidatePath(ctx context.Context) error

ValidatePath implements BuildPath interface and validates that all referenced secrets under spec exists

type SourceURLRef

type SourceURLRef struct {
	Build  *build.Build
	Client client.Client
}

SourceURLRef contains all required fields to validate a Build spec source definition

func (SourceURLRef) MarkBuildStatus

func (s SourceURLRef) MarkBuildStatus(build *build.Build, reason build.BuildReason, msg string)

MarkBuildStatus updates a Build Status fields

func (SourceURLRef) ValidatePath

func (s SourceURLRef) ValidatePath(ctx context.Context) error

ValidatePath implements BuildPath interface and validates that the spec.source.url exists. This validation only applies to endpoints that do not require authentication.

type StrategyRef

type StrategyRef struct {
	Build  *build.Build
	Client client.Client
}

StrategyRef contains all required fields to validate a Build spec strategy definition

func (StrategyRef) ValidatePath

func (s StrategyRef) ValidatePath(ctx context.Context) error

ValidatePath implements BuildPath interface and validates that the referenced strategy exists. This applies to both namespaced or cluster scoped strategies

Jump to

Keyboard shortcuts

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