Documentation ¶
Overview ¶
Package recipe contains schema and helper functions for different input recipes. nolint: dupl
Package recipe contains schema and helper functions for different input recipes. Contains recipe schema for tmc-https-ingress, tmc-block-nodeport-service and tmc-block-resources recipe.
Package recipe contains schema and helper functions for different input recipes. nolint: dupl
Package recipe contains schema and helper functions for different input recipes. nolint: dupl
Index ¶
- Constants
- Variables
- func ConstructTMCBlockRolebindingSubjects(data []interface{}) (...)
- func ConstructTMCCommonRecipe(data []interface{}) (...)
- func ConstructTMCCustom(customRecipe []interface{}) (...)
- func ConstructTMCExternalIPS(data []interface{}) (...)
- func ConstructTMCRequireLabels(data []interface{}) (...)
- func FlattenTMCBlockRolebindingSubjects(...) (data []interface{})
- func FlattenTMCCommonRecipe(...) (data []interface{})
- func FlattenTMCCustom(recipeName string, ...) []interface{}
- func FlattenTMCExternalIPS(...) (data []interface{})
- func FlattenTMCRequireLabels(...) (data []interface{})
- func ValidateCustomRecipe(config authctx.TanzuContext, customRecipe map[string]interface{}) error
- func ValidateRecipeParameters(recipeSchema string, recipeParameters string) (errs []error)
Constants ¶
View Source
const ( TMCExternalIPSKey = "tmc_external_ips" TMCRequireLabelsKey = "tmc_require_labels" TMCBlockRolebindingSubjectsKey = "tmc_block_rolebinding_subjects" TMCBlockNodeportServiceKey = "tmc_block_nodeport_service" TMCBlockResourcesKey = "tmc_block_resources" TMCHTTPSIngressKey = "tmc_https_ingress" TMCCustomKey = "custom" AuditKey = "audit" TargetKubernetesResourcesKey = "target_kubernetes_resources" ParametersKey = "parameters" APIGroupsKey = "api_groups" KindsKey = "kinds" TemplateNameKey = "template_name" )
Variables ¶
View Source
var TMCBlockNodeportService = &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{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCBlockResources = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_block_resources recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCBlockRolebindingSubjects = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_block_rolebinding_subjects recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, ParametersKey: { Type: schema.TypeList, Description: "Parameters.", Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ disallowedSubjectsKey: { Type: schema.TypeList, Description: "Disallowed Subjects.", Required: true, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ kindKey: { Type: schema.TypeString, Description: "The kind of subject to disallow, can be User/Group/ServiceAccount.", Required: true, ValidateFunc: validation.StringInSlice([]string{"User", "Group", "ServiceAccount"}, false), }, nameKey: { Type: schema.TypeString, Description: "The name of the subject to disallow.", Required: true, }, }, }, }, }, }, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCCustomSchema = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_external_ips recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ TemplateNameKey: { Type: schema.TypeString, Description: "Name of custom template.", Required: true, }, AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, ParametersKey: { Type: schema.TypeString, Description: "JSON encoded template parameters.", Optional: true, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCExternalIps = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_external_ips recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, ParametersKey: { Type: schema.TypeList, Description: "Parameters.", Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ allowedIPsKey: { Type: schema.TypeList, Description: "Allowed IPs.", Required: true, Elem: &schema.Schema{Type: schema.TypeString}, }, }, }, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCHTTPSIngress = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_https_ingress recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
View Source
var TMCRequireLabels = &schema.Schema{ Type: schema.TypeList, Description: "The input schema for custom policy tmc_require_labels recipe version v1", Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ AuditKey: { Type: schema.TypeBool, Description: "Audit (dry-run).", Optional: true, Default: false, }, ParametersKey: { Type: schema.TypeList, Description: "Parameters.", Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ parametersLabelKey: { Type: schema.TypeList, Description: "Labels.", Required: true, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ labelKey: { Type: schema.TypeString, Description: "The label key to enforce.", Required: true, }, labelValueKey: { Type: schema.TypeString, Description: "Optional label value to enforce (if left empty, only key will be enforced).", Optional: true, }, }, }, }, }, }, }, TargetKubernetesResourcesKey: common.TargetKubernetesResourcesSchema, }, }, }
Functions ¶
func ConstructTMCBlockRolebindingSubjects ¶
func ConstructTMCBlockRolebindingSubjects(data []interface{}) (roleBindingSubjects *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCBlockRoleBindingSubjects)
func ConstructTMCCommonRecipe ¶
func ConstructTMCCommonRecipe(data []interface{}) (commonRecipe *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCCommonRecipe)
func ConstructTMCCustom ¶ added in v1.4.2
func ConstructTMCCustom(customRecipe []interface{}) (customInputModel *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustom)
func ConstructTMCExternalIPS ¶
func ConstructTMCExternalIPS(data []interface{}) (externalIPs *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCExternalIPS)
func ConstructTMCRequireLabels ¶
func ConstructTMCRequireLabels(data []interface{}) (requireLabels *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCRequireLabels)
func FlattenTMCBlockRolebindingSubjects ¶
func FlattenTMCBlockRolebindingSubjects(roleBindingSubjects *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCBlockRoleBindingSubjects) (data []interface{})
func FlattenTMCCommonRecipe ¶
func FlattenTMCCommonRecipe(commonRecipe *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCCommonRecipe) (data []interface{})
func FlattenTMCCustom ¶ added in v1.4.2
func FlattenTMCCustom(recipeName string, customRecipe *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustom) []interface{}
func FlattenTMCExternalIPS ¶
func FlattenTMCExternalIPS(externalIPs *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCExternalIPS) (data []interface{})
func FlattenTMCRequireLabels ¶
func FlattenTMCRequireLabels(requireLabels *policyrecipecustommodel.VmwareTanzuManageV1alpha1CommonPolicySpecCustomV1TMCRequireLabels) (data []interface{})
func ValidateCustomRecipe ¶ added in v1.4.2
func ValidateCustomRecipe(config authctx.TanzuContext, customRecipe map[string]interface{}) error
func ValidateRecipeParameters ¶ added in v1.4.2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.