k8sclient

package
v19.10.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIKubernetes = "kubectl"
	CLIOpenShift  = "oc"

	FlavorKubernetes OrchestratorFlavor = "k8s"
	FlavorOpenShift  OrchestratorFlavor = "openshift"

	YAMLSeparator = `\n---\s*\n`

	// CRD Finalizer name
	TridentFinalizer = "trident.netapp.io"
)
View Source
const CSIDriverCRDYAML = `` /* 965-byte string literal not displayed */
View Source
const CSIDriverCRYAML = `
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
  name: csi.trident.netapp.io
spec:
  attachRequired: true
`
View Source
const CSINodeInfoCRDYAML = `` /* 1904-byte string literal not displayed */
View Source
const InstallerSecurityPolicyYAML = `` /* 267-byte string literal not displayed */
View Source
const PodSecurityPolicyYAML = `` /* 367-byte string literal not displayed */

Variables

This section is empty.

Functions

func GetCRDNames

func GetCRDNames() []string

func GetCRDsYAML

func GetCRDsYAML() string

func GetCSIDaemonSetYAML

func GetCSIDaemonSetYAML(tridentImage, label, logFormat string, debug bool, version *utils.Version) string

func GetCSIDeploymentYAML

func GetCSIDeploymentYAML(tridentImage, label, logFormat string, debug bool, version *utils.Version) string

func GetCSIDriverCRDYAML

func GetCSIDriverCRDYAML() string

func GetCSIDriverCRYAML

func GetCSIDriverCRYAML() string

func GetCSINodeInfoCRDYAML

func GetCSINodeInfoCRDYAML() string

func GetCSIServiceYAML

func GetCSIServiceYAML(label string) string

func GetClusterRoleBindingYAML

func GetClusterRoleBindingYAML(namespace string, flavor OrchestratorFlavor, csi bool) string

func GetClusterRoleYAML

func GetClusterRoleYAML(flavor OrchestratorFlavor, csi bool) string

func GetDeploymentYAML

func GetDeploymentYAML(tridentImage, label, logFormat string, debug bool) string

func GetEmptyConfigMapYAML

func GetEmptyConfigMapYAML(label, name, namespace string) string

func GetInstallerClusterRoleBindingYAML

func GetInstallerClusterRoleBindingYAML(namespace string, flavor OrchestratorFlavor) string

func GetInstallerClusterRoleYAML

func GetInstallerClusterRoleYAML(flavor OrchestratorFlavor) string

func GetInstallerPodYAML

func GetInstallerPodYAML(label, tridentImage string, commandArgs []string) string

func GetInstallerSecurityPolicyYAML

func GetInstallerSecurityPolicyYAML() string

func GetInstallerServiceAccountYAML

func GetInstallerServiceAccountYAML() string

func GetMigratorPodYAML

func GetMigratorPodYAML(pvcName, tridentImage, etcdImage, label string, csi bool, commandArgs []string) string

func GetNamespaceYAML

func GetNamespaceYAML(namespace string) string

func GetOpenShiftSCCQueryYAML

func GetOpenShiftSCCQueryYAML(scc string) string

func GetPodSecurityPolicyYAML

func GetPodSecurityPolicyYAML() string

func GetSecretYAML

func GetSecretYAML(secretName, namespace, label string, data map[string]string, stringData map[string]string) string

func GetServiceAccountYAML

func GetServiceAccountYAML(csi bool) string

func GetUninstallerPodYAML

func GetUninstallerPodYAML(label, tridentImage string, commandArgs []string) string

Types

type Interface

