Documentation ¶
Index ¶
- func AddTenantPrefix(name string, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) string
- func ArgsAddFlagValue(args map[string]string, flag, value string) bool
- func ArgsFromMapToSlice(args map[string]string) (slice []string)
- func ArgsFromSliceToMap(args []string) (m map[string]string)
- func ArgsRemoveFlag(args map[string]string, flag string) bool
- func CalculateMapChecksum(data any) string
- func CommonLabels(clusterName string) map[string]string
- func CreateOrUpdateWithConflict(ctx context.Context, client client.Client, resource client.Object, ...) (res controllerutil.OperationResult, err error)
- func DecodeFromJSON(o string, to runtime.Object) (err error)
- func DecodeFromYAML(o string, to runtime.Object) (err error)
- func EncodeToJSON(o runtime.Object) ([]byte, error)
- func EncodeToYaml(o runtime.Object) ([]byte, error)
- func GetRESTClientConfig(ctx context.Context, client client.Client, ...) (*restclient.Config, error)
- func GetTenantClient(ctx context.Context, c client.Client, ...) (client.Client, error)
- func GetTenantClientSet(ctx context.Context, client client.Client, ...) (*clientset.Clientset, error)
- func GetTenantKubeconfig(ctx context.Context, client client.Client, ...) (*clientcmdapiv1.Config, error)
- func HasNamedContainer(container []corev1.Container, name string) (found bool, index int)
- func HasNamedVolume(volumes []corev1.Volume, name string) (found bool, index int)
- func HasNamedVolumeMount(volumeMounts []corev1.VolumeMount, name string) (found bool, index int)
- func KamajiLabels() map[string]string
- func MD5Checksum(value []byte) string
- func MergeMaps(maps ...map[string]string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTenantPrefix ¶
func AddTenantPrefix(name string, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) string
func ArgsAddFlagValue ¶ added in v0.1.0
ArgsAddFlagValue performs upsert of a flag in the arguments map, returning true if created.
func ArgsFromMapToSlice ¶ added in v0.1.0
ArgsFromMapToSlice create the slice of args, and sorting the resulting output in order to make it idempotent. Along with that, if a flag doesn't have a value, it's presented barely without a value assignment.
func ArgsFromSliceToMap ¶ added in v0.1.0
ArgsFromSliceToMap transforms a slice of string into a map, simplifying the subsequent mangling.
func ArgsRemoveFlag ¶ added in v0.1.0
ArgsRemoveFlag removes a flag from the arguments map, returning true if found and removed.
func CalculateMapChecksum ¶ added in v0.1.0
CalculateMapChecksum orders the map according to its key, and calculating the overall md5 of the values. It's expected to work with ConfigMap (map[string]string) and Secrets (map[string][]byte).
func CommonLabels ¶
func CreateOrUpdateWithConflict ¶ added in v0.1.0
func CreateOrUpdateWithConflict(ctx context.Context, client client.Client, resource client.Object, f controllerutil.MutateFn) (res controllerutil.OperationResult, err error)
CreateOrUpdateWithConflict is a helper function that wraps the RetryOnConflict around the CreateOrUpdate function: this allows to fetch from the cache the latest modified object an try to apply the changes defined in the MutateFn without enqueuing back the request in order to get the latest changes of the resource.
func EncodeToJSON ¶ added in v0.1.0
EncodeToJSON returns the given object in JSON format and the error, respecting the Kubernetes struct tags.
func EncodeToYaml ¶ added in v0.1.0
EncodeToYaml returns the given object in yaml format and the error.
func GetRESTClientConfig ¶ added in v0.2.0
func GetRESTClientConfig(ctx context.Context, client client.Client, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (*restclient.Config, error)
func GetTenantClient ¶ added in v0.1.0
func GetTenantClient(ctx context.Context, c client.Client, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (client.Client, error)
func GetTenantClientSet ¶ added in v0.1.0
func GetTenantClientSet(ctx context.Context, client client.Client, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (*clientset.Clientset, error)
func GetTenantKubeconfig ¶ added in v0.1.0
func GetTenantKubeconfig(ctx context.Context, client client.Client, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (*clientcmdapiv1.Config, error)
func HasNamedContainer ¶ added in v0.1.0
HasNamedContainer finds the Container in the provided slice by its name, returning a boolean if found, and its index.
func HasNamedVolume ¶ added in v0.1.0
HasNamedVolume finds the Volume in the provided slice by its name, returning a boolean if found, and its index.
func HasNamedVolumeMount ¶ added in v0.1.0
func HasNamedVolumeMount(volumeMounts []corev1.VolumeMount, name string) (found bool, index int)
HasNamedVolumeMount finds the VolumeMount in the provided slice by its name, returning a boolean if found, and its index.
func KamajiLabels ¶
func MD5Checksum ¶ added in v0.1.0
Types ¶
This section is empty.