validation

package
v0.0.0-...-a0d0389 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAccountInPoolOU

func IsAccountInPoolOU(account awsv1alpha1.Account, client awsclient.Client, isPoolOU func(s string) bool) bool

Verify if the account is already in the root OU The predicate indicates if the parent considered the desired root was found.

func MoveAccount

func MoveAccount(awsAccountId string, client awsclient.Client, targetOU string, moveAccount bool) error

func ParentsTillPredicate

func ParentsTillPredicate(awsId string, client awsclient.Client, p func(s string) bool, parents *[]string) error

Retrieve all parents of the given awsId until the predicate returns true.

func ValidateAccountOrigin

func ValidateAccountOrigin(account awsv1alpha1.Account) error

func ValidateAccountTags

func ValidateAccountTags(client awsclient.Client, accountId *string, shardName string, accountTagEnabled bool) error

func ValidateAwsAccountId

func ValidateAwsAccountId(account awsv1alpha1.Account) error

Types

type AccountValidationError

type AccountValidationError struct {
	Type ValidationError
	Err  error
}

func (*AccountValidationError) Error

func (ave *AccountValidationError) Error() string

type AccountValidationReconciler

type AccountValidationReconciler struct {
	Client client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

func NewAccountValidationReconciler

func NewAccountValidationReconciler(client client.Client, scheme *runtime.Scheme, awsClientBuilder awsclient.IBuilder) *AccountValidationReconciler

func (*AccountValidationReconciler) Reconcile

func (r *AccountValidationReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

func (*AccountValidationReconciler) SetupWithManager

func (r *AccountValidationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*AccountValidationReconciler) ValidateAccountOU

func (r *AccountValidationReconciler) ValidateAccountOU(awsClient awsclient.Client, account awsv1alpha1.Account, poolOU string) error

type ValidationError

type ValidationError int64
const (
	InvalidAccount ValidationError = iota
	AccountMoveFailed
	MissingTag
	IncorrectOwnerTag
	AccountTagFailed
	MissingAWSAccount
)

Jump to

Keyboard shortcuts

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