type Interface interface {
	Version() *version.Info
	ServerVersion() *utils.Version
	Namespace() string
	SetNamespace(namespace string)
	Flavor() OrchestratorFlavor
	CLI() string
	Exec(podName, containerName string, commandArgs []string) ([]byte, error)
	GetDeploymentByLabel(label string, allNamespaces bool) (*appsv1.Deployment, error)
	GetDeploymentsByLabel(label string, allNamespaces bool) ([]appsv1.Deployment, error)
	CheckDeploymentExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeleteDeploymentByLabel(label string) error
	GetServiceByLabel(label string, allNamespaces bool) (*v1.Service, error)
	GetServicesByLabel(label string, allNamespaces bool) ([]v1.Service, error)
	CheckServiceExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeleteServiceByLabel(label string) error
	GetStatefulSetByLabel(label string, allNamespaces bool) (*appsv1.StatefulSet, error)
	GetStatefulSetsByLabel(label string, allNamespaces bool) ([]appsv1.StatefulSet, error)
	CheckStatefulSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeleteStatefulSetByLabel(label string) error
	GetDaemonSetByLabel(label string, allNamespaces bool) (*appsv1.DaemonSet, error)
	GetDaemonSetsByLabel(label string, allNamespaces bool) ([]appsv1.DaemonSet, error)
	CheckDaemonSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeleteDaemonSetByLabel(label string) error
	GetConfigMapByLabel(label string, allNamespaces bool) (*v1.ConfigMap, error)
	GetConfigMapsByLabel(label string, allNamespaces bool) ([]v1.ConfigMap, error)
	CheckConfigMapExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeleteConfigMapByLabel(label string) error
	CreateConfigMapFromDirectory(path, name, label string) error
	GetPodByLabel(label string, allNamespaces bool) (*v1.Pod, error)
	GetPodsByLabel(label string, allNamespaces bool) ([]v1.Pod, error)
	CheckPodExistsByLabel(label string, allNamespaces bool) (bool, string, error)
	DeletePodByLabel(label string) error
	GetPVC(pvcName string) (*v1.PersistentVolumeClaim, error)
	GetPVCByLabel(label string, allNamespaces bool) (*v1.PersistentVolumeClaim, error)
	CheckPVCExists(pvcName string) (bool, error)
	CheckPVCBound(pvcName string) (bool, error)
	DeletePVCByLabel(label string) error
	GetPV(pvName string) (*v1.PersistentVolume, error)
	GetPVByLabel(label string) (*v1.PersistentVolume, error)
	CheckPVExists(pvName string) (bool, error)
	DeletePVByLabel(label string) error
	GetCRD(crdName string) (*apiextensionv1beta1.CustomResourceDefinition, error)
	CheckCRDExists(crdName string) (bool, error)
	DeleteCRD(crdName string) error
	CheckNamespaceExists(namespace string) (bool, error)
	CreateSecret(secret *v1.Secret) (*v1.Secret, error)
	UpdateSecret(secret *v1.Secret) (*v1.Secret, error)
	CreateCHAPSecret(secretName, accountName, initiatorSecret, targetSecret string) (*v1.Secret, error)
	GetSecret(secretName string) (*v1.Secret, error)
	GetSecretByLabel(label string, allNamespaces bool) (*v1.Secret, error)
	CheckSecretExists(secretName string) (bool, error)
	DeleteSecret(secretName string) error
	DeleteSecretByLabel(label string) error
	CreateObjectByFile(filePath string) error
	CreateObjectByYAML(yaml string) error
	DeleteObjectByFile(filePath string, ignoreNotFound bool) error
	DeleteObjectByYAML(yaml string, ignoreNotFound bool) error
	AddTridentUserToOpenShiftSCC(user, scc string) error
	RemoveTridentUserFromOpenShiftSCC(user, scc string) error
	FollowPodLogs(pod, container, namespace string, logLineCallback LogLineCallback)
	AddFinalizerToCRD(crdName string) error
	RemoveFinalizerFromCRD(crdName string) error
	GetCRDClient() (*crdclient.Clientset, error)
}

func NewFakeKubeClient

func NewFakeKubeClient() (Interface, error)

func NewKubeClient

func NewKubeClient(config *rest.Config, namespace string, k8sTimeout time.Duration) (Interface, error)

func NewKubectlClient

func NewKubectlClient(namespace string, k8sTimeout time.Duration) (Interface, error)

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func (*KubeClient) AddFinalizerToCRD

func (k *KubeClient) AddFinalizerToCRD(crdName string) error

AddFinalizerToCRD updates the CRD object to include our Trident finalizer (definitions are not namespaced)

func (*KubeClient) AddTridentUserToOpenShiftSCC

func (k *KubeClient) AddTridentUserToOpenShiftSCC(user, scc string) error

