client

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package client provides kubernetes client implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(restClient rest.Interface, group, version, namespace, resource, name string) error

Delete is to delete a kubernetes resource.

ex) err := client.Delete(restClient, "", "v1", namespace, "configmaps", name)

func Get

func Get[T any](restClient rest.Interface, group, version, namespace, resource, name string) (T, error)

Get is get kubernetes resource.

ex) configMap, err := client.Get[coreV1.ConfigMap](restClient, "", "v1", namespace, "configmaps", name)

func GetClientForInCluster

func GetClientForInCluster() (rest.Interface, error)

GetClientForInCluster is get a client that runs within the pod.

ex) restClient, err := client.GetClientForInCluster()

func GetClientUsingConfig

func GetClientUsingConfig(config *rest.Config) (rest.Interface, error)

GetClientUsingConfig is get the client running outside the pod.

ex) restClient, err := client.GetClientUsingConfig(config)

func Post

func Post(restClient rest.Interface, resource string, object runtime.Object) error

Post is to create a kubernetes resource.

ex)

configMap := coreV1.ConfigMap{...}
err := client.Post(restClient, "configmaps", &configMap)

func Put

func Put(restClient rest.Interface, resource string, object runtime.Object) error

Put is to update a kubernetes resource.

ex)

configMap := coreV1.ConfigMap{...}
err := client.Put(restClient, "configmaps", &configMap)

Types

This section is empty.

Jump to

Keyboard shortcuts

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