Documentation
¶
Index ¶
- func AddToschema(schema *runtime.Scheme)
- func Apply[T client.Object](ctx context.Context, config *rest.Config, resources []T, options ...Option) error
- func AutoClientConfig() (*rest.Config, error)
- func CreateByYamlOrJson(ctx context.Context, cfg *rest.Config, yamlOrJson []byte) error
- func CreatePatchContent(origin, modified interface{}) ([]byte, error)
- func DeleteByYamlOrJson(ctx context.Context, cfg *rest.Config, yamlOrJson []byte) error
- func GetKubeClient(kubeconfig []byte) (*rest.Config, *kubernetes.Clientset, error)
- func GetKubeRestConfig(kubeconfig []byte) (*rest.Config, error)
- func GetKubeconfigInfos(kubeconfig []byte) (apiserver string, cert, key, ca []byte, err error)
- func GetScheme() *runtime.Scheme
- func NewClient(config *rest.Config) (client.Client, error)
- func ParseResource(raw []byte) ([]*unstructured.Unstructured, error)
- func Remove[T client.Object](ctx context.Context, config *rest.Config, resources []T, options ...Option) error
- type JsonPatchType
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToschema ¶
func AutoClientConfig ¶
AutoClientConfig 自动获取当前环境 restConfig 1. 先尝试使用InClusterConfig, 2. 若不存在则使用 ~/.kube/config, 3. 否不存在则失败
func CreateByYamlOrJson ¶
func CreatePatchContent ¶
func DeleteByYamlOrJson ¶
func GetKubeClient ¶
func GetKubeconfigInfos ¶
func ParseResource ¶
func ParseResource(raw []byte) ([]*unstructured.Unstructured, error)
Types ¶
type JsonPatchType ¶
func (*JsonPatchType) Data ¶
func (j *JsonPatchType) Data(obj client.Object) ([]byte, error)
Data is the raw data representing the patch.
func (*JsonPatchType) Type ¶
func (j *JsonPatchType) Type() types.PatchType
Type is the PatchType of the patch.
Click to show internal directories.
Click to hide internal directories.