commonscope

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagementClusterNameKey = "management_cluster_name"
	ProvisionerNameKey       = "provisioner_name"
	NameKey                  = "name"
	ScopeKey                 = "scope"
	AttachedValue            = "attached"
	ClusterKey               = "cluster"
	ClusterGroupKey          = "cluster_group"
	ClusterGroupNameKey      = "cluster_group_name"
	BatchUIDAnnotationKey    = "tmc.cloud.vmware.com/source-uid"
)

Variables

This section is empty.

Functions

func GetScopeSchema

func GetScopeSchema(opts ...SchemaOption) *schema.Schema

func MetaResourceAttributeCheck

func MetaResourceAttributeCheck(resourceName string) []resource.TestCheckFunc

Types

type Cluster

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

type ClusterGroup

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

type SchemaConfig

type SchemaConfig struct {
	Description string
	Scopes      []string
}

type SchemaOption

type SchemaOption func(*SchemaConfig)

func WithDescription

func WithDescription(d string) SchemaOption

func WithScopes

func WithScopes(s []string) SchemaOption

type Scope

type Scope int64
const (
	UnknownScope Scope = iota
	ClusterScope
	ClusterGroupScope
	WorkspaceScope
)

Scopes.

type ScopeHelperResources

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

func NewScopeHelperResources

func NewScopeHelperResources() *ScopeHelperResources

func (*ScopeHelperResources) GetTestResourceHelperAndScope

func (shr *ScopeHelperResources) GetTestResourceHelperAndScope(scopeType Scope, scopesAllowed []string) (string, string)

GetTestResourceHelperAndScope builds the helper resource and scope blocks for git repository resource based on a scope type.

type ValidateScopeType

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

func ValidateScope

func ValidateScope(scopesAllowed []string) ValidateScopeType

type Workspace

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

Jump to

Keyboard shortcuts

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