Documentation ¶
Overview ¶
Copyright The Shipwright Contributors
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func All(ctx context.Context, validations ...BuildPath) error
- func BuildParameters(parameterDefinitions []buildv1beta1.Parameter, ...) (bool, buildv1beta1.BuildReason, string)
- func BuildRunFields(buildRun *build.BuildRun) (string, string)
- func BuildRunParameters(parameterDefinitions []buildv1beta1.Parameter, ...) (bool, string, string)
- func BuildRunVolumes(strategyVolumes []buildv1beta1.BuildStrategyVolume, ...) (bool, string, string)
- func BuildVolumes(strategyVolumes []buildv1beta1.BuildStrategyVolume, ...) (bool, buildv1beta1.BuildReason, string)
- type BuildNameRef
- type BuildPath
- type BuildSpecOutputValidator
- type Credentials
- type Env
- type NodeSelectorRef
- type OwnerRef
- type SourceRef
- type SourceURLRef
- type Strategy
- type Trigger
Constants ¶
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" // Sources for validating `spec.sources` entries Source = "source" // Output for validating `spec.output` entry Output = "output" // BuildName for validating `metadata.name` entry BuildName = "buildname" // Envs for validating `spec.env` entries Envs = "env" // OwnerReferences for validating the ownerreferences between a Build // and BuildRun objects OwnerReferences = "ownerreferences" // Triggers for validating the `.spec.triggers` entries Triggers = "triggers" // NodeSelector for validating `spec.nodeSelector` entry NodeSelector = "nodeselector" )
Variables ¶
This section is empty.
Functions ¶
func BuildParameters ¶ added in v0.9.0
func BuildParameters(parameterDefinitions []buildv1beta1.Parameter, buildParamValues []buildv1beta1.ParamValue) (bool, buildv1beta1.BuildReason, string)
BuildParameters validates that the parameter values specified in Build are suitable for what is defined in the BuildStrategy
func BuildRunFields ¶ added in v0.9.0
BuildRunFields runs field validations against a BuildRun to detect disallowed field combinations and issues
func BuildRunParameters ¶ added in v0.9.0
func BuildRunParameters(parameterDefinitions []buildv1beta1.Parameter, buildParamValues []buildv1beta1.ParamValue, buildRunParamValues []buildv1beta1.ParamValue) (bool, string, string)
BuildRunParameters validates that the parameter values specified in Build and BuildRun are suitable for what is defined in the BuildStrategy
func BuildRunVolumes ¶ added in v0.10.0
func BuildRunVolumes(strategyVolumes []buildv1beta1.BuildStrategyVolume, buildVolumes []buildv1beta1.BuildVolume) (bool, string, string)
BuildRunVolumes is used to validate volumes in the BuildRun object
func BuildVolumes ¶ added in v0.10.0
func BuildVolumes(strategyVolumes []buildv1beta1.BuildStrategyVolume, buildVolumes []buildv1beta1.BuildVolume) (bool, buildv1beta1.BuildReason, string)
BuildVolumes is used to validate volumes in the Build object
Types ¶
type BuildNameRef ¶ added in v0.6.0
BuildNameRef contains all required fields to validate a build name
func NewBuildName ¶ added in v0.9.0
func NewBuildName(build *build.Build) *BuildNameRef
func (*BuildNameRef) ValidatePath ¶ added in v0.6.0
func (b *BuildNameRef) ValidatePath(_ context.Context) error
ValidatePath implements BuildPath interface and validates that build name is a valid label value
type BuildPath ¶
BuildPath is an interface that holds a ValidatePath() function for validating different Build spec paths
type BuildSpecOutputValidator ¶ added in v0.13.0
BuildSpecOutputValidator implements validation interface to add validations for `build.spec.output`.
func (*BuildSpecOutputValidator) ValidatePath ¶ added in v0.13.0
func (b *BuildSpecOutputValidator) ValidatePath(_ context.Context) error
type Credentials ¶ added in v0.4.0
Credentials contains all required fields to validate a Build spec secrets definitions
func NewCredentials ¶ added in v0.9.0
func NewCredentials(client client.Client, build *build.Build) *Credentials
func (Credentials) ValidatePath ¶ added in v0.4.0
func (s Credentials) ValidatePath(ctx context.Context) error
ValidatePath implements BuildPath interface and validates that all referenced secrets under spec exists
type Env ¶ added in v0.6.0
Env implements the Env interface to add validations for the `build.spec.env` slice.
type NodeSelectorRef ¶ added in v0.14.0
NodeSelectorRef contains all required fields to validate a node selector
func NewNodeSelector ¶ added in v0.14.0
func NewNodeSelector(build *build.Build) *NodeSelectorRef
func (*NodeSelectorRef) ValidatePath ¶ added in v0.14.0
func (b *NodeSelectorRef) ValidatePath(_ context.Context) error
ValidatePath implements BuildPath interface and validates that NodeSelector keys/values are valid labels
type SourceRef ¶ added in v0.13.0
SourcesRef implements RuntimeRef interface to add validations for `build.spec.source`.
func NewSourceRef ¶ added in v0.13.0
NewSourcesRef instantiate a new SourcesRef passing the build object pointer along.
type SourceURLRef ¶
SourceURLRef contains all required fields to validate a Build spec source definition
func NewSourceURL ¶ added in v0.9.0
func NewSourceURL(client client.Client, build *build.Build) *SourceURLRef
func (SourceURLRef) MarkBuildStatus ¶
func (s SourceURLRef) MarkBuildStatus(b *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 Strategy ¶ added in v0.4.0
Strategy contains all required fields to validate a Build spec strategy definition
func NewStrategies ¶ added in v0.9.0
type Trigger ¶ added in v0.11.0
type Trigger struct {
// contains filtered or unexported fields
}
Trigger implements the interface BuildPath with the objective of applying validations against the `.spec.trigger` related attributes.
func NewTrigger ¶ added in v0.11.0
NewTrigger instantiate Trigger validation helper.