AddTridentUserToOpenShiftSCC adds the specified user (typically a service account) to the 'anyuid' security context constraint. This only works for OpenShift.

func (*KubeClient) CLI

func (k *KubeClient) CLI() string

func (*KubeClient) CheckCRDExists

func (k *KubeClient) CheckCRDExists(crdName string) (bool, error)

func (*KubeClient) CheckConfigMapExistsByLabel

func (k *KubeClient) CheckConfigMapExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckConfigMapExistsByLabel returns true if one or more configmap objects matching the specified label exist.

func (*KubeClient) CheckDaemonSetExistsByLabel

func (k *KubeClient) CheckDaemonSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckDaemonSetExistsByLabel returns true if one or more daemonset objects matching the specified label exist.

func (*KubeClient) CheckDeploymentExistsByLabel

func (k *KubeClient) CheckDeploymentExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckDeploymentExistsByLabel returns true if one or more deployment objects matching the specified label exist.

func (*KubeClient) CheckNamespaceExists

func (k *KubeClient) CheckNamespaceExists(namespace string) (bool, error)

func (*KubeClient) CheckPVCBound

func (k *KubeClient) CheckPVCBound(pvcName string) (bool, error)

func (*KubeClient) CheckPVCExists

func (k *KubeClient) CheckPVCExists(pvc string) (bool, error)

func (*KubeClient) CheckPVExists

func (k *KubeClient) CheckPVExists(pvName string) (bool, error)

func (*KubeClient) CheckPodExistsByLabel

func (k *KubeClient) CheckPodExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckPodExistsByLabel returns true if one or more pod objects matching the specified label exist.

func (*KubeClient) CheckSecretExists

func (k *KubeClient) CheckSecretExists(secretName string) (bool, error)

CheckSecretExists returns true if the Secret exists

func (*KubeClient) CheckServiceExistsByLabel

func (k *KubeClient) CheckServiceExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckServiceExistsByLabel returns true if one or more service objects matching the specified label exist.

func (*KubeClient) CheckStatefulSetExistsByLabel

func (k *KubeClient) CheckStatefulSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckStatefulSetExistsByLabel returns true if one or more statefulset objects matching the specified label exist.

func (*KubeClient) CreateCHAPSecret

func (k *KubeClient) CreateCHAPSecret(secretName, accountName, initiatorSecret, targetSecret string,
) (*v1.Secret, error)

CreateCHAPSecret creates a new Secret for iSCSI CHAP mutual authentication

func (*KubeClient) CreateConfigMapFromDirectory

func (k *KubeClient) CreateConfigMapFromDirectory(path, name, label string) error

func (*KubeClient) CreateObjectByFile

func (k *KubeClient) CreateObjectByFile(filePath string) error

CreateObjectByFile creates one or more objects on the server from a YAML/JSON file at the specified path.

func (*KubeClient) CreateObjectByYAML

func (k *KubeClient) CreateObjectByYAML(yamlData string) error

CreateObjectByYAML creates one or more objects on the server from a YAML/JSON document.

func (*KubeClient) CreateSecret

func (k *KubeClient) CreateSecret(secret *v1.Secret) (*v1.Secret, error)

CreateSecret creates a new Secret

func (*KubeClient) DeleteCRD

func (k *KubeClient) DeleteCRD(crdName string) error

func (*KubeClient) DeleteConfigMapByLabel

func (k *KubeClient) DeleteConfigMapByLabel(label string) error

DeleteConfigMapByLabel deletes a configmap object matching the specified label

func (*KubeClient) DeleteDaemonSetByLabel

func (k *KubeClient) DeleteDaemonSetByLabel(label string) error

DeleteDaemonSetByLabel deletes a daemonset object matching the specified label in the namespace of the client.

func (*KubeClient) DeleteDeploymentByLabel

func (k *KubeClient) DeleteDeploymentByLabel(label string) error

DeleteDeploymentByLabel deletes a deployment object matching the specified label in the namespace of the client.

func (*KubeClient) DeleteObjectByFile

func (k *KubeClient) DeleteObjectByFile(filePath string, ignoreNotFound bool) error

DeleteObjectByFile deletes one or more objects on the server from a YAML/JSON file at the specified path.

