Documentation ¶
Index ¶
- Constants
- func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
- func FilterActivePods(pods []*v1.Pod) []*v1.Pod
- func FilterPods(pods []*v1.Pod, phase v1.PodPhase) int
- func GetClusterConfig() (*rest.Config, error)
- func IsKubernetesResourceAlreadyExistError(err error) bool
- func IsKubernetesResourceNotFoundError(err error) bool
- func IsPodActive(p *v1.Pod) bool
- func MustNewKubeClient() kubernetes.Interface
- type CRDClient
- type CRDRestClient
Constants ¶
const RecommendedConfigPathEnvVar = "KUBECONFIG"
RecommendedConfigPathEnvVar is a environment variable for path configuration
Variables ¶
This section is empty.
Functions ¶
func CascadeDeleteOptions ¶
func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
TODO(jlewi): CascadeDeletOptions are part of garbage collection policy. CascadeDeleteOptions deletes the workload after the grace period Do we want to use this? See https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/
func FilterActivePods ¶ added in v0.5.0
FilterActivePods returns pods that have not terminated.
func FilterPods ¶ added in v0.5.0
filterPods returns pods based on their phase.
func GetClusterConfig ¶
GetClusterConfig obtain the config from the Kube configuration used by kubeconfig, or from k8s cluster.
func IsKubernetesResourceAlreadyExistError ¶
IsKubernetesResourceAlreadyExistError throws error when kubernetes resources already exist.
func IsKubernetesResourceNotFoundError ¶
IsKubernetesResourceNotFoundError throws error when there is no kubernetes resource found.
func IsPodActive ¶ added in v0.5.0
func MustNewKubeClient ¶
func MustNewKubeClient() kubernetes.Interface
MustNewKubeClient returns new kubernetes client for cluster configuration
Types ¶
type CRDClient ¶ added in v0.3.0
type CRDClient interface { // Update a TfJob. Update(obj *metav1unstructured.Unstructured) error }
CRDRestClient defines an interface for working with CRDs using the REST client. In most cases we want to use the auto-generated clientset for specific CRDs. The only exception is when the CRD spec is invalid and we can't parse the type into the corresponding go struct.
type CRDRestClient ¶ added in v0.3.0
type CRDRestClient struct {
// contains filtered or unexported fields
}
CRDRestClient uses the Kubernetes rest interface to talk to the CRD.
func NewCRDRestClient ¶ added in v0.3.0
func NewCRDRestClient(version *schema.GroupVersion) (*CRDRestClient, error)
func (*CRDRestClient) Client ¶ added in v0.3.0
func (c *CRDRestClient) Client() *http.Client
HttpClient returns the http client used.
func (*CRDRestClient) Update ¶ added in v0.3.0
func (c *CRDRestClient) Update(obj *metav1unstructured.Unstructured, plural string) error
func (*CRDRestClient) UpdateStatus ¶ added in v0.4.0
func (c *CRDRestClient) UpdateStatus(obj *metav1unstructured.Unstructured, plural string) error