Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructNamespaceSelector(data []interface{}) (...)
- func FlattenNamespaceSelector(...) (data []interface{})
- func FlattenScope(scopedFullname *ScopedFullname) (data []interface{}, name string)
- func MetaResourceAttributeCheck(resourceName string) []resource.TestCheckFunc
- func ValidateScope(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error
- func ValidateSpecLabelSelectorRequirement(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error
- type Cluster
- type ClusterGroup
- type Scope
- type ScopeHelperResources
- type ScopedFullname
Constants ¶
View Source
const ( NamespaceSelectorKey = "namespace_selector" MatchExpressionsKey = "match_expressions" KeyKey = "key" OperatorKey = "operator" ValuesKey = "values" ScopeKey = "scope" SpecKey = "spec" NameKey = "name" InputKey = "input" RecipeVersionDefaultValue = "v1" UnknownRecipe = "" )
Variables ¶
View Source
var ( ScopeSchema = &schema.Schema{ Type: schema.TypeList, Description: "Scope for the security and custom policy, having one of the valid scopes: cluster, cluster_group or organization.", Required: true, ForceNew: true, MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ clusterKey: scoperesource.ClusterPolicyFullname, clusterGroupKey: scoperesource.ClusterGroupPolicyFullname, organizationKey: scoperesource.OrganizationPolicyFullname, }, }, } ScopesAllowed = [...]string{clusterKey, clusterGroupKey, organizationKey} )
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 FlattenScope ¶ added in v1.1.3
func FlattenScope(scopedFullname *ScopedFullname) (data []interface{}, name string)
func MetaResourceAttributeCheck ¶
func MetaResourceAttributeCheck(resourceName string) []resource.TestCheckFunc
func ValidateScope ¶ added in v1.1.3
func ValidateScope(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error
func ValidateSpecLabelSelectorRequirement ¶ added in v1.1.3
func ValidateSpecLabelSelectorRequirement(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error
Types ¶
type ClusterGroup ¶ added in v1.1.3
type ScopeHelperResources ¶ added in v1.1.3
type ScopeHelperResources struct { Meta string Cluster *Cluster ClusterGroup *ClusterGroup OrgID string }
func NewScopeHelperResources ¶ added in v1.1.3
func NewScopeHelperResources() *ScopeHelperResources
func (*ScopeHelperResources) GetTestPolicyResourceHelperAndScope ¶ added in v1.1.3
func (shr *ScopeHelperResources) GetTestPolicyResourceHelperAndScope(scope Scope) (string, string)
GetTestPolicyResourceHelperAndScope builds the helper resource and scope blocks for policy resource based on a scope type.
type ScopedFullname ¶ added in v1.1.3
type ScopedFullname struct { Scope Scope FullnameCluster *policyclustermodel.VmwareTanzuManageV1alpha1ClusterPolicyFullName FullnameClusterGroup *policyclustergroupmodel.VmwareTanzuManageV1alpha1ClustergroupPolicyFullName FullnameOrganization *policyorganizationmodel.VmwareTanzuManageV1alpha1OrganizationPolicyFullName }
ScopedFullname is a struct for all types of policy full names.
func ConstructScope ¶ added in v1.1.3
func ConstructScope(d *schema.ResourceData, name string) (scopedFullnameData *ScopedFullname)
Source Files ¶
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. |
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. |
Click to show internal directories.
Click to hide internal directories.