Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KubeConfigApplier ¶
type KubeConfigApplier struct {
// contains filtered or unexported fields
}
The KubeConfigApplier type applies YAML-encoded Kubernetes resources directly using the Kubernetes API.
func NewKubeConfigApplier ¶
func NewKubeConfigApplier(kubeConfig string) (*KubeConfigApplier, error)
NewKubeConfigApplier returns a new instance of the KubeConfigApplier type that connects to a Kubernetes API server via the provided kubeconfig file location. If the provided location is blank, an in-cluster configuration is assumed.
func (*KubeConfigApplier) Apply ¶
Apply the contents of the io.Reader implementation to the Kubernetes cluster described in the kubeconfig file. Any resources that already exist will be patched. It is assumed that the contents of the io.Reader implementation will be a YAML stream of Kubernetes resources separated by "---". The Apply operation can be cancelled via the provided context.Context.
type ObjectCallback ¶
type ObjectCallback func(ctx context.Context, object *unstructured.Unstructured) error
The ObjectCallback type is a function that is invoked for each Kubernetes object parsed when calling ObjectScanner.Apply.
type ObjectScanner ¶
type ObjectScanner struct {
// contains filtered or unexported fields
}
The ObjectScanner type is used to parse a YAML stream of Kubernetes resources and invoke a callback for each one.
func NewObjectScanner ¶
func NewObjectScanner(r io.Reader) *ObjectScanner
NewObjectScanner returns a new instance of the ObjectScanner type that will parse the provided io.Reader's data as a YAML-encoded stream of Kubernetes resources.
func (*ObjectScanner) ForEach ¶
func (oj *ObjectScanner) ForEach(ctx context.Context, fn ObjectCallback) error
ForEach iterates through the stream of YAML-encoded Kubernetes resources and invokes the ObjectCallback for each one. Iteration can be cancelled by the ObjectCallback returning a non-nil error or by cancelling the provided context.Context.
type StdOutApplier ¶
type StdOutApplier struct{}
The StdOutApplier type applies YAML-encoded Kubernetes resources by writing them to os.Stdout.
func NewStdOutApplier ¶
func NewStdOutApplier() *StdOutApplier
NewStdOutApplier returns a new instance of the StdOutApplier type that will Apply YAML-encoded Kubernetes resources by writing them to os.Stdout