Documentation ¶
Index ¶
- Constants
- func FromGVKtoGVR(discoveryClient discovery.DiscoveryInterface, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func GetChecksum(content []byte) string
- func GetMiaAnnotation(name string) string
- func GetPodSpec(volumes *[]corev1.Volume, containers *[]corev1.Container) corev1.PodSpec
- func GetPodsDependencies(podSpec corev1.PodSpec) map[string][]string
- func IsNotUsingSemver(target *Resource) (bool, error)
- func MapSecretAndConfigMap(resources []Resource) (map[string]string, map[string]string, error)
- type Resource
Constants ¶
const ( // ManagedByLabel is the label used to identify the agent // responsible of deploying the resources into the cluster. ManagedByLabel = "app.kubernetes.io/managed-by" // ManagedByMia is used to identify the resources deployed // with `mlp`. ManagedByMia = "mia-platform" // ConfigMap is the resource kind for ConfigMaps. ConfigMap = "ConfigMap" // Secret is the resource kind for Secrets. Secret = "Secret" )
Variables ¶
This section is empty.
Functions ¶
func FromGVKtoGVR ¶
func FromGVKtoGVR(discoveryClient discovery.DiscoveryInterface, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
func GetChecksum ¶
GetChecksum is used to calculate a checksum using an array of bytes
func GetMiaAnnotation ¶
GetMiaAnnotation is used to get an annotation name following a pattern used in mia-platform
func GetPodSpec ¶
GetPodSpec get a podSpec
func GetPodsDependencies ¶
GetPodsDependencies returns a map where keys are Secret and ConfigMap and each key has a list of dependencies of that kind
func IsNotUsingSemver ¶
IsNotUsingSemver is used to check if a resoure is following semver or not
Types ¶
type Resource ¶
type Resource struct { Filepath string GroupVersionKind *schema.GroupVersionKind Object unstructured.Unstructured }
Resource a resource reppresentation
func AddManagedByMiaLabel ¶
func MakeResources ¶
MakeResources creates a resource list and sorts them according to the standard ordering strategy
func NewResources ¶
NewResources creates new Resources from a file at `filepath` support multiple documents inside a single file
func SortResourcesByKind ¶
SortResourcesByKind Results are sorted by 'ordering', keeping order of items with equal kind/priority