Documentation
¶
Index ¶
- Variables
- func GetDeployment(ctx context.Context, client *kubernetes.Clientset, service KindNamespaceName) (*appsv1.Deployment, error)
- func GetPods(ctx context.Context, client *kubernetes.Clientset, namespace string, ...) ([]corev1.Pod, error)
- func GetStatefulset(ctx context.Context, client *kubernetes.Clientset, service KindNamespaceName) (*appsv1.StatefulSet, error)
- func RestartService(ctx context.Context, clientset *kubernetes.Clientset, lock *lock.Lock, ...) error
- type KindNamespaceName
- type PodStatus
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidKindNamespaceNameFormat = fmt.Errorf("invalid format") ErrInvalidKind = fmt.Errorf("invalid kind") )
Functions ¶
func GetDeployment ¶
func GetDeployment(ctx context.Context, client *kubernetes.Clientset, service KindNamespaceName) (*appsv1.Deployment, error)
func GetPods ¶ added in v0.3.0
func GetPods(ctx context.Context, client *kubernetes.Clientset, namespace string, selector map[string]string) ([]corev1.Pod, error)
GetPods returns a list of pods, identified by the selectors
func GetStatefulset ¶
func GetStatefulset(ctx context.Context, client *kubernetes.Clientset, service KindNamespaceName) (*appsv1.StatefulSet, error)
func RestartService ¶
func RestartService(ctx context.Context, clientset *kubernetes.Clientset, lock *lock.Lock, service KindNamespaceName) error
Types ¶
type KindNamespaceName ¶
type KindNamespaceName struct { Kind string `json:"kind"` Name string `json:"name"` Namespace string `json:"namespace"` }
func KindNamespaceNameFromString ¶ added in v0.2.0
func KindNamespaceNameFromString(s string) (*KindNamespaceName, error)
KindNamespaceNameFromString parses a string into a KindNamespaceName The string should be in the format of "Kind/Namespace/Name"
Example:
KindNamespaceNameFromString("Deployment/my-namespace/my-deployment")
This will return a KindNamespaceName with Kind: Deployment, Namespace: my-namespace, Name: my-deployment
func (KindNamespaceName) String ¶
func (s KindNamespaceName) String() string
type PodStatus ¶
func PodStatuses ¶ added in v0.3.0
PodStatuses checks if the restart for the deployment or statefulset is complete It returns a map of pod status and the number of pods with that status as well as a boolean indicating if the restart is complete. If the passed pod list is empty, we treat the restart as complete If from the passed pod list, the first pod doesn't have an owner reference, we treat the restart as complete If from the passed pod list, the first pod doesn't have an owner reference of kind replicaset or statefulset, we treat the restart as complete In all other cases, we check the status of the pod and add it to the map If there are no pods, we treat the restart as complete