Documentation ¶
Index ¶
- func AddLabel(labels, addLabels map[string]string)
- func AsSecrets(namespace string, owner metav1.OwnerReference, certdata *certs.Certificates) ([]*corev1.Secret, error)
- func BuildOutsideClusterConfig() (*rest.Config, error)
- func CloneAndAddLabel(labels, addLabels map[string]string) map[string]string
- func CloneLabel(labels map[string]string) map[string]string
- func ComputeHash(object interface{}) string
- func Contains(list []string, s string) bool
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func GetClientsOrDie(inCluster bool, scheme *runtime.Scheme) (kubernetes.Interface, versioned.Interface, client.Client)
- func GetEnvOrDefault(key, defaultValue string) string
- func GetEnvVarFromMap(envVars map[string]string) []corev1.EnvVar
- func GetFullImageName(registry, imageName, tag string) string
- func GetInstanceOfObj(obj interface{}) client.Object
- func GetKeyFromEnvVar(envVars []corev1.EnvVar, key string) string
- func GetMapFromEnvVar(envVarLists ...[]corev1.EnvVar) map[string]string
- func GetPatchData(oldObj, newObj interface{}) ([]byte, error)
- func GetScheme() *runtime.Scheme
- func IsDeploymentPaused(ctx context.Context, client kubernetes.Interface, name, namespace string) bool
- func IsDeploymentReady(ctx context.Context, client kubernetes.Interface, name, namespace string) bool
- func IsPodActive(ctx context.Context, client kubernetes.Interface, pod *corev1.Pod) bool
- func MergeEnvVars(envVarLists ...[]corev1.EnvVar) []corev1.EnvVar
- func NewClusterRoleBindingInformer(factory informers.SharedInformerFactory) rbacinformers.ClusterRoleBindingInformer
- func NewDaemonSetInformer(factory informers.SharedInformerFactory) appsinformers.DaemonSetInformer
- func NewDeploymentInformer(factory informers.SharedInformerFactory) appsinformers.DeploymentInformer
- func NewHistoryInformer(factory informers.SharedInformerFactory) appsinformers.ControllerRevisionInformer
- func NewInformerFactory(client kubernetes.Interface) informers.SharedInformerFactory
- func NewIngressInformer(factory informers.SharedInformerFactory) netsinformers.IngressInformer
- func NewOrchestClusterInformer(ocClient versioned.Interface) orchestinformers.OrchestClusterInformer
- func NewOrchestComponentInformer(ocClient versioned.Interface) orchestinformers.OrchestComponentInformer
- func NewServiceAccountInformer(factory informers.SharedInformerFactory) coreinformers.ServiceAccountInformer
- func NewServiceInformer(factory informers.SharedInformerFactory) coreinformers.ServiceInformer
- func NewrClusterRoleInformer(factory informers.SharedInformerFactory) rbacinformers.ClusterRoleInformer
- func OutputCerts(ctx context.Context, namespace string, owner metav1.OwnerReference, ...) error
- func Remove(list []string, s string) []string
- func UpsertEnvVariable(envVarList *[]corev1.EnvVar, eEnvVarMap map[string]string, update bool) bool
- func WriteSecretsKube(ctx context.Context, client kubernetes.Interface, secrets []*corev1.Secret) error
- type KubernetesDistros
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsSecrets ¶
func AsSecrets(namespace string, owner metav1.OwnerReference, certdata *certs.Certificates) ([]*corev1.Secret, error)
This function is borrowed from projectcountour AsSecrets transforms the given Certificates struct into a slice of Secrets in in compact Secret format, which is compatible with both cert-manager and Contour.
func BuildOutsideClusterConfig ¶
BuildOutsideClusterConfig returns k8s config
func CloneAndAddLabel ¶
func ComputeHash ¶
func ComputeHash(object interface{}) string
func DeepHashObject ¶
func GetClientsOrDie ¶
func GetEnvOrDefault ¶
func GetFullImageName ¶
func GetInstanceOfObj ¶
func GetPatchData ¶
func IsDeploymentPaused ¶
func IsDeploymentPaused(ctx context.Context, client kubernetes.Interface, name, namespace string) bool
IsDeploymentPaused checks if the deployment is paused
func IsDeploymentReady ¶
func IsDeploymentReady(ctx context.Context, client kubernetes.Interface, name, namespace string) bool
IsDeploymentReady checks if the number of required replicas is equal to number of created replicas
func IsPodActive ¶
func NewClusterRoleBindingInformer ¶
func NewClusterRoleBindingInformer(factory informers.SharedInformerFactory) rbacinformers.ClusterRoleBindingInformer
func NewDaemonSetInformer ¶
func NewDaemonSetInformer(factory informers.SharedInformerFactory) appsinformers.DaemonSetInformer
func NewDeploymentInformer ¶
func NewDeploymentInformer(factory informers.SharedInformerFactory) appsinformers.DeploymentInformer
func NewHistoryInformer ¶
func NewHistoryInformer(factory informers.SharedInformerFactory) appsinformers.ControllerRevisionInformer
func NewInformerFactory ¶
func NewInformerFactory(client kubernetes.Interface) informers.SharedInformerFactory
func NewIngressInformer ¶
func NewIngressInformer(factory informers.SharedInformerFactory) netsinformers.IngressInformer
func NewOrchestClusterInformer ¶
func NewOrchestClusterInformer(ocClient versioned.Interface) orchestinformers.OrchestClusterInformer
func NewOrchestComponentInformer ¶
func NewOrchestComponentInformer(ocClient versioned.Interface) orchestinformers.OrchestComponentInformer
func NewServiceAccountInformer ¶
func NewServiceAccountInformer(factory informers.SharedInformerFactory) coreinformers.ServiceAccountInformer
func NewServiceInformer ¶
func NewServiceInformer(factory informers.SharedInformerFactory) coreinformers.ServiceInformer
func NewrClusterRoleInformer ¶
func NewrClusterRoleInformer(factory informers.SharedInformerFactory) rbacinformers.ClusterRoleInformer
func OutputCerts ¶
func OutputCerts(ctx context.Context, namespace string, owner metav1.OwnerReference, client kubernetes.Interface, certs *certs.Certificates) error
This function is borrowed from projectcountour OutputCerts outputs the certs in certs as directed by config.
func UpsertEnvVariable ¶
UpsertEnvVariable inserts the env variable from map to the list is not exist or update it if replace it true and returns true if changed the envVarList
func WriteSecretsKube ¶
func WriteSecretsKube(ctx context.Context, client kubernetes.Interface, secrets []*corev1.Secret) error
This function is borrowed from projectcountour WriteSecretsKube writes all the keypairs out to Kubernetes Secrets in the compact format which is compatible with Secrets generated by cert-manager.
Types ¶
type KubernetesDistros ¶
type KubernetesDistros string
const ( CACertificateKey = "ca.crt" // Kubernetes distributions NotDetected KubernetesDistros = "" Minikube KubernetesDistros = "minikube" Microk8s KubernetesDistros = "microk8s" EKS KubernetesDistros = "eks" GKE KubernetesDistros = "gke" K3s KubernetesDistros = "k3s" DockerDesktop KubernetesDistros = "docker-desktop" )
func DetectK8sDistribution ¶
func DetectK8sDistribution(client kubernetes.Interface) KubernetesDistros