func (*KubeClient) DeleteObjectByYAML

func (k *KubeClient) DeleteObjectByYAML(yamlData string, ignoreNotFound bool) error

DeleteObjectByYAML deletes one or more objects on the server from a YAML/JSON document.

func (*KubeClient) DeletePVByLabel

func (k *KubeClient) DeletePVByLabel(label string) error

func (*KubeClient) DeletePVCByLabel

func (k *KubeClient) DeletePVCByLabel(label string) error

func (*KubeClient) DeletePodByLabel

func (k *KubeClient) DeletePodByLabel(label string) error

DeletePodByLabel deletes a pod object matching the specified label

func (*KubeClient) DeleteSecret

func (k *KubeClient) DeleteSecret(secretName string) error

DeleteSecret deletes the specified Secret

func (*KubeClient) DeleteSecretByLabel

func (k *KubeClient) DeleteSecretByLabel(label string) error

DeleteSecretByLabel deletes a secret object matching the specified label

func (*KubeClient) DeleteServiceByLabel

func (k *KubeClient) DeleteServiceByLabel(label string) error

DeleteServiceByLabel deletes a service object matching the specified label in the namespace of the client.

func (*KubeClient) DeleteStatefulSetByLabel

func (k *KubeClient) DeleteStatefulSetByLabel(label string) error

DeleteStatefulSetByLabel deletes a statefulset object matching the specified label in the namespace of the client.

func (*KubeClient) Exec

func (k *KubeClient) Exec(podName, containerName string, commandArgs []string) ([]byte, error)

func (*KubeClient) Flavor

func (k *KubeClient) Flavor() OrchestratorFlavor

func (*KubeClient) FollowPodLogs

func (k *KubeClient) FollowPodLogs(pod, container, namespace string, logLineCallback LogLineCallback)

func (*KubeClient) GetCRD

func (*KubeClient) GetCRDClient

func (k *KubeClient) GetCRDClient() (*crdclient.Clientset, error)

func (*KubeClient) GetConfigMapByLabel

func (k *KubeClient) GetConfigMapByLabel(label string, allNamespaces bool) (*v1.ConfigMap, error)

GetConfigMapByLabel returns a configmap object matching the specified label if it is unique

func (*KubeClient) GetConfigMapsByLabel

func (k *KubeClient) GetConfigMapsByLabel(label string, allNamespaces bool) ([]v1.ConfigMap, error)

GetConfigMapsByLabel returns all configmap objects matching the specified label

func (*KubeClient) GetDaemonSetByLabel

func (k *KubeClient) GetDaemonSetByLabel(label string, allNamespaces bool) (*appsv1.DaemonSet, error)

GetDaemonSetByLabel returns a daemonset object matching the specified label if it is unique

func (*KubeClient) GetDaemonSetsByLabel

func (k *KubeClient) GetDaemonSetsByLabel(label string, allNamespaces bool) ([]appsv1.DaemonSet, error)

GetDaemonSetsByLabel returns all daemonset objects matching the specified label

func (*KubeClient) GetDeploymentByLabel

func (k *KubeClient) GetDeploymentByLabel(label string, allNamespaces bool) (*appsv1.Deployment, error)

GetDeploymentByLabel returns a deployment object matching the specified label if it is unique

func (*KubeClient) GetDeploymentsByLabel

func (k *KubeClient) GetDeploymentsByLabel(label string, allNamespaces bool) ([]appsv1.Deployment, error)

GetDeploymentByLabel returns all deployment objects matching the specified label

func (*KubeClient) GetPV

func (k *KubeClient) GetPV(pvName string) (*v1.PersistentVolume, error)

func (*KubeClient) GetPVByLabel

func (k *KubeClient) GetPVByLabel(label string) (*v1.PersistentVolume, error)

func (*KubeClient) GetPVC

func (k *KubeClient) GetPVC(pvcName string) (*v1.PersistentVolumeClaim, error)

func (*KubeClient) GetPVCByLabel

func (k *KubeClient) GetPVCByLabel(label string, allNamespaces bool) (*v1.PersistentVolumeClaim, error)

func (*KubeClient) GetPodByLabel

