validation

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnforcerOptionWebhookFailOpen          = "webhook_fail_open"
	EnforcerOptionEnableCIPCache           = "enable_cip_cache"
	EnforcerOptionNamespaceEnforcementMode = "namespace_enforcement_mode"

	NamespaceEnforcementModeOptOut = "opt-out"
	NamespaceEnforcementModeOptIn  = "opt-in"
)

Variables

View Source
var (
	// ValidNamespaceEnforcementModeOpts are valid webhook label selection options for a managed cluster
	ValidNamespaceEnforcementModeOpts = sets.NewString(NamespaceEnforcementModeOptIn, NamespaceEnforcementModeOptOut)

	// ValidEnforcerOptions are valid field names of enforcer options available
	ValidEnforcerOptions = sets.NewString(EnforcerOptionWebhookFailOpen, EnforcerOptionEnableCIPCache, EnforcerOptionNamespaceEnforcementMode)
)
View Source
var (

	// ErrInvalidAWSAccount describes invalid AWS Account IDs by sharing the
	// regular expression they must match
	ErrInvalidAWSAccount = fmt.Errorf("AWS account ID must match %q", awsAccountPattern)
)
View Source
var (

	// ErrInvalidBundles describes invalid bundle(s) by sharing the regular expression
	// they must match
	ErrInvalidBundles = fmt.Errorf("each bundle item must match %q", bundlePattern)
)
View Source
var (

	// ErrInvalidName describes invalid names by sharing the regular expression
	// they must match
	ErrInvalidName = fmt.Errorf("name must match %q", namePattern)
)
View Source
var (

	// ErrInvalidTag describes invalid tags by sharing the regular expression
	// they must match
	ErrInvalidTag = fmt.Errorf("tag must match %q", tagPattern)
)

Functions

func ValidateAWSAccount

func ValidateAWSAccount(id string) error

ValidateAWSAccount checks an AWS account id is valid. AWS Accounts must be a 12 digit number.

func ValidateBundles

func ValidateBundles(bundles []string) error

func ValidateName

func ValidateName(name string) error

func ValidateTag

func ValidateTag(tag string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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