Documentation ¶
Index ¶
- Constants
- Variables
- func AddCondition(statusConditions []metav1.Condition, condType string, ...)
- func AddFinalizer(objectMeta *metav1.ObjectMeta, finalizer string) []string
- func BoolToCondition(val bool) metav1.ConditionStatus
- func DefaultIfZero(left, right interface{}) interface{}
- func DefaultIfZeroFloat(left, right float32) float32
- func DefaultIfZeroFloat64(left, right float64) float64
- func DefaultIfZeroInt(left, right int) int
- func DefaultIfZeroInt64(left, right int64) int64
- func DefaultIfZeroString(left, right string) string
- func DirectCSIDriveTypeMeta() metav1.TypeMeta
- func DirectCSIVolumeTypeMeta() metav1.TypeMeta
- func Eventf(object runtime.Object, eventType, reason, messageFmt string, ...)
- func ExcludeFinalizer(finalizers []string, finalizer string) (result []string, found bool)
- func FakeInit()
- func FmapString(str string, f func(rune) rune) string
- func FmapStringSlice(vs []string, f func(string) string) []string
- func GetAPIExtensionsClient() apiextensions.ApiextensionsV1Interface
- func GetCRDClient() apiextensions.CustomResourceDefinitionInterface
- func GetClientForNonCoreGroupKindVersions(group, kind string, versions ...string) (rest.Interface, *schema.GroupVersionKind, error)
- func GetCondition(statusConditions []metav1.Condition, condType string) metav1.Condition
- func GetDirectCSIClient() directcsi.DirectV1beta2Interface
- func GetDirectClientset() direct.Interface
- func GetDiscoveryClient() discovery.DiscoveryInterface
- func GetDriveList(ctx context.Context, driveInterface clientset.DirectCSIDriveInterface, ...) ([]directcsi.DirectCSIDrive, error)
- func GetGroupKindVersions(group, kind string, versions ...string) (*schema.GroupVersionKind, error)
- func GetKubeClient() kubernetes.Interface
- func GetKubeConfig() (*rest.Config, error)
- func GetLabelV(obj metav1.Object, key string) string
- func GetMetadataClient() metadata.Interface
- func GetVolumeList(ctx context.Context, volumeInterface clientset.DirectCSIVolumeInterface, ...) ([]directcsi.DirectCSIVolume, error)
- func Init()
- func IsCondition(statusConditions []metav1.Condition, condType string, ...) bool
- func IsConditionStatus(statusConditions []metav1.Condition, condType string, ...) bool
- func ListDrives(ctx context.Context, driveInterface clientset.DirectCSIDriveInterface, ...) (<-chan ListDriveResult, error)
- func ListVolumes(ctx context.Context, volumeInterface clientset.DirectCSIVolumeInterface, ...) (<-chan ListVolumeResult, error)
- func LogYAML(obj interface{}) error
- func MustJSON(obj interface{}) string
- func MustYAML(obj interface{}) string
- func NewDirectCSILabel(key string) string
- func NewIdentityTopologySelector(identity string) corev1.TopologySelectorTerm
- func NewObjectMeta(name string, namespace string, labels map[string]string, ...) metav1.ObjectMeta
- func NewTypeMeta(groupVersion, resource string) metav1.TypeMeta
- func ParseSingleKubeNativeFromBytes(data []byte) (runtime.Object, error)
- func PrintYaml(data string)
- func RemoveFinalizer(objectMeta *metav1.ObjectMeta, finalizer string) []string
- func SafeGetLabels(obj metav1.Object) map[string]string
- func SanitizeDrivePath(in string) string
- func SanitizeFinalizers(finalizers []string) []string
- func SanitizeKubeResourceName(name string) string
- func SanitizeLabelK(key string) string
- func SanitizeLabelKV(key, value string) (string, string)
- func SanitizeLabelMap(kvMap map[string]string) map[string]string
- func SanitizeLabelV(value string) string
- func SetAccessTierLabel(obj metav1.Object, accessTier directcsi.AccessTier)
- func SetDirectCSIClient(fakeClient *directcsifake.FakeDirectV1beta2)
- func SetLabelKV(obj metav1.Object, key, value string)
- func ToJSON(obj interface{}) (string, error)
- func ToYAML(obj interface{}) (string, error)
- func UpdateCondition(statusConditions []metav1.Condition, condType string, ...)
- func UpdateLabels(obj metav1.Object, labelKVs ...string)
- func ValidateAccessTier(at string) (directcsi.AccessTier, error)
- type ListDriveResult
- type ListVolumeResult
Constants ¶
const ( // 127 or \u007f is the DEL character DEL rune = 127 )
const MaxThreadCount = 40
Variables ¶
var ( Bold = color.New(color.Bold).SprintFunc() Red = color.New(color.FgRed).SprintFunc() )
var ( PodNameLabel = NewDirectCSILabel("pod.name") PodNamespaceLabel = NewDirectCSILabel("pod.namespace") NodeLabel = NewDirectCSILabel("node") DriveLabel = NewDirectCSILabel("drive") DrivePathLabel = NewDirectCSILabel("path") AccessTierLabel = NewDirectCSILabel("access-tier") VersionLabel = NewDirectCSILabel("version") CreatedByLabel = NewDirectCSILabel("created-by") ReservedDrivePathLabel = NewDirectCSILabel("drive-path") DirectCSIGroupVersion = SanitizeLabelK(directcsi.Group + "/" + directcsi.Version) )
var AddToScheme = localSchemeBuilder.AddToScheme
AddToScheme adds all types of this clientset into the given scheme. This allows composition of clientsets, like in:
import ( "k8s.io/client-go/kubernetes" clientsetscheme "k8s.io/client-go/kubernetes/scheme" aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" ) kclientset, _ := kubernetes.NewForConfig(c) _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
After this, RawExtensions in Kubernetes types will serialize kube-aggregator types correctly.
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var Scheme = runtime.NewScheme()
Functions ¶
func AddCondition ¶ added in v1.2.8
func AddFinalizer ¶
func AddFinalizer(objectMeta *metav1.ObjectMeta, finalizer string) []string
func BoolToCondition ¶
func BoolToCondition(val bool) metav1.ConditionStatus
func DefaultIfZero ¶ added in v1.4.0
func DefaultIfZero(left, right interface{}) interface{}
func DefaultIfZeroFloat ¶ added in v1.4.0
func DefaultIfZeroFloat64 ¶ added in v1.4.0
func DefaultIfZeroInt ¶ added in v1.4.0
func DefaultIfZeroInt64 ¶ added in v1.4.0
func DefaultIfZeroString ¶ added in v1.4.0
func DirectCSIDriveTypeMeta ¶ added in v1.3.0
func DirectCSIVolumeTypeMeta ¶ added in v1.3.0
func ExcludeFinalizer ¶ added in v1.4.2
func FmapStringSlice ¶ added in v1.4.0
func GetAPIExtensionsClient ¶ added in v1.1.0
func GetAPIExtensionsClient() apiextensions.ApiextensionsV1Interface
func GetCRDClient ¶
func GetCRDClient() apiextensions.CustomResourceDefinitionInterface
func GetCondition ¶ added in v1.2.8
func GetDirectCSIClient ¶
func GetDirectCSIClient() directcsi.DirectV1beta2Interface
func GetDirectClientset ¶
func GetDiscoveryClient ¶
func GetDiscoveryClient() discovery.DiscoveryInterface
func GetDriveList ¶ added in v1.4.2
func GetDriveList(ctx context.Context, driveInterface clientset.DirectCSIDriveInterface, nodes, drives, accessTiers []string) ([]directcsi.DirectCSIDrive, error)
func GetGroupKindVersions ¶
func GetGroupKindVersions(group, kind string, versions ...string) (*schema.GroupVersionKind, error)
func GetKubeClient ¶
func GetKubeClient() kubernetes.Interface
func GetKubeConfig ¶
func GetMetadataClient ¶
func GetVolumeList ¶ added in v1.4.2
func GetVolumeList(ctx context.Context, volumeInterface clientset.DirectCSIVolumeInterface, nodes, drives, podNames, podNss []string) ([]directcsi.DirectCSIVolume, error)
func IsCondition ¶ added in v1.2.8
func IsConditionStatus ¶ added in v1.2.8
func ListDrives ¶ added in v1.4.2
func ListDrives(ctx context.Context, driveInterface clientset.DirectCSIDriveInterface, nodes, drives, accessTiers []string, maxObjects int64) (<-chan ListDriveResult, error)
func ListVolumes ¶ added in v1.4.2
func ListVolumes(ctx context.Context, volumeInterface clientset.DirectCSIVolumeInterface, nodes, drives, podNames, podNss []string, maxObjects int64) (<-chan ListVolumeResult, error)
func NewDirectCSILabel ¶ added in v1.4.0
func NewIdentityTopologySelector ¶ added in v1.4.0
func NewIdentityTopologySelector(identity string) corev1.TopologySelectorTerm
func NewObjectMeta ¶ added in v1.4.0
func NewObjectMeta( name string, namespace string, labels map[string]string, annotations map[string]string, finalizers []string, ownerRefs []metav1.OwnerReference, ) metav1.ObjectMeta
NewObjectMeta - creates a new ObjectMeta with sanitized fields
func NewTypeMeta ¶ added in v1.4.0
NewObjectMeta - creates a new TypeMeta upcoming:
- verify API group/version/kind
- verify that kubernetes backend support group/version/kind (use discovery client)
func ParseSingleKubeNativeFromBytes ¶ added in v1.1.0
func RemoveFinalizer ¶
func RemoveFinalizer(objectMeta *metav1.ObjectMeta, finalizer string) []string
func SanitizeDrivePath ¶ added in v1.4.0
func SanitizeFinalizers ¶ added in v1.4.0
func SanitizeKubeResourceName ¶ added in v1.4.0
SanitizeKubeResourceName - Sanitize given name to a valid kubernetes name format. RegEx for a kubernetes name is
([a-z0-9][-a-z0-9]*)?[a-z0-9]
with a max length of 253
WARNING: This function will truncate to 253 bytes if the input is longer
func SanitizeLabelK ¶ added in v1.4.0
SanitizeLabelK - Sanitize given label key to valid kubernetes label format. RegEx for label key is
([A-Za-z0-9][-A-Za-z0-9_.]*[/]?[-A-Za-z0-9_.]*)?[A-Za-z0-9]
with a max length of 63
WARNING: This function will truncate to 63 bytes if the input is longer
func SanitizeLabelKV ¶ added in v1.4.0
func SanitizeLabelMap ¶ added in v1.4.0
func SanitizeLabelV ¶ added in v1.4.0
SanitizeLabelV - Sanitize given label value to valid kubernetes label format. RegEx for label value is
([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]
with a max length of 63
WARNING: This function will truncate to 63 bytes if the input is longer
func SetAccessTierLabel ¶ added in v1.4.0
func SetAccessTierLabel(obj metav1.Object, accessTier directcsi.AccessTier)
func SetDirectCSIClient ¶ added in v1.4.1
func SetDirectCSIClient(fakeClient *directcsifake.FakeDirectV1beta2)
func SetLabelKV ¶ added in v1.4.0
func UpdateCondition ¶ added in v1.2.8
func UpdateLabels ¶ added in v1.4.0
func ValidateAccessTier ¶ added in v1.3.0
func ValidateAccessTier(at string) (directcsi.AccessTier, error)
Types ¶
type ListDriveResult ¶ added in v1.4.2
type ListDriveResult struct { Drive directcsi.DirectCSIDrive Err error }
type ListVolumeResult ¶ added in v1.4.2
type ListVolumeResult struct { Volume directcsi.DirectCSIVolume Err error }