func (k *KubeClient) GetPodByLabel(label string, allNamespaces bool) (*v1.Pod, error)

GetPodByLabel returns a pod object matching the specified label

func (*KubeClient) GetPodsByLabel

func (k *KubeClient) GetPodsByLabel(label string, allNamespaces bool) ([]v1.Pod, error)

GetPodsByLabel returns all pod objects matching the specified label

func (*KubeClient) GetSecret

func (k *KubeClient) GetSecret(secretName string) (*v1.Secret, error)

GetSecret looks up a Secret by name

func (*KubeClient) GetSecretByLabel

func (k *KubeClient) GetSecretByLabel(label string, allNamespaces bool) (*v1.Secret, error)

GetSecretByLabel looks up a Secret by label

func (*KubeClient) GetServiceByLabel

func (k *KubeClient) GetServiceByLabel(label string, allNamespaces bool) (*v1.Service, error)

GetServiceByLabel returns a service object matching the specified label if it is unique

func (*KubeClient) GetServicesByLabel

func (k *KubeClient) GetServicesByLabel(label string, allNamespaces bool) ([]v1.Service, error)

GetServicesByLabel returns all service objects matching the specified label

func (*KubeClient) GetStatefulSetByLabel

func (k *KubeClient) GetStatefulSetByLabel(label string, allNamespaces bool) (*appsv1.StatefulSet, error)

GetStatefulSetByLabel returns a statefulset object matching the specified label if it is unique

func (*KubeClient) GetStatefulSetsByLabel

func (k *KubeClient) GetStatefulSetsByLabel(label string, allNamespaces bool) ([]appsv1.StatefulSet, error)

GetStatefulSetsByLabel returns all stateful objects matching the specified label

func (*KubeClient) Namespace

func (k *KubeClient) Namespace() string

func (*KubeClient) RemoveFinalizerFromCRD

func (k *KubeClient) RemoveFinalizerFromCRD(crdName string) error

RemoveFinalizerFromCRD updates the CRD object to remove all finalizers (definitions are not namespaced)

func (*KubeClient) RemoveTridentUserFromOpenShiftSCC

func (k *KubeClient) RemoveTridentUserFromOpenShiftSCC(user, scc string) error

RemoveTridentUserFromOpenShiftSCC removes the specified user (typically a service account) from the 'anyuid' security context constraint. This only works for OpenShift, and it must be idempotent.

func (*KubeClient) ServerVersion

func (k *KubeClient) ServerVersion() *utils.Version

func (*KubeClient) SetNamespace

func (k *KubeClient) SetNamespace(namespace string)

func (*KubeClient) UpdateSecret

func (k *KubeClient) UpdateSecret(secret *v1.Secret) (*v1.Secret, error)

UpdateSecret updates an existing Secret

func (*KubeClient) Version

func (k *KubeClient) Version() *version.Info

type KubectlClient

type KubectlClient struct {
	// contains filtered or unexported fields
}

func (*KubectlClient) AddFinalizerToCRD

func (c *KubectlClient) AddFinalizerToCRD(crdName string) error

AddFinalizerToCRD patches the CRD object to include our Trident finalizer (definitions are not namespaced)

func (*KubectlClient) AddTridentUserToOpenShiftSCC

func (c *KubectlClient) AddTridentUserToOpenShiftSCC(user, scc string) error

AddTridentUserToOpenShiftSCC adds the specified user (typically a service account) to the 'anyuid' security context constraint. This only works for OpenShift.

func (*KubectlClient) CLI

func (c *KubectlClient) CLI() string

func (*KubectlClient) CheckCRDExists

func (c *KubectlClient) CheckCRDExists(crdName string) (bool, error)

func (*KubectlClient) CheckConfigMapExistsByLabel

func (c *KubectlClient) CheckConfigMapExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckConfigMapExistsByLabel returns true if one or more configmap objects matching the specified label exist.

func (*KubectlClient) CheckDaemonSetExistsByLabel

func (c *KubectlClient) CheckDaemonSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckDaemonSetExistsByLabel returns true if one or more daemonset objects matching the specified label exist.

func (*KubectlClient) CheckDeploymentExistsByLabel

