Documentation ¶
Index ¶
- func FlattenLabelSelector(labelSelector *metav1.LabelSelector) (string, error)
- func GetDeploymentAnnotations(deploy appsv1.Deployment) map[string]string
- func GetDeploymentResourceVersion(deploy appsv1.Deployment) string
- func GetStsAnnotations(sts appsv1.StatefulSet) map[string]string
- func GetStsResourceVersion(sts appsv1.StatefulSet) string
- func MockDeployment(name, namespace string) *v1.Deployment
- func MockIngress(name, namespace string) *netv1.Ingress
- func MockPod(name, namespace string) *corev1.Pod
- func MockReplicaset(name, namespace string) *v1.ReplicaSet
- func MockSecret(name, namespace string, data map[string][]byte) *corev1.Secret
- func MockStatefulSet(name, namespace string) *v1.StatefulSet
- func MockTemplateSpec(containerName, image, pullSecret string) corev1.PodTemplateSpec
- func ParseDeploymentInfo(deploy appsv1.Deployment, conIndx int) (string, string, error)
- func ParseStatefulSetInfo(sts appsv1.StatefulSet, conIndx int) (string, string, error)
- func RemoveDeploymentAnnotation(deploy appsv1.Deployment, annotation, value string)
- func RemoveStsAnnotation(sts appsv1.StatefulSet, annotation, value string)
- func SetDeploymentAnnotation(deploy appsv1.Deployment, annotation, value string)
- func SetDeploymentImage(deploy appsv1.Deployment, image string, conIndx int)
- func SetDeploymentImagePullSecret(deploy appsv1.Deployment, imagePullSecret string)
- func SetStatefulSetImage(sts appsv1.StatefulSet, image string, conIndx int)
- func SetStsAnnotation(sts appsv1.StatefulSet, annotation, value string)
- func SetStsImagePullSecret(sts appsv1.StatefulSet, imagePullSecret string)
- type K8sClient
- func (c *K8sClient) CreateNamespace(name string) error
- func (c *K8sClient) CreateRole(name, namespace string, rules []rbacv1.PolicyRule) error
- func (c *K8sClient) CreateRoleBinding(name, namespace string, roleRef rbacv1.RoleRef, subject rbacv1.Subject) error
- func (c *K8sClient) CreateSecret(name, namespace string, secType corev1.SecretType, data map[string]interface{}) error
- func (c *K8sClient) CreateServiceAccount(name, namespace string) (*corev1.ServiceAccount, error)
- func (c *K8sClient) DeleteIngress(namespace, name string) error
- func (c *K8sClient) DeleteSecret(name, namespace string) error
- func (c *K8sClient) GetAnnotatedPullSecrets(namespace string, annotations map[string]string) ([]corev1.Secret, error)
- func (c *K8sClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (c *K8sClient) GetIngress(namespace, name string) (*netv1.Ingress, error)
- func (c *K8sClient) GetRole(name, namespace string) (*rbacv1.Role, error)
- func (c *K8sClient) GetRoleBinding(name, namespace string) (*rbacv1.RoleBinding, error)
- func (c *K8sClient) GetSecrets(namespace string) ([]corev1.Secret, error)
- func (c *K8sClient) GetServiceAccount(name, namespace string) (*corev1.ServiceAccount, error)
- func (c *K8sClient) GetStatefulSet(namespace, name string) (*appsv1.StatefulSet, error)
- func (c *K8sClient) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
- func (c *K8sClient) ListIngresses(namespace string) (*netv1.IngressList, error)
- func (c *K8sClient) ListRoles(namespace string) (*rbacv1.RoleList, error)
- func (c *K8sClient) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
- func (c *K8sClient) ReadSecret(name, namespace string) (map[string][]byte, error)
- func (c *K8sClient) UpdateDeployment(deploy *appsv1.Deployment) error
- func (c *K8sClient) UpdateSecret(name, namespace string, data map[string]interface{}) error
- func (c *K8sClient) UpdateStatefulSet(sts *appsv1.StatefulSet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenLabelSelector ¶
func FlattenLabelSelector(labelSelector *metav1.LabelSelector) (string, error)
func GetDeploymentAnnotations ¶
func GetDeploymentAnnotations(deploy appsv1.Deployment) map[string]string
func GetDeploymentResourceVersion ¶
func GetDeploymentResourceVersion(deploy appsv1.Deployment) string
func GetStsAnnotations ¶
func GetStsAnnotations(sts appsv1.StatefulSet) map[string]string
func GetStsResourceVersion ¶
func GetStsResourceVersion(sts appsv1.StatefulSet) string
func MockDeployment ¶
func MockDeployment(name, namespace string) *v1.Deployment
func MockIngress ¶
func MockReplicaset ¶
func MockReplicaset(name, namespace string) *v1.ReplicaSet
func MockStatefulSet ¶
func MockStatefulSet(name, namespace string) *v1.StatefulSet
func MockTemplateSpec ¶
func MockTemplateSpec(containerName, image, pullSecret string) corev1.PodTemplateSpec
func ParseDeploymentInfo ¶
ParseDeploymentInfo returns image and its pull secret for a given container in the Deployment
func ParseStatefulSetInfo ¶
ParseStatefulSetInfo returns image and its pull secret for a given container in the StatefulSet
func RemoveDeploymentAnnotation ¶
func RemoveDeploymentAnnotation(deploy appsv1.Deployment, annotation, value string)
func RemoveStsAnnotation ¶
func RemoveStsAnnotation(sts appsv1.StatefulSet, annotation, value string)
func SetDeploymentAnnotation ¶
func SetDeploymentAnnotation(deploy appsv1.Deployment, annotation, value string)
func SetDeploymentImage ¶
func SetDeploymentImage(deploy appsv1.Deployment, image string, conIndx int)
func SetDeploymentImagePullSecret ¶
func SetDeploymentImagePullSecret(deploy appsv1.Deployment, imagePullSecret string)
func SetStatefulSetImage ¶
func SetStatefulSetImage(sts appsv1.StatefulSet, image string, conIndx int)
func SetStsAnnotation ¶
func SetStsAnnotation(sts appsv1.StatefulSet, annotation, value string)
func SetStsImagePullSecret ¶
func SetStsImagePullSecret(sts appsv1.StatefulSet, imagePullSecret string)
Types ¶
type K8sClient ¶
type K8sClient struct {
Client kubernetes.Interface
}
Client for K8s API interactions
func NewMockClient ¶
NewMockClient returns an initialized Mock Client object
func (*K8sClient) CreateNamespace ¶
CreateNamespace creates a namespace with a given name
func (*K8sClient) CreateRole ¶ added in v0.1.2
func (c *K8sClient) CreateRole(name, namespace string, rules []rbacv1.PolicyRule) error
func (*K8sClient) CreateRoleBinding ¶ added in v0.1.2
func (*K8sClient) CreateSecret ¶
func (c *K8sClient) CreateSecret(name, namespace string, secType corev1.SecretType, data map[string]interface{}) error
CreateSecret creates a K8s secret with a given name from a given map
func (*K8sClient) CreateServiceAccount ¶ added in v0.1.2
func (c *K8sClient) CreateServiceAccount(name, namespace string) (*corev1.ServiceAccount, error)
func (*K8sClient) DeleteIngress ¶
func (*K8sClient) DeleteSecret ¶
DeleteSecret delete a K8s secret with a given name
func (*K8sClient) GetAnnotatedPullSecrets ¶
func (c *K8sClient) GetAnnotatedPullSecrets(namespace string, annotations map[string]string) ([]corev1.Secret, error)
GetAnnotatedPullSecrets get a K8s secret with a given name and annotations
func (*K8sClient) GetDeployment ¶
func (c *K8sClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
func (*K8sClient) GetIngress ¶
func (*K8sClient) GetRoleBinding ¶ added in v0.1.2
func (c *K8sClient) GetRoleBinding(name, namespace string) (*rbacv1.RoleBinding, error)
func (*K8sClient) GetSecrets ¶
GetSecrets get a K8s secret with a given name
func (*K8sClient) GetServiceAccount ¶ added in v0.1.2
func (c *K8sClient) GetServiceAccount(name, namespace string) (*corev1.ServiceAccount, error)
func (*K8sClient) GetStatefulSet ¶
func (c *K8sClient) GetStatefulSet(namespace, name string) (*appsv1.StatefulSet, error)
func (*K8sClient) ListDeployments ¶
func (c *K8sClient) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
func (*K8sClient) ListIngresses ¶
func (c *K8sClient) ListIngresses(namespace string) (*netv1.IngressList, error)
func (*K8sClient) ListStatefulSets ¶
func (c *K8sClient) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
ListStatefulSets returns a list of stateful sets in a given namespace with enabled auto updates
func (*K8sClient) ReadSecret ¶
ReadSecret reads a K8s secret with a given name
func (*K8sClient) UpdateDeployment ¶
func (c *K8sClient) UpdateDeployment(deploy *appsv1.Deployment) error
UpdateDeployment applies update with given deployment
func (*K8sClient) UpdateSecret ¶
UpdateSecret updates a K8s secret with a given name from a given map and creates one if it's absent
func (*K8sClient) UpdateStatefulSet ¶
func (c *K8sClient) UpdateStatefulSet(sts *appsv1.StatefulSet) error
UpdateStatefulSet applies update with given deployment