policy

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceSelectorKey      = "namespace_selector"
	MatchExpressionsKey       = "match_expressions"
	KeyKey                    = "key"
	OperatorKey               = "operator"
	ValuesKey                 = "values"
	SpecKey                   = "spec"
	NameKey                   = "name"
	InputKey                  = "input"
	RecipeVersionDefaultValue = "v1"
	UnknownRecipe             = ""
)

Variables

View Source
var NamespaceSelector = &schema.Schema{
	Type:        schema.TypeList,
	Description: "Label based Namespace Selector for the policy",
	Optional:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			MatchExpressionsKey: {
				Type:        schema.TypeList,
				Description: "Match expressions is a list of label selector requirements, the requirements are ANDed",
				Required:    true,
				Elem:        labelSelectorRequirement,
			},
		},
	},
}

Functions

func ConstructNamespaceSelector

func ConstructNamespaceSelector(data []interface{}) (namespaceSelector *policymodel.VmwareTanzuManageV1alpha1CommonPolicyLabelSelector)

func FlattenNamespaceSelector

func FlattenNamespaceSelector(namespaceSelector *policymodel.VmwareTanzuManageV1alpha1CommonPolicyLabelSelector) (data []interface{})

func MetaResourceAttributeCheck

func MetaResourceAttributeCheck(resourceName string) []resource.TestCheckFunc

func ValidateSpecLabelSelectorRequirement added in v1.1.3

func ValidateSpecLabelSelectorRequirement(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error

Types

type Cluster added in v1.1.3

type Cluster struct {
	Resource              string
	ResourceVar           string
	ResourceName          string
	KubeConfigPath        string
	Name                  string
	ClusterGroupName      string
	ManagementClusterName string
	ProvisionerName       string
}

type ClusterGroup added in v1.1.3

type ClusterGroup struct {
	ResourceName string
	Resource     string
	ResourceVar  string
	Name         string
}

type ScopeHelperResources added in v1.1.3

type ScopeHelperResources struct {
	Meta         string
	Cluster      *Cluster
	ClusterGroup *ClusterGroup
	Workspace    *Workspace
	OrgID        string
}

func NewScopeHelperResources added in v1.1.3

func NewScopeHelperResources() *ScopeHelperResources

func (*ScopeHelperResources) GetTestPolicyResourceHelperAndScope added in v1.1.3

func (shr *ScopeHelperResources) GetTestPolicyResourceHelperAndScope(scopeType scope.Scope, scopesAllowed []string, mock bool) (string, string)

GetTestPolicyResourceHelperAndScope builds the helper resource and scope blocks for policy resource based on a scope type.

type Workspace added in v1.1.4

type Workspace struct {
	ResourceName string
	Resource     string
	ResourceVar  string
	Name         string
}

Directories

Path Synopsis
kind
custom/recipe
Package recipe contains schema and helper functions for different input recipes.
Package recipe contains schema and helper functions for different input recipes.
mutation/recipe
nolint: dupl
nolint: dupl
security/recipe
Package recipe contains schema and helper functions for different input recipes.
Package recipe contains schema and helper functions for different input recipes.
Package scope contains schema and helper functions for different policy scopes.
Package scope contains schema and helper functions for different policy scopes.

Jump to

Keyboard shortcuts

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