recipe

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

nolint: dupl

nolint: dupl

Index

Constants

View Source
const (
	PodSecurityKey = "pod_security"
	LabelKey       = "label"
	AnnotationKey  = "annotation"
)

Variables

View Source
var AnnotationSchema = &schema.Schema{
	Type:        schema.TypeList,
	Description: "The input schema for custom policy tmc_block_nodeport_service recipe version v1",
	Optional:    true,
	ForceNew:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			targetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema,
			scopeKey: {
				Type:         schema.TypeString,
				Description:  "Scope",
				Optional:     true,
				Default:      "*",
				ValidateFunc: validation.StringInSlice([]string{"*", "Cluster", "Namespaced"}, false),
			},
			AnnotationKey: {
				Type:     schema.TypeList,
				Optional: true,
				MaxItems: 1,
				MinItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						keyKey: {
							Type:     schema.TypeString,
							Required: true,
						},
						valueKey: {
							Type:     schema.TypeString,
							Required: true,
						},
					},
				},
			},
		},
	},
}
View Source
var LabelSchema = &schema.Schema{
	Type:        schema.TypeList,
	Description: "The input schema for custom policy tmc_block_nodeport_service recipe version v1",
	Optional:    true,
	ForceNew:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			targetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema,
			scopeKey: {
				Type:         schema.TypeString,
				Description:  "Scope",
				Optional:     true,
				Default:      "*",
				ValidateFunc: validation.StringInSlice([]string{"*", "Cluster", "Namespaced"}, false),
			},
			LabelKey: {
				Type:     schema.TypeList,
				Optional: true,
				MinItems: 1,
				MaxItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						keyKey: {
							Type:     schema.TypeString,
							Required: true,
						},
						valueKey: {
							Type:     schema.TypeString,
							Required: true,
						},
					},
				},
			},
		},
	},
}
View Source
var PodSecuritySchema = &schema.Schema{
	Type:        schema.TypeList,
	Description: "The pod security schema",
	Optional:    true,
	ForceNew:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			allowPrivilegeEscalationKey: booleanConditionSchema,
			capabilitiesAddKey:          operationSchema,
			capabilitiesDropKey:         operationSchema,
			fsGroupKey:                  ipConditionSchema,
			privilegedKey:               booleanConditionSchema,
			readOnlyRootFilesystemKey:   booleanConditionSchema,
			runAsGroupKey:               ipConditionSchema,
			runAsNonRootKey:             booleanConditionSchema,
			runAsUserKey:                ipConditionSchema,
			seLinuxOptionsKey:           allowedSELinuxOptions,
			supplementalGroupsKey:       conditionSchemaArrays,
		},
	},
}

Functions

func ConstructAnnotation

func ConstructAnnotation(data []interface{}) (annotationModel *policyrecipemutationmodel.VmwareTanzuManageV1alpha1CommonPolicySpecMutationV1Annotation)

func ConstructPodSecurity

func ConstructPodSecurity(data []interface{}) (podSecuritySpec *policyrecipemutationmodel.VmwareTanzuManageV1alpha1CommonPolicySpecMutationV1PodSecurity)

func FlattenAnnotation

func FlattenAnnotation(mutationAnnotation *policyrecipemutationmodel.VmwareTanzuManageV1alpha1CommonPolicySpecMutationV1Annotation) (data []interface{})

func FlattenLabel

func FlattenLabel(mutationLabel *policyrecipemutationmodel.VmwareTanzuManageV1alpha1CommonPolicySpecMutationV1Label) (data []interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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