validate

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParallelValidators = []SpinnakerValidator{
	&versionValidator{},
	&dockerRegistryValidator{},
	&awsAccountValidator{},
}

Validators registered here should be stateless

Functions

This section is empty.

Types

type Account

type Account interface {
	GetType() string
	GetName() string
	GetHash() string
}

type AwsAccount added in v1.2.1

type AwsAccount struct {
	DefaultKeyPair string             `json:"defaultKeyPair,omitempty"`
	Edda           string             `json:"edda,omitempty"`
	Discovery      string             `json:"discovery,omitempty"`
	AccountId      string             `json:"accountId,omitempty"`
	Regions        []AwsRegion        `json:"regions,omitempty"`
	AssumeRole     string             `json:"assumeRole,omitempty"`
	ExternalId     string             `json:"externalId,omitempty"`
	SessionName    string             `json:"sessionName,omitempty"`
	LifecycleHooks []AwsLifecycleHook `json:"lifecycleHooks,omitempty"`
}

type AwsLifecycleHook added in v1.2.1

type AwsLifecycleHook struct {
	DefaultResult         string `json:"defaultResult,omitempty"`
	HeartbeatTimeout      int32  `json:"heartbeatTimeout,omitempty"`
	LifecycleTransition   string `json:"lifecycleTransition,omitempty"`
	NotificationTargetARN string `json:"notificationTargetARN,omitempty"`
	RoleARN               string `json:"roleARN,omitempty"`
}

type AwsRegion added in v1.2.1

type AwsRegion struct {
	Name string `json:"name,omitempty"`
}

type Options

type Options struct {
	Ctx          context.Context
	Client       client.Client
	Req          admission.Request
	Log          logr.Logger
	Halyard      *halyard.Service
	TypesFactory interfaces.TypesFactory
}

type ParallelValidator

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

func (*ParallelValidator) Validate

type SpinnakerValidator

type SpinnakerValidator interface {
	Validate(spinSvc interfaces.SpinnakerService, options Options) ValidationResult
}

func GetAccountValidationsFor

func GetAccountValidationsFor(spinSvc interfaces.SpinnakerService, options Options) ([]SpinnakerValidator, error)

GetAccountValidationsFor inspects all known providers, retrieves their accounts, and generate validators

type ValidationResult

type ValidationResult struct {
	Errors        []error
	Fatal         bool
	StatusPatches []jsonpatch.JsonPatchOperation
}

func NewResultFromError

func NewResultFromError(e error, fatal bool) ValidationResult

func NewResultFromErrors added in v0.6.0

func NewResultFromErrors(e []error, fatal bool) ValidationResult

func ValidateAll

func ValidateAll(spinSvc interfaces.SpinnakerService, options Options) ValidationResult

func (*ValidationResult) GetErrorMessage

func (r *ValidationResult) GetErrorMessage() string

func (*ValidationResult) HasErrors

func (r *ValidationResult) HasErrors() bool

func (*ValidationResult) HasFatalErrors

func (r *ValidationResult) HasFatalErrors() bool

func (*ValidationResult) Merge

func (r *ValidationResult) Merge(other ValidationResult)

Jump to

Keyboard shortcuts

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