func (c *KubectlClient) CheckDeploymentExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckDeploymentExistsByLabel returns true if one or more deployment objects matching the specified label exist.

func (*KubectlClient) CheckNamespaceExists

func (c *KubectlClient) CheckNamespaceExists(namespace string) (bool, error)

CheckNamespaceExists returns true if the specified namespace exists, false otherwise. It only returns an error if the check failed, not if the namespace doesn't exist.

func (*KubectlClient) CheckPVCBound

func (c *KubectlClient) CheckPVCBound(pvcName string) (bool, error)

CheckPVCBound returns true if the specified PVC is bound, false otherwise. It only returns an error if the check failed, not if the PVC doesn't exist.

func (*KubectlClient) CheckPVCExists

func (c *KubectlClient) CheckPVCExists(pvcName string) (bool, error)

CheckPVCExists returns true if the specified PVC exists, false otherwise. It only returns an error if the check failed, not if the PVC doesn't exist.

func (*KubectlClient) CheckPVExists

func (c *KubectlClient) CheckPVExists(pvName string) (bool, error)

CheckPVExists returns true if the specified PV exists, false otherwise. It only returns an error if the check failed, not if the PV doesn't exist.

func (*KubectlClient) CheckPodExistsByLabel

func (c *KubectlClient) CheckPodExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckPodExistsByLabel returns true if one or more pod objects matching the specified label exist.

func (*KubectlClient) CheckSecretExists

func (c *KubectlClient) CheckSecretExists(secretName string) (bool, error)

CheckSecretExists returns true if the specified secret exists, false otherwise. It only returns an error if the check failed, not if the secret doesn't exist.

func (*KubectlClient) CheckServiceExistsByLabel

func (c *KubectlClient) CheckServiceExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckServiceExistsByLabel returns true if one or more service objects matching the specified label exist.

func (*KubectlClient) CheckStatefulSetExistsByLabel

func (c *KubectlClient) CheckStatefulSetExistsByLabel(label string, allNamespaces bool) (bool, string, error)

CheckStatefulSetExistsByLabel returns true if one or more statefulset objects matching the specified label exist.

func (*KubectlClient) CreateCHAPSecret

func (c *KubectlClient) CreateCHAPSecret(secretName, accountName, initiatorSecret, targetSecret string,
) (*v1.Secret, error)

CreateCHAPSecret creates a new Secret for iSCSI CHAP mutual authentication

func (*KubectlClient) CreateConfigMapFromDirectory

func (c *KubectlClient) CreateConfigMapFromDirectory(path, name, label string) error

func (*KubectlClient) CreateObjectByFile

func (c *KubectlClient) CreateObjectByFile(filePath string) error

CreateObjectByFile creates one or more objects on the server from a YAML/JSON file at the specified path.

func (*KubectlClient) CreateObjectByYAML

func (c *KubectlClient) CreateObjectByYAML(yamlData string) error

CreateObjectByYAML creates one or more objects on the server from a YAML/JSON document.

func (*KubectlClient) CreateSecret

func (c *KubectlClient) CreateSecret(secret *v1.Secret) (*v1.Secret, error)

CreateSecret creates a new Secret

func (*KubectlClient) DeleteCRD

func (c *KubectlClient) DeleteCRD(crdName string) error

func (*KubectlClient) DeleteConfigMapByLabel

func (c *KubectlClient) DeleteConfigMapByLabel(label string) error

DeleteConfigMapByLabel deletes a configmap object matching the specified label

func (*KubectlClient) DeleteDaemonSetByLabel

func (c *KubectlClient) DeleteDaemonSetByLabel(label string) error

DeleteDaemonSetByLabel deletes a daemonset object matching the specified label in the namespace of the client.

func (*KubectlClient) DeleteDeploymentByLabel

func (c *KubectlClient) DeleteDeploymentByLabel(label string) error

DeleteDeploymentByLabel deletes a deployment object matching the specified label in the namespace of the client.

func (*KubectlClient) DeleteObjectByFile

func (c *KubectlClient) DeleteObjectByFile(filePath string, ignoreNotFound bool) error

DeleteObjectByFile deletes one or more objects on the server from a YAML/JSON file at the specified path.

