Documentation ¶
Overview ¶
Package k8sutil contains utility functions for Kubernetes resources.
Index ¶
- Variables
- func CreationSpecsEqual(m1 metav1.ObjectMeta, m2 metav1.ObjectMeta) bool
- func GetDesktopLabels(c *appv1.VDICluster, desktop *desktopsv1.Session) map[string]string
- func GetThisPod(c client.Client) (*corev1.Pod, error)
- func GetThisPodName() (string, error)
- func GetThisPodNamespace() (string, error)
- func IsMarkedForDeletion(cr *appv1.VDICluster) bool
- func LookupClusterByName(c client.Client, name string) (*appv1.VDICluster, error)
- func SetCreationSpecAnnotation(meta *metav1.ObjectMeta, obj runtime.Object) error
- type LogFollower
Constants ¶
This section is empty.
Variables ¶
var DefaultClient *kubernetes.Clientset
DefaultClient represents a client for performing raw CRUD operations against the Kubernetes API
Functions ¶
func CreationSpecsEqual ¶
func CreationSpecsEqual(m1 metav1.ObjectMeta, m2 metav1.ObjectMeta) bool
CreationSpecsEqual returns true if the two objects spec annotations are equal.
func GetDesktopLabels ¶
func GetDesktopLabels(c *appv1.VDICluster, desktop *desktopsv1.Session) map[string]string
GetDesktopLabels returns the labels to apply to components for a desktop.
func GetThisPod ¶
GetThisPod attempts to return the full pod object of the requesting instance.
func GetThisPodName ¶
GetThisPodName attempts to return the name of the running pod from the environment.
func GetThisPodNamespace ¶
GetThisPodNamespace attempts to return the namespace of the running pod from the environment.
func IsMarkedForDeletion ¶
func IsMarkedForDeletion(cr *appv1.VDICluster) bool
IsMarkedForDeletion returns true if the given cluster is marked for deletion.
func LookupClusterByName ¶
LookupClusterByName fetches the VDICluster with the given name
func SetCreationSpecAnnotation ¶
func SetCreationSpecAnnotation(meta *metav1.ObjectMeta, obj runtime.Object) error
SetCreationSpecAnnotation sets an annotation with a checksum of the desired spec of the object.
Types ¶
type LogFollower ¶
type LogFollower struct {
// contains filtered or unexported fields
}
LogFollower implements a ReadCloser for reading logs from a container in a pod.
func NewLogFollower ¶
func NewLogFollower(pod *corev1.Pod, containerName string) *LogFollower
NewLogFollower returns a new LogFollower for the given pod and container.
func (*LogFollower) Read ¶
func (l *LogFollower) Read(p []byte) (int, error)
Read reads data from the log buffer
func (*LogFollower) Stream ¶
func (l *LogFollower) Stream(follow bool) error
Stream will start the log stream