Documentation
¶
Overview ¶
Package label is to handle label selector for resources
Index ¶
- func CreateOrUpdateLabel(labelType, uid string, resourceKey string, labels map[string]string) error
- func DeleteLabelObject(labelType, uid string) error
- func GetLabels(labelType, uid string) (label model.LabelInfo, err error)
- func GetResourcesByLabelSelector(labelType, labelSelector string) ([]interface{}, error)
- func ListCSPResourceLabel(labelType, uid string, connectionName string) (labels map[string]string)
- func MatchesLabelSelector(labels map[string]string, labelSelector string) bool
- func MergeCSPResourceLabel(labelType, uid string, resourceKey string) error
- func RemoveCSPResourceLabel(labelType, uid string, key string, connectionName string)
- func RemoveLabel(labelType, uid, key string) error
- func UpdateCSPResourceLabel(labelType, uid string, labels map[string]string, connectionName string)
- type CSPSyncConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateLabel ¶
CreateOrUpdateLabel adds a new label or updates an existing label for the given resource, and then persists the updated label information in the Key-Value store.
func DeleteLabelObject ¶ added in v0.9.10
DeleteLabelObject deletes the entire label object for a given resource identified by its labelType and uid.
func GetResourcesByLabelSelector ¶
GetResourcesByLabelSelector retrieves resources based on a label selector.
func ListCSPResourceLabel ¶ added in v0.10.7
ListCSPResourceLabel best-effort lists the labels of a resource in the CSP
func MatchesLabelSelector ¶
MatchesLabelSelector checks if the labels match the given label selector.
func MergeCSPResourceLabel ¶ added in v0.10.7
MergeCSPResourceLabel merges the labels of a resource in the CSP with the existing labels
func RemoveCSPResourceLabel ¶ added in v0.10.7
RemoveCSPResourceLabel best-effort removes the labels of a resource in the CSP
func RemoveLabel ¶
RemoveLabel removes a label from a resource identified by its uid.
Types ¶
type CSPSyncConfig ¶ added in v0.11.3
type CSPSyncConfig struct {
// GlobalSkipResourceTypes contains resource types that should be skipped for all CSPs
GlobalSkipResourceTypes map[string]bool
// CSPSpecificSkipConfig contains CSP-specific skip configurations
CSPSpecificSkipConfig map[string]map[string]bool // map[cspType][resourceType]bool
// CSPGlobalSkip contains CSPs that don't support tags for any resource types
CSPGlobalSkip map[string]bool // map[cspType]bool - if true, skip all resource types for this CSP
}
cspSyncSkipConfig contains resource types and CSP combinations that should be skipped when synchronizing with CSP