Documentation ¶
Index ¶
- type ApplyOpts
- type Client
- type DeleteOpts
- type ErrorNotFound
- type ErrorUnknownResource
- type FilterWriter
- type Info
- type Kubectl
- func (k Kubectl) Apply(data manifest.List, opts ApplyOpts) error
- func (k Kubectl) Delete(namespace, kind, name string, opts DeleteOpts) error
- func (k Kubectl) DeleteByLabels(namespace string, labels map[string]interface{}, opts DeleteOpts) error
- func (k Kubectl) DiffServerSide(data manifest.List) (*string, error)
- func (k Kubectl) Get(namespace, kind, name string) (manifest.Manifest, error)
- func (k Kubectl) GetByLabels(namespace string, labels map[string]interface{}) (manifest.List, error)
- func (k Kubectl) Info() (*Info, error)
- func (k Kubectl) Namespaces() (map[string]bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyOpts ¶
type ApplyOpts struct { // force allows to ignore checks and force the operation Force bool // autoApprove allows to skip the interactive approval AutoApprove bool }
ApplyOpts allow to specify additional parameter for apply operations
type Client ¶
type Client interface { // Get the specified object(s) from the cluster Get(namespace, kind, name string) (manifest.Manifest, error) GetByLabels(namespace string, labels map[string]interface{}) (manifest.List, error) // Apply the configuration to the cluster. `data` must contain a plaintext // format that is `kubectl-apply(1)` compatible Apply(data manifest.List, opts ApplyOpts) error // DiffServerSide runs the diff operation on the server and returns the // result in `diff(1)` format DiffServerSide(data manifest.List) (*string, error) // Delete the specified object(s) from the cluster Delete(namespace, kind, name string, opts DeleteOpts) error DeleteByLabels(namespace string, labels map[string]interface{}, opts DeleteOpts) error // Namespaces the cluster currently has Namespaces() (map[string]bool, error) // Info returns known informational data about the client. Best effort based, // fields of `Info` that cannot be stocked with valuable data, e.g. // due to an error, shall be left nil. Info() (*Info, error) }
Client for working with Kubernetes
type DeleteOpts ¶
type DeleteOpts ApplyOpts
DeleteOpts allow to specify additional parameters for delete operations Currently not different from ApplyOpts, but may be required in the future
type ErrorNotFound ¶
type ErrorNotFound struct {
// contains filtered or unexported fields
}
ErrorNotFound means that the requested object is not found on the server
func (ErrorNotFound) Error ¶
func (e ErrorNotFound) Error() string
type ErrorUnknownResource ¶
type ErrorUnknownResource struct {
// contains filtered or unexported fields
}
ErrorUnknownResource means that the requested resource type is unknown to the server
func (ErrorUnknownResource) Error ¶
func (e ErrorUnknownResource) Error() string
type FilterWriter ¶
FilterWriter is an io.Writer that discards every message that matches at least one of the regular expressions.
type Info ¶
type Info struct { // version of `kubectl` ClientVersion *semver.Version // version of the API server ServerVersion *semver.Version // used context and cluster from KUBECONFIG Context, Cluster objx.Map }
Info contains metadata about the client and its environment
type Kubectl ¶
type Kubectl struct { APIServer string // contains filtered or unexported fields }
Kubectl uses the `kubectl` command to operate on a Kubernetes cluster
func (Kubectl) Delete ¶
func (k Kubectl) Delete(namespace, kind, name string, opts DeleteOpts) error
Delete removes the specified object from the cluster
func (Kubectl) DeleteByLabels ¶
func (k Kubectl) DeleteByLabels(namespace string, labels map[string]interface{}, opts DeleteOpts) error
DeleteByLabels removes all objects matched by the given labels from the cluster
func (Kubectl) DiffServerSide ¶
DiffServerSide takes the desired state and computes the differences on the server, returning them in `diff(1)` format
func (Kubectl) GetByLabels ¶
func (k Kubectl) GetByLabels(namespace string, labels map[string]interface{}) (manifest.List, error)
GetByLabels retrieves all objects matched by the given labels from the cluster