Documentation ¶
Index ¶
- Constants
- Variables
- func GetClusterFromWlid(wlid string) string
- func GetK8SKindFronList(kind string) string
- func GetK8sWLID(level0, level1, k, name string) string
- func GetKindFromWlid(wlid string) string
- func GetNameFromWlid(wlid string) string
- func GetNamespaceFromWlid(wlid string) string
- func GetNativeWLID(level0, level1, k, name string) string
- func GetWLID(level0, level1, k, name string) string
- func IsK8SKindInList(kind string) bool
- func IsSid(id string) bool
- func IsWlid(id string) bool
- func IsWlidValid(wlid string) error
- func RestoreMicroserviceIDs(spiffe string) []string
- func RestoreMicroserviceIDsFromSpiffe(spiffe string) ([]string, error)
- func StringHasWhitespace(str string) bool
- func WildWlidContainsWlid(wildWlid, wlid string) bool
- type SpiffeBasicInfo
Constants ¶
View Source
const (
SpiffePrefix = "://"
)
wlid/ sid utils
Variables ¶
View Source
var ( WlidPrefix = "wlid://" SidPrefix = "sid://" ClusterWlidPrefix = "cluster-" NamespaceWlidPrefix = "namespace-" DataCenterWlidPrefix = "datacenter-" ProjectWlidPrefix = "project-" SecretSIDPrefix = "secret-" SubSecretSIDPrefix = "subsecret-" K8SKindsList = []string{"ComponentStatus", "ConfigMap", "ControllerRevision", "CronJob", "CustomResourceDefinition", "DaemonSet", "Deployment", "Endpoints", "Event", "HorizontalPodAutoscaler", "Ingress", "Job", "Lease", "LimitRange", "LocalSubjectAccessReview", "MutatingWebhookConfiguration", "Namespace", "NetworkPolicy", "Node", "PersistentVolume", "PersistentVolumeClaim", "Pod", "PodDisruptionBudget", "PodSecurityPolicy", "PodTemplate", "PriorityClass", "ReplicaSet", "ReplicationController", "ResourceQuota", "Role", "RoleBinding", "Secret", "SelfSubjectAccessReview", "SelfSubjectRulesReview", "Service", "ServiceAccount", "StatefulSet", "StorageClass", "SubjectAccessReview", "TokenReview", "ValidatingWebhookConfiguration", "VolumeAttachment"} NativeKindsList = []string{"Dockerized", "Native"} KindReverseMap = map[string]string{} )
Functions ¶
func GetClusterFromWlid ¶
GetClusterFromWlid parse wlid and get cluster
func GetK8SKindFronList ¶
GetK8SKindFronList get the calculated wlid
func GetK8sWLID ¶
GetK8sWLID get the k8s calculated wlid
func GetKindFromWlid ¶
GetKindFromWlid parse wlid and get kind
func GetNameFromWlid ¶
GetNameFromWlid parse wlid and get name
func GetNamespaceFromWlid ¶
GetNamespaceFromWlid parse wlid and get Namespace
func GetNativeWLID ¶
GetNativeWLID get the native calculated wlid
func IsK8SKindInList ¶
IsK8SKindInList Check if the kind is a known kind
func RestoreMicroserviceIDs ¶
RestoreMicroserviceIDsFromSpiffe -
func RestoreMicroserviceIDsFromSpiffe ¶
RestoreMicroserviceIDsFromSpiffe -
func StringHasWhitespace ¶
StringHasWhitespace check if a string has whitespace
func WildWlidContainsWlid ¶
WildWlidContainsWlid does WildWlid contains Wlid
Types ¶
type SpiffeBasicInfo ¶
type SpiffeBasicInfo struct { //cluster/datacenter Level0 string `json:"level0"` Level0Type string `json:"level0Type"` //namespace/project Level1 string `json:"level0"` Level1Type string `json:"level0Type"` Kind string `json:"kind"` Name string `json:"name"` }
represents workload basic info
func SpiffeToSpiffeInfo ¶
func SpiffeToSpiffeInfo(spiffe string) (*SpiffeBasicInfo, error)
Click to show internal directories.
Click to hide internal directories.