Documentation ¶
Index ¶
- Constants
- Variables
- func AsVersioned(info *resource.Info) runtime.Object
- type Client
- type Factory
- type Interface
- type ResourceList
- func (r *ResourceList) Append(val *resource.Info)
- func (r ResourceList) Contains(info *resource.Info) bool
- func (r ResourceList) Difference(rs ResourceList) ResourceList
- func (r ResourceList) Filter(fn func(*resource.Info) bool) ResourceList
- func (r ResourceList) Get(info *resource.Info) *resource.Info
- func (r ResourceList) Intersect(rs ResourceList) ResourceList
- func (r ResourceList) Visit(fn resource.VisitorFunc) error
- type Result
Constants ¶
const KeepPolicy = "keep"
KeepPolicy is the resource policy type for keep
This resource policy type allows resources to skip being deleted
during an uninstallRelease action.
const ResourcePolicyAnno = "helm.sh/resource-policy"
ResourcePolicyAnno is the annotation name for a resource policy
Variables ¶
var ErrNoObjectsVisited = errors.New("no objects visited")
ErrNoObjectsVisited indicates that during a visit operation, no matching objects were found.
Functions ¶
Types ¶
type Client ¶
type Client struct { Factory Factory Log func(string, ...interface{}) // Namespace allows to bypass the kubeconfig file for the choice of the namespace Namespace string }
Client represents a client capable of communicating with the Kubernetes API.
func (*Client) Update ¶
func (c *Client) Update(original, target ResourceList) (*Result, error)
Update takes the current list of objects and target list of objects and creates resources that don't already exists, updates resources that have been modified in the target configuration, and deletes resources from the current configuration that are not present in the target configuration. If an error occurs, a Result will still be returned with the error, containing all resource updates, creations, and deletions that were attempted. These can be used for cleanup or other logging purposes.
type Factory ¶
type Factory interface { // ToRawKubeConfigLoader return kubeconfig loader as-is ToRawKubeConfigLoader() clientcmd.ClientConfig // KubernetesClientSet gives you back an external clientset KubernetesClientSet() (*kubernetes.Clientset, error) // NewBuilder returns an object that assists in loading objects from both disk and the server // and which implements the common patterns for CLI interactions with generic resources. NewBuilder() *resource.Builder // Returns a schema that can validate objects stored on disk. Validator(validate bool) (validation.Schema, error) }
Factory provides abstractions that allow the Kubectl command to be extended across multiple types of resources and different API sets.
type Interface ¶
Interface represents a client capable of communicating with the Kubernetes API.
A KubernetesClient must be concurrency safe.
type ResourceList ¶
ResourceList provides convenience methods for comparing collections of Infos.
func (*ResourceList) Append ¶
func (r *ResourceList) Append(val *resource.Info)
Append adds an Info to the Result.
func (ResourceList) Contains ¶
func (r ResourceList) Contains(info *resource.Info) bool
Contains checks to see if an object exists.
func (ResourceList) Difference ¶
func (r ResourceList) Difference(rs ResourceList) ResourceList
Difference will return a new Result with objects not contained in rs.
func (ResourceList) Filter ¶
func (r ResourceList) Filter(fn func(*resource.Info) bool) ResourceList
Filter returns a new Result with Infos that satisfy the predicate fn.
func (ResourceList) Get ¶
func (r ResourceList) Get(info *resource.Info) *resource.Info
Get returns the Info from the result that matches the name and kind.
func (ResourceList) Intersect ¶
func (r ResourceList) Intersect(rs ResourceList) ResourceList
Intersect will return a new Result with objects contained in both Results.
func (ResourceList) Visit ¶
func (r ResourceList) Visit(fn resource.VisitorFunc) error
Visit implements resource.Visitor.
type Result ¶
type Result struct { Created ResourceList Updated ResourceList Deleted ResourceList }
Result contains the information of created, updated, and deleted resources for various kube API calls along with helper methods for using those resources