Documentation ¶
Index ¶
- func ApplyResource(config *rest.Config, obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
- func DeleteResourceWithLabel(config *rest.Config, namespace string, labelName string, labelValue string) error
- func DeleteTLSFiles(config *rest.Config) error
- func GenerateTLSFiles(config *rest.Config) error
- func GetLiveResource(dclient dynamic.Interface, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func GetLiveResources(config *rest.Config, objs []*unstructured.Unstructured, namespace string) ([]*unstructured.Unstructured, error)
- func GetResourcesWithLabel(config *rest.Config, namespace string, labelName string, labelValue string) ([]*unstructured.Unstructured, error)
- func ListAPIResources(disco discovery.DiscoveryInterface) ([]metav1.APIResource, error)
- func ListAllResources(config *rest.Config, apiResources []metav1.APIResource, namespace string, ...) ([]*unstructured.Unstructured, error)
- func ListResources(dclient dynamic.Interface, apiResource metav1.APIResource, namespace string, ...) ([]*unstructured.Unstructured, error)
- func MustToUnstructured(obj interface{}) *unstructured.Unstructured
- func ServerResourceForGroupVersionKind(disco discovery.DiscoveryInterface, gvk schema.GroupVersionKind) (*metav1.APIResource, error)
- func TestConfig(config *rest.Config) error
- func ToUnstructured(obj interface{}) (*unstructured.Unstructured, error)
- func WatchResourcesWithLabel(ctx context.Context, config *rest.Config, namespace string, labelName string) (chan watch.Event, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyResource ¶
func ApplyResource(config *rest.Config, obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
ApplyResource performs an apply of a unstructured resource
func DeleteResourceWithLabel ¶
func DeleteResourceWithLabel(config *rest.Config, namespace string, labelName string, labelValue string) error
DeleteResourceWithLabel delete all resources which match to specified label selector
func DeleteTLSFiles ¶ added in v0.3.0
DeleteTLSFiles deletes any local TLS related files referenced by a rest Config.
func GenerateTLSFiles ¶ added in v0.3.0
GenerateTLSFiles examines the TLS settings of a rest.Config to see if it uses any TLS data (i.e. CAData, CertData, KeyData). It then creates them as temporary local files (which can later be used as arguments to a kubectl command), and updates the config with paths.
func GetLiveResource ¶
func GetLiveResource(dclient dynamic.Interface, obj *unstructured.Unstructured, apiResource *metav1.APIResource, namespace string) (*unstructured.Unstructured, error)
GetLiveResource returns the corresponding live resource from a unstructured object
func GetLiveResources ¶
func GetLiveResources(config *rest.Config, objs []*unstructured.Unstructured, namespace string) ([]*unstructured.Unstructured, error)
GetLiveResources returns the corresponding live resource from a list of resources
func GetResourcesWithLabel ¶ added in v0.3.0
func GetResourcesWithLabel(config *rest.Config, namespace string, labelName string, labelValue string) ([]*unstructured.Unstructured, error)
GetResourcesWithLabel returns all kubernetes resources with specified label
func ListAPIResources ¶
func ListAPIResources(disco discovery.DiscoveryInterface) ([]metav1.APIResource, error)
ListAPIResources discovers all API resources supported by the Kube API sererver
func ListAllResources ¶
func ListAllResources(config *rest.Config, apiResources []metav1.APIResource, namespace string, listOpts metav1.ListOptions) ([]*unstructured.Unstructured, error)
ListAllResources iterates the list of API resources, and returns all resources with the given filters
func ListResources ¶
func ListResources(dclient dynamic.Interface, apiResource metav1.APIResource, namespace string, listOpts metav1.ListOptions) ([]*unstructured.Unstructured, error)
ListResources returns a list of resources of a particular API type using the dynamic client
func MustToUnstructured ¶
func MustToUnstructured(obj interface{}) *unstructured.Unstructured
MustToUnstructured converts a concrete K8s API type to a un unstructured object and panics if not successful
func ServerResourceForGroupVersionKind ¶
func ServerResourceForGroupVersionKind(disco discovery.DiscoveryInterface, gvk schema.GroupVersionKind) (*metav1.APIResource, error)
See: https://github.com/ksonnet/ksonnet/blob/master/utils/client.go
func TestConfig ¶
TestConfig tests to make sure the REST config is usable
func ToUnstructured ¶
func ToUnstructured(obj interface{}) (*unstructured.Unstructured, error)
ToUnstructured converts a concrete K8s API type to a un unstructured object
Types ¶
This section is empty.