Documentation ¶
Index ¶
- func APIURLForResource(resource *schema.GroupVersionResource, namespace string) string
- func TranslatedKubernetesErrors(env *v1alpha.CommandEnvironment, err error) error
- type KubernetesClients
- func (c *KubernetesClients) CurrentNamespace() (string, error)
- func (c *KubernetesClients) IsResourceAvailableOnCluster(resource *schema.GroupVersionResource) (bool, error)
- func (kClients *KubernetesClients) MakeCRPostRequest(resource *schema.GroupVersionResource, name string, crJSON []byte) error
- func (kClients *KubernetesClients) MakeCrGetRequest(resource *schema.GroupVersionResource, name string) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIURLForResource ¶
func APIURLForResource(resource *schema.GroupVersionResource, namespace string) string
APIURLForResource returns kubernetes API url based on GroupVersionResource
func TranslatedKubernetesErrors ¶
func TranslatedKubernetesErrors(env *v1alpha.CommandEnvironment, err error) error
Translate kubernetes errors to more human redable format
Types ¶
type KubernetesClients ¶
type KubernetesClients struct { Clientset *kubernetes.Clientset RestConfig *rest.Config DynamicClient dynamic.Interface ClientConfig clientcmd.ClientConfig CommandEnvironment *v1alpha.CommandEnvironment // contains filtered or unexported fields }
KubernetesClients - contains all sorts of kubernetes clients that can be used to contact with cluster
func NewKubernetesClusterClients ¶
func NewKubernetesClusterClients(env *v1alpha.CommandEnvironment, kubeconfig string) (*KubernetesClients, error)
NewKubernetesClusterClients configures and returns clients for kubernetes cluster
func (*KubernetesClients) CurrentNamespace ¶
func (c *KubernetesClients) CurrentNamespace() (string, error)
CurrentNamespace returns the currently set namespace
func (*KubernetesClients) IsResourceAvailableOnCluster ¶
func (c *KubernetesClients) IsResourceAvailableOnCluster(resource *schema.GroupVersionResource) (bool, error)
IsResourceAvailableOnCluster checks the cluster to see if specified CRD is installed
func (*KubernetesClients) MakeCRPostRequest ¶
func (kClients *KubernetesClients) MakeCRPostRequest(resource *schema.GroupVersionResource, name string, crJSON []byte, ) error
MakeCRPostRequest - perform kubernetes api post request for CustomResource
func (*KubernetesClients) MakeCrGetRequest ¶
func (kClients *KubernetesClients) MakeCrGetRequest(resource *schema.GroupVersionResource, name string) (interface{}, error)
MakeCrGetRequest - perform kubernetes api get request for CustomResource
Click to show internal directories.
Click to hide internal directories.