validation

package
v0.0.0-...-4c2872b Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAccountInCorrectOU

func IsAccountInCorrectOU(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

func ValidateRemoval

func ValidateRemoval(account awsv1alpha1.Account) error

Types

type AccountPoolValidationReconciler

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

func (*AccountPoolValidationReconciler) Reconcile

func (*AccountPoolValidationReconciler) SetupWithManager

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

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

	OUNameIDMap map[string]string
	// contains filtered or unexported fields
}

func NewAccountValidationReconciler

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

func (*AccountValidationReconciler) GetOUIDFromName

func (r *AccountValidationReconciler) GetOUIDFromName(client awsclient.Client, parentid string, ouName string) (string, error)

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, baseOU string) error

func (*AccountValidationReconciler) ValidateOptInRegions

func (r *AccountValidationReconciler) ValidateOptInRegions(reqLogger logr.Logger, currentAcctInstance *awsv1alpha1.Account, awsClientBuilder awsclient.IBuilder, optInRegions string) error

func (*AccountValidationReconciler) ValidateRegionalServiceQuotas

func (r *AccountValidationReconciler) ValidateRegionalServiceQuotas(reqLogger logr.Logger, account *awsv1alpha1.Account, awsClientBuilder awsclient.IBuilder) error

type ValidationError

type ValidationError int64
const (
	InvalidAccount ValidationError = iota
	AccountMoveFailed
	MissingTag
	IncorrectOwnerTag
	AccountTagFailed
	MissingAWSAccount
	OULookupFailed
	AWSErrorConnecting
	SettingServiceQuotasFailed
	QuotaStatus
	NotAllServicequotasApplied
	AccountNotForCleanup
	OptInRegionStatus
	NotAllOptInRegionsEnabled
	TooManyActiveAccountRegionEnablements
)

Jump to

Keyboard shortcuts

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