validate

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessKeyId     = "providers.aws.accessKeyId"
	SecretAccessKey = "providers.aws.secretAccessKey"
)

Variables

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

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 CloudFoundryClient added in v1.2.5

type CloudFoundryClient interface {
	RequestToken(api string, appsManagerUri string, user string, password string, skipHttps bool, httpService util.HttpService) (string, error)
	GetOrganizations(token string, api string, appsManagerUri string, skipHttps bool) (bool, error)
}

func NewCloudFoundryClient added in v1.2.5

func NewCloudFoundryClient() CloudFoundryClient

type CloudFoundryService added in v1.2.5

type CloudFoundryService interface {
	RequestToken(api string, appsManagerUri string, user string, password string, skipHttps bool, httpService util.HttpService) (string, error)
	GetOrganizations(token string, api string, appsManagerUri string, skipHttps bool) (bool, error)
}

func NewCloudFoundryService added in v1.2.5

func NewCloudFoundryService(client CloudFoundryClient) CloudFoundryService

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