Documentation ¶
Index ¶
- func GetNamePrefix(am discoblocksondatiov1.AvailabilityMode, configUID, nodeName string) string
- func GetTargetNodeByAffinity(affinit *corev1.Affinity) string
- func Hash(s string) (uint32, error)
- func IsContainsAll(a, b map[string]string) bool
- func IsOwnedByDaemonSet(pod *corev1.Pod) bool
- func NewStorageClass(sc *storagev1.StorageClass, scAllowedTopology []corev1.TopologySelectorTerm) (*storagev1.StorageClass, error)
- func PVCDecorator(config *discoblocksondatiov1.DiskConfig, prefix string, driver *drivers.Driver, ...)
- func ParseCapacity(capacity string) (uint16, string, error)
- func ReadFileOrDie(path string) []byte
- func RenderFinalizer(name string, extras ...string) string
- func RenderMetricsProxySidecar(name, namespace string) (*corev1.Container, error)
- func RenderMetricsSidecar() (*corev1.Container, error)
- func RenderMountJob(podName, pvcName, pvName, namespace, nodeName, fs, mountPoint string, ...) (*batchv1.Job, error)
- func RenderMountPoint(pattern, name string, index int) string
- func RenderResizeJob(...) (*batchv1.Job, error)
- func RenderResourceName(prefix bool, elems ...string) (string, error)
- func RenderUniqueLabel(id string) string
- func WaitForSemaphore(ctx context.Context, sem Semaphore) (func(), error)
- type EventService
- type Semaphore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNamePrefix ¶ added in v0.0.5
func GetNamePrefix(am discoblocksondatiov1.AvailabilityMode, configUID, nodeName string) string
GetNamePrefix returns the prefix by availability type
func GetTargetNodeByAffinity ¶ added in v0.0.6
GetTargetNodeByAffinity tries to find node by affinity
func IsContainsAll ¶
IsContainsAll finds for a contains all b
func IsOwnedByDaemonSet ¶ added in v0.0.6
IsOwnedByDaemonSet detects is parent DaemonSet
func NewStorageClass ¶ added in v0.0.6
func NewStorageClass(sc *storagev1.StorageClass, scAllowedTopology []corev1.TopologySelectorTerm) (*storagev1.StorageClass, error)
NewStorageClass constructs a new StorageClass
func PVCDecorator ¶ added in v0.0.6
func PVCDecorator(config *discoblocksondatiov1.DiskConfig, prefix string, driver *drivers.Driver, pvc *corev1.PersistentVolumeClaim)
PVCDecorator decorates new PVC instance
func ReadFileOrDie ¶ added in v0.0.7
ReadFileOrDie reads the file or die
func RenderFinalizer ¶
RenderFinalizer calculates finalizer name
func RenderMetricsProxySidecar ¶ added in v0.0.7
RenderMetricsProxySidecar returns the metrics sidecar
func RenderMetricsSidecar ¶ added in v0.0.2
RenderMetricsSidecar returns the metrics sidecar
func RenderMountJob ¶ added in v0.0.6
func RenderMountJob(podName, pvcName, pvName, namespace, nodeName, fs, mountPoint string, containerIDs []string, preMountCommand, volumeMeta string, owner metav1.OwnerReference) (*batchv1.Job, error)
RenderMountJob returns the mount job executed on host
func RenderMountPoint ¶
RenderMountPoint calculates mount point
func RenderResizeJob ¶ added in v0.0.6
func RenderResizeJob(podName, pvcName, pvName, namespace, nodeName, fs, preResizeCommand, volumeMeta string, owner metav1.OwnerReference) (*batchv1.Job, error)
RenderResizeJob returns the resize job executed on host
func RenderResourceName ¶ added in v0.0.5
RenderResourceName calculates resource name
func RenderUniqueLabel ¶ added in v0.0.6
RenderUniqueLabel renders DiskConfig label
Types ¶
type EventService ¶ added in v0.0.6
type EventService interface { SendWarning(string, string, string, string, string, client.Object, client.Object) error SendNormal(string, string, string, string, string, client.Object, client.Object) error }
EventService main interface of event service
func NewEventService ¶ added in v0.0.6
func NewEventService(controllerID string, k8sClient client.Client) EventService
NewEventService creates a new event service