func (*KubectlClient) DeleteObjectByYAML

func (c *KubectlClient) DeleteObjectByYAML(yaml string, ignoreNotFound bool) error

DeleteObjectByYAML deletes one or more objects on the server from a YAML/JSON document.

func (*KubectlClient) DeletePVByLabel

func (c *KubectlClient) DeletePVByLabel(label string) error

func (*KubectlClient) DeletePVCByLabel

func (c *KubectlClient) DeletePVCByLabel(label string) error

DeletePVCByLabel deletes a PVC object matching the specified label in the namespace of the client.

func (*KubectlClient) DeletePodByLabel

func (c *KubectlClient) DeletePodByLabel(label string) error

DeletePodByLabel deletes a pod object matching the specified label

func (*KubectlClient) DeleteSecret

func (c *KubectlClient) DeleteSecret(secretName string) error

DeleteSecret deletes the specified Secret

func (*KubectlClient) DeleteSecretByLabel

func (c *KubectlClient) DeleteSecretByLabel(label string) error

DeleteSecretByLabel deletes a secret object matching the specified label in the namespace of the client.

func (*KubectlClient) DeleteServiceByLabel

func (c *KubectlClient) DeleteServiceByLabel(label string) error

DeleteServiceByLabel deletes a service object matching the specified label in the namespace of the client.

func (*KubectlClient) DeleteStatefulSetByLabel

func (c *KubectlClient) DeleteStatefulSetByLabel(label string) error

DeleteStatefulSetByLabel deletes a statefulset object matching the specified label in the namespace of the client.

func (*KubectlClient) Exec

func (c *KubectlClient) Exec(podName, containerName string, commandArgs []string) ([]byte, error)

func (*KubectlClient) Flavor

func (c *KubectlClient) Flavor() OrchestratorFlavor

func (*KubectlClient) FollowPodLogs

func (c *KubectlClient) FollowPodLogs(pod, container, namespace string, logLineCallback LogLineCallback)

func (*KubectlClient) GetCRD

func (*KubectlClient) GetCRDClient

func (c *KubectlClient) GetCRDClient() (*crdclient.Clientset, error)

func (*KubectlClient) GetConfigMapByLabel

func (c *KubectlClient) GetConfigMapByLabel(label string, allNamespaces bool) (*v1.ConfigMap, error)

GetConfigMapByLabel returns a configmap object matching the specified label if it is unique

func (*KubectlClient) GetConfigMapsByLabel

func (c *KubectlClient) GetConfigMapsByLabel(label string, allNamespaces bool) ([]v1.ConfigMap, error)

GetConfigMapsByLabel returns all configmap objects matching the specified label

func (*KubectlClient) GetDaemonSetByLabel

func (c *KubectlClient) GetDaemonSetByLabel(label string, allNamespaces bool) (*appsv1.DaemonSet, error)

GetDaemonSetByLabel returns a daemonset object matching the specified label if it is unique

func (*KubectlClient) GetDaemonSetsByLabel

func (c *KubectlClient) GetDaemonSetsByLabel(label string, allNamespaces bool) ([]appsv1.DaemonSet, error)

GetDaemonSetsByLabel returns all daemonset objects matching the specified label

func (*KubectlClient) GetDeploymentByLabel

func (c *KubectlClient) GetDeploymentByLabel(label string, allNamespaces bool) (*appsv1.Deployment, error)

GetDeploymentByLabel returns a deployment object matching the specified label if it is unique

func (*KubectlClient) GetDeploymentsByLabel

func (c *KubectlClient) GetDeploymentsByLabel(label string, allNamespaces bool) ([]appsv1.Deployment, error)

GetDeploymentByLabel returns all deployment objects matching the specified label

func (*KubectlClient) GetPV

func (c *KubectlClient) GetPV(pvName string) (*v1.PersistentVolume, error)

func (*KubectlClient) GetPVByLabel

func (c *KubectlClient) GetPVByLabel(label string) (*v1.PersistentVolume, error)

func (*KubectlClient) GetPVC

func (c *KubectlClient) GetPVC(pvcName string) (*v1.PersistentVolumeClaim, error)

func (*KubectlClient) GetPVCByLabel

func (c *KubectlClient) GetPVCByLabel(label string, allNamespaces bool) (*v1.PersistentVolumeClaim, error)

func (*KubectlClient) GetPodByLabel

func (c *KubectlClient) GetPodByLabel(label string, allNamespaces bool) (*v1.Pod, error)

GetPodByLabel returns a pod object matching the specified label

func (*KubectlClient) GetPodsByLabel

func (c *KubectlClient) GetPodsByLabel(label string, allNamespaces bool) ([]v1.Pod, error)

GetPodsByLabel returns all pod objects matching the specified label

func (*KubectlClient) GetSecret

func (c *KubectlClient) GetSecret(secretName string) (*v1.Secret, error)

GetSecret looks up a Secret by name

func (*KubectlClient) GetSecretByLabel

func (c *KubectlClient) GetSecretByLabel(label string, allNamespaces bool) (*v1.Secret, error)

func (*KubectlClient) GetServiceByLabel

func (c *KubectlClient) GetServiceByLabel(label string, allNamespaces bool) (*v1.Service, error)

GetServiceByLabel returns a service object matching the specified label if it is unique

func (*KubectlClient) GetServicesByLabel

func (c *KubectlClient) GetServicesByLabel(label string, allNamespaces bool) ([]v1.Service, error)

GetServicesByLabel returns all service objects matching the specified label

func (*KubectlClient) GetStatefulSetByLabel

func (c *KubectlClient) GetStatefulSetByLabel(label string, allNamespaces bool) (*appsv1.StatefulSet, error)

GetStatefulSetByLabel returns a statefulset object matching the specified label if it is unique

func (*KubectlClient) GetStatefulSetsByLabel

func (c *KubectlClient) GetStatefulSetsByLabel(label string, allNamespaces bool) ([]appsv1.StatefulSet, error)

GetStatefulSetsByLabel returns all stateful objects matching the specified label

func (*KubectlClient) Namespace

func (c *KubectlClient) Namespace() string

func (*KubectlClient) RemoveFinalizerFromCRD

func (c *KubectlClient) RemoveFinalizerFromCRD(crdName string) error

RemoveFinalizerFromCRD patches the CRD object to remove all finalizers (definitions are not namespaced)

func (*KubectlClient) RemoveTridentUserFromOpenShiftSCC

func (c *KubectlClient) RemoveTridentUserFromOpenShiftSCC(user, scc string) error

RemoveTridentUserFromOpenShiftSCC removes the specified user (typically a service account) from the 'anyuid' security context constraint. This only works for OpenShift.

func (*KubectlClient) ServerVersion

func (c *KubectlClient) ServerVersion() *utils.Version

func (*KubectlClient) SetNamespace

func (c *KubectlClient) SetNamespace(namespace string)

func (*KubectlClient) UpdateSecret

func (c *KubectlClient) UpdateSecret(secret *v1.Secret) (*v1.Secret, error)

UpdateSecret updates an existing Secret

func (*KubectlClient) Version

func (c *KubectlClient) Version() *version.Info

type LogLineCallback

type LogLineCallback func(string)

type OrchestratorFlavor

type OrchestratorFlavor string

type Version

type Version struct {
	ClientVersion struct {
		Major        string    `json:"major"`
		Minor        string    `json:"minor"`
		GitVersion   string    `json:"gitVersion"`
		GitCommit    string    `json:"gitCommit"`
		GitTreeState string    `json:"gitTreeState"`
		BuildDate    time.Time `json:"buildDate"`
		GoVersion    string    `json:"goVersion"`
		Compiler     string    `json:"compiler"`
		Platform     string    `json:"platform"`
	} `json:"clientVersion"`
	ServerVersion struct {
		Major        string    `json:"major"`
		Minor        string    `json:"minor"`
		GitVersion   string    `json:"gitVersion"`
		GitCommit    string    `json:"gitCommit"`
		GitTreeState string    `json:"gitTreeState"`
		BuildDate    time.Time `json:"buildDate"`
		GoVersion    string    `json:"goVersion"`
		Compiler     string    `json:"compiler"`
		Platform     string    `json:"platform"`
	} `json:"serverVersion"`
	OpenshiftVersion string `json:"openshiftVersion"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL