Documentation ¶
Overview ¶
Package devenvutil contains devenv utilities
Index ¶
- func Backoff(ctx context.Context, d time.Duration, max uint64, fn func() error, ...) error
- func ContainerStatusInfo(cs *corev1.ContainerStatus) map[string]interface{}
- func DeleteObjects(ctx context.Context, log logrus.FieldLogger, k kubernetes.Interface, ...) error
- func EnsureDevenvRunning(ctx context.Context, conf *config.Config, b *box.Config) (kubernetesruntime.Runtime, error)
- func EnsureDockerIsRunning() (bool, error)
- func FindUnreadyPods(ctx context.Context, k kubernetes.Interface) ([]string, []*corev1.Pod, error)
- func GetIngressControllerIP(ctx context.Context, k kubernetes.Interface, log logrus.FieldLogger) string
- func PodStateInfo(p *corev1.Pod) map[string]interface{}
- func PodsStateInfo(pods []*corev1.Pod) map[string]interface{}
- func WaitForAllPodsToBeReady(ctx context.Context, k kubernetes.Interface, log logrus.FieldLogger, ...) error
- func WaitForDevenv(ctx context.Context, sopt *status.Options, log logrus.FieldLogger) error
- type DeleteObjectsObjects
- type ListableType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backoff ¶
func Backoff(ctx context.Context, d time.Duration, max uint64, fn func() error, log logrus.FieldLogger) error
Backoff is a light wrapper around the backoff library
func ContainerStatusInfo ¶
func ContainerStatusInfo(cs *corev1.ContainerStatus) map[string]interface{}
ContainerStatusInfo writes the container status to a string
func DeleteObjects ¶
func DeleteObjects(ctx context.Context, log logrus.FieldLogger, k kubernetes.Interface, conf *rest.Config, opts DeleteObjectsObjects) error
func EnsureDevenvRunning ¶
func EnsureDevenvRunning(ctx context.Context, conf *config.Config, b *box.Config) (kubernetesruntime.Runtime, error)
EnsureDevenvRunning returns an error if the developer environment is not running. Additionally does a precheck to ensure docker is running before.
func EnsureDockerIsRunning ¶ added in v1.57.0
EnsureDockerIsRunning checks if docker is running. Returns a boolean
func FindUnreadyPods ¶
FindUnreadyPods checks all namespaces to find pods that are unready, they are then returned. If an error occurs, err is returned.
func GetIngressControllerIP ¶
func GetIngressControllerIP(ctx context.Context, k kubernetes.Interface, log logrus.FieldLogger) string
GetIngressControllerIP finds the IP address of the ingress controller being used in the devenv
func PodStateInfo ¶
PodStateInfo writes the pod info to a string
func PodsStateInfo ¶
PodsStateInfo returns a string per pod with the state
func WaitForAllPodsToBeReady ¶
func WaitForAllPodsToBeReady(ctx context.Context, k kubernetes.Interface, log logrus.FieldLogger, timeout time.Duration) error
WaitForAllPodsToBeReady waits for all pods to be unready.
If timeout is 0, a default of 20 minutes is used.
func WaitForDevenv ¶
WaitForDevenv waits for the developer environment to be up and handle context cancellation. This blocks until finished.
Types ¶
type DeleteObjectsObjects ¶
type DeleteObjectsObjects struct { // Type is the type of object that should be deleted. Type runtime.Object // Namespaces is a list of namespaces that objects should be deleted in Namespaces []string // Validator is a function that returns if an item should be filtered // or not. Validator func(obj *unstructured.Unstructured) (filter bool) }
type ListableType ¶
type ListableType interface {
List(context.Context, metav1.ListOptions) (interface{}, error)
}