kube

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeConfiguration

func InitializeConfiguration(k *KubeConfig) (*rest.Config, error)

func SplitYAML

func SplitYAML(yamlData []byte) ([]unstructured.Unstructured, error)

Types

type ApplyOpts

type ApplyOpts struct {
	DryRunStrategy cmdutil.DryRunStrategy
	Force          bool
	Validate       bool
}

type DeleteOpts

type DeleteOpts struct {
	Force           bool
	WaitForDeletion bool
	IgnoreNotFound  bool
	GracePeriod     int
}

type KubeConfig

type KubeConfig struct {
	Host                  types.String `tfsdk:"host"`
	Username              types.String `tfsdk:"username"`
	Password              types.String `tfsdk:"password"`
	Insecure              types.Bool   `tfsdk:"insecure"`
	ClientCertificate     types.String `tfsdk:"client_certificate"`
	ClientKey             types.String `tfsdk:"client_key"`
	ClusterCaCertificate  types.String `tfsdk:"cluster_ca_certificate"`
	ConfigPath            types.String `tfsdk:"config_path"`
	ConfigPaths           types.List   `tfsdk:"config_paths"`
	ConfigContext         types.String `tfsdk:"config_context"`
	ConfigContextAuthInfo types.String `tfsdk:"config_context_auth_info"`
	ConfigContextCluster  types.String `tfsdk:"config_context_cluster"`
	Token                 types.String `tfsdk:"token"`
	ProxyUrl              types.String `tfsdk:"proxy_url"`
}

type Kubectl

type Kubectl struct {
	// contains filtered or unexported fields
}

func NewKubectl

func NewKubectl(config *rest.Config) (*Kubectl, error)

NewKubectl returns a kubectl instance from a rest config

func (*Kubectl) ApplyResource

func (k *Kubectl) ApplyResource(ctx context.Context, obj *unstructured.Unstructured, applyOpts ApplyOpts) (string, error)

ApplyResource performs an apply of a unstructured resource

func (*Kubectl) DeleteResource

func (k *Kubectl) DeleteResource(ctx context.Context, obj *unstructured.Unstructured, deleteOpts DeleteOpts) (string, error)

func (*Kubectl) OpenAPISchema

func (k *Kubectl) OpenAPISchema() (openapi.Resources, error)

Jump to

Keyboard shortcuts

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