Documentation
¶
Index ¶
- func CreateNamespace(clientset kubernetes.Interface, namespace string)
- func CreatePersistentVolume(clientset kubernetes.Interface, pvName string, capacity string, ...) (*v1.PersistentVolume, error)
- func CreatePersistentVolumeClaim(clientset kubernetes.Interface, capacity string, storageClassName string, ...) (*v1.PersistentVolumeClaim, error)
- func CreateSecret(clientset kubernetes.Interface, namespace string, secret *corev1.Secret) (*corev1.Secret, error)
- func GetSecret(clientset kubernetes.Interface, namespace string, secretName string) (*corev1.Secret, error)
- func GetSecretKey(clientset kubernetes.Interface, namespace, secretName, key string) (string, error)
- func NewInClusterClientset() (*kubernetes.Clientset, error)
- type Client
- func (c *Client) CreatePersistentVolumeClaim(ctxt context.Context, pvc *corev1.PersistentVolumeClaim, ...) (*corev1.PersistentVolumeClaim, error)
- func (c *Client) GetConfigMap(ctxt context.Context, cmName string, options metav1.GetOptions) (*v1.ConfigMap, error)
- func (c *Client) GetConfigMapKey(ctxt context.Context, cmName, key string, options metav1.GetOptions) (string, error)
- func (c *Client) GetPersistentVolumeClaim(ctxt context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
- type ClientConfig
- type ClientConfigMapInterface
- type ClientInterface
- type ClientPersistentVolumeClaimInterface
- type Clients
- type TestClient
- func (c *TestClient) CreatePersistentVolumeClaim(ctxt context.Context, pipeline *corev1.PersistentVolumeClaim, ...) (*corev1.PersistentVolumeClaim, error)
- func (c *TestClient) GetConfigMap(ctxt context.Context, cmName string, options metav1.GetOptions) (*corev1.ConfigMap, error)
- func (c *TestClient) GetConfigMapKey(ctxt context.Context, cmName, key string, options metav1.GetOptions) (string, error)
- func (c *TestClient) GetPersistentVolumeClaim(ctxt context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
func CreateNamespace(clientset kubernetes.Interface, namespace string)
TODO: return error
func CreatePersistentVolume ¶
func CreatePersistentVolume(clientset kubernetes.Interface, pvName string, capacity string, hostPath string, storageClassName string) (*v1.PersistentVolume, error)
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(clientset kubernetes.Interface, capacity string, storageClassName string, namespace string) (*v1.PersistentVolumeClaim, error)
func CreateSecret ¶
func GetSecretKey ¶
func GetSecretKey(clientset kubernetes.Interface, namespace, secretName, key string) (string, error)
func NewInClusterClientset ¶
func NewInClusterClientset() (*kubernetes.Clientset, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Kubernetes client, wrapping k8s.io/client-go/kubernetes.Clientset
func NewClient ¶
func NewClient(clientConfig *ClientConfig) (*Client, error)
NewClient initializes a Kubernetes client.
func NewInClusterClient ¶
func NewInClusterClient(clientConfig *ClientConfig) (*Client, error)
NewInClusterClient initializes a Kubernetes client from within a cluster.
func (*Client) CreatePersistentVolumeClaim ¶
func (c *Client) CreatePersistentVolumeClaim(ctxt context.Context, pvc *corev1.PersistentVolumeClaim, options metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error)
func (*Client) GetConfigMap ¶
func (*Client) GetConfigMapKey ¶
func (*Client) GetPersistentVolumeClaim ¶
func (c *Client) GetPersistentVolumeClaim(ctxt context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
type ClientConfig ¶
type ClientConfig struct {
// Kubernetes namespace.
Namespace string
// Logger is the logger to send logging messages to.
Logger logging.LeveledLoggerInterface
// KubernetesClient is the wrapped Kubernetes client.
KubernetesClient *kubernetes.Clientset
}
ClientConfig configures a Tekton client.
type ClientInterface ¶
type ClientInterface interface {
ClientPersistentVolumeClaimInterface
ClientConfigMapInterface
}
type ClientPersistentVolumeClaimInterface ¶
type ClientPersistentVolumeClaimInterface interface {
GetPersistentVolumeClaim(ctxt context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
CreatePersistentVolumeClaim(ctxt context.Context, pipeline *corev1.PersistentVolumeClaim, options metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error)
}
type Clients ¶
type Clients struct {
KubernetesClientSet *kubernetes.Clientset
TektonClientSet *tekton.Clientset
}
func NewClients ¶
func NewClients() *Clients
type TestClient ¶
type TestClient struct {
// PersistentVolumeClaims is the pool of pipelines which can be retrieved.
PVCs []*corev1.PersistentVolumeClaim
// FailCreatePVC lets PVC creation fail.
FailCreatePVC bool
// CreatedPVCs is a slice of created PVC names.
CreatedPVCs []string
// ConfigMaps which can be retrieved
CMs []*corev1.ConfigMap
}
TestClient returns mocked resources.
func (*TestClient) CreatePersistentVolumeClaim ¶
func (c *TestClient) CreatePersistentVolumeClaim(ctxt context.Context, pipeline *corev1.PersistentVolumeClaim, options metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error)
func (*TestClient) GetConfigMap ¶
func (c *TestClient) GetConfigMap(ctxt context.Context, cmName string, options metav1.GetOptions) (*corev1.ConfigMap, error)
func (*TestClient) GetConfigMapKey ¶
func (c *TestClient) GetConfigMapKey(ctxt context.Context, cmName, key string, options metav1.GetOptions) (string, error)
func (*TestClient) GetPersistentVolumeClaim ¶
func (c *TestClient) GetPersistentVolumeClaim(ctxt context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
Click to show internal directories.
Click to hide internal directories.