common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaKey        = "meta"
	LabelsKey      = "labels"
	DescriptionKey = "description"

	CreatorLabelKey = "tmc.cloud.vmware.com/creator"
)

Variables

View Source
var Meta = &schema.Schema{
	Type:        schema.TypeList,
	Description: "Metadata for the resource",
	Computed:    true,
	Optional:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			annotationsKey: {
				Type:        schema.TypeMap,
				Description: "Annotations for the resource",
				Optional:    true,
				Computed:    true,
				Elem:        &schema.Schema{Type: schema.TypeString},
				DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
					if strings.Contains(k, "tmc.cloud.vmware.com") ||
						strings.Contains(k, "x-customer-domain") ||
						strings.Contains(k, "GeneratedTemplateID") {
						return true
					}
					return false
				},
			},
			LabelsKey: {
				Type:        schema.TypeMap,
				Description: "Labels for the resource",
				Optional:    true,
				Elem:        &schema.Schema{Type: schema.TypeString},
				DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
					return strings.Contains(k, "tmc.cloud.vmware.com")
				},
			},
			DescriptionKey: {
				Type:        schema.TypeString,
				Description: "Description of the resource",
				Optional:    true,
			},
			uidKey: {
				Type:        schema.TypeString,
				Description: "UID of the resource",
				Computed:    true,
			},
			resourceVersionKey: {
				Type:        schema.TypeString,
				Description: "Resource version of the resource",
				Computed:    true,
			},
		},
	},
}

Functions

func FlattenMeta

func FlattenMeta(objectMeta *objectmetamodel.VmwareTanzuCoreV1alpha1ObjectMeta) (data []interface{})

func GetTypeIntMapData added in v1.1.5

func GetTypeIntMapData(data map[string]interface{}) map[string]int

func GetTypeStringMapData added in v1.1.5

func GetTypeStringMapData(data map[string]interface{}) map[string]string

func HasMetaChanged

func HasMetaChanged(d *schema.ResourceData) bool

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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