Documentation
¶
Index ¶
- func EscapeJSONPointer(s string) string
- func ToPVReclaimPolicyPtr(s string) *v1.PersistentVolumeReclaimPolicy
- func ToStringPtr(s string) *string
- type Client
- func (c *Client) PersistentVolumesWithClaimsAndPods(ctx context.Context) ([]VolumeClaimPods, error)
- func (c *Client) SetDefaultStorageClass(ctx context.Context, storageClassName string) error
- func (c *Client) SetPersistentVolumeReclaimPolicy(ctx context.Context, persistentVolumeName, policy string) error
- func (c *Client) StorageClasses(ctx context.Context) ([]storagev1.StorageClass, error)
- type Interface
- type VolumeClaimPods
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeJSONPointer ¶
EscapeJSONPointer escapes JSON Pointer according to https://tools.ietf.org/html/rfc6901#section-3.
func ToPVReclaimPolicyPtr ¶
func ToPVReclaimPolicyPtr(s string) *v1.PersistentVolumeReclaimPolicy
ToPVReclaimPolicyPtr converts given string to v1.PersistentVolumeReclaimPolicy pointer.
func ToStringPtr ¶
ToStringPtr converts given string to string pointer.
Types ¶
type Client ¶
type Client struct {
kubernetes.Interface
}
Client contains wrapper methods to Kubernetes API.
func NewClient ¶
func NewClient(cs kubernetes.Interface) (*Client, error)
NewClient creates new Kubernetes client wrapper using provided Kubernetes client.
func NewClientForConfig ¶
NewClientForConfig creates new Kubernetes client wrapper using provided configuration.
func (*Client) PersistentVolumesWithClaimsAndPods ¶
func (c *Client) PersistentVolumesWithClaimsAndPods(ctx context.Context) ([]VolumeClaimPods, error)
PersistentVolumesWithClaimsAndPods returns all persistent volumes in the cluster together with their belonging persistent volume claims and pods.
func (*Client) SetDefaultStorageClass ¶
SetDefaultStorageClass sets default storage class and unsets default flat to all other storage classes.
func (*Client) SetPersistentVolumeReclaimPolicy ¶
func (c *Client) SetPersistentVolumeReclaimPolicy(ctx context.Context, persistentVolumeName, policy string) error
SetPersistentVolumeReclaimPolicy sets reclaim policy to the given persistent volume.
func (*Client) StorageClasses ¶
StorageClasses returns all storage classes in the cluster.
type Interface ¶
type Interface interface { StorageClasses(ctx context.Context) ([]v1.StorageClass, error) PersistentVolumesWithClaimsAndPods(ctx context.Context) ([]VolumeClaimPods, error) SetPersistentVolumeReclaimPolicy(ctx context.Context, persistentVolumeName, policy string) error SetDefaultStorageClass(ctx context.Context, storageClassName string) error }
Interface contains all public methods of k8s.Client implementation.
type VolumeClaimPods ¶
type VolumeClaimPods struct { PersistentVolume v1.PersistentVolume `json:"volume"` PersistentVolumeClaim v1.PersistentVolumeClaim `json:"claim"` Pods []v1.Pod `json:"pods"` }
VolumeClaimPods represents a persistent volume together with belonging claim and pods.