Documentation
¶
Index ¶
- Variables
- func BindHostToLocalHost(bindAddr string) (string, error)
- func DecodeYAMLToObject(yaml string) (*unstructured.Unstructured, error)
- func GetOutboundIP() (net.IP, error)
- func InitK8s(kubeconfig string) error
- func ReadFilesToStrings(fs *embed.FS, reqs []FileToString) error
- func SplitYAMLDocs(yaml string) ([]string, error)
- type FileToString
- type K8s
- func (k *K8s) MultiYamlApply(yaml string, namespace string) error
- func (k *K8s) MultiYamlApplySelectively(yaml string, namespace string, selector SelectorFunc) error
- func (k *K8s) MultiYamlDelete(yaml string, namespace string) error
- func (k *K8s) Reinit() error
- func (k *K8s) ReleaseK8s()
- func (k *K8s) SingleObjectCreate(obj *unstructured.Unstructured, namespace string) error
- func (k *K8s) SingleObjectUpdate(obj *unstructured.Unstructured, namespace string) error
- type SelectorFunc
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAddress = fmt.Errorf("invalid address")
var ErrNamespaceConflict = errors.New("provided namespace conflicts with YAML object")
var ErrNoNamespace = errors.New("could not determine namespace for namespace-scoped entity")
var ErrOperatorNotDeployed = errors.New("the ClickHouse Operator is not fully deployed")
Functions ¶
func BindHostToLocalHost ¶ added in v0.1.2
BindHostToLocalHost takes an address suitable for binding, which might be something like 0.0.0.0, and returns an address that can be connected to.
func DecodeYAMLToObject ¶
func DecodeYAMLToObject(yaml string) (*unstructured.Unstructured, error)
func GetOutboundIP ¶ added in v0.1.2
GetOutboundIP gets the preferred outbound ip of this machine
func ReadFilesToStrings ¶
func ReadFilesToStrings(fs *embed.FS, reqs []FileToString) error
func SplitYAMLDocs ¶
Types ¶
type FileToString ¶
type K8s ¶
type K8s struct {
Config *rest.Config
Clientset *kubernetes.Clientset
ChopClientset *chopclientset.Clientset
DiscoveryClient *discovery.DiscoveryClient
RESTMapper *restmapper.DeferredDiscoveryRESTMapper
DynamicClient dynamic.Interface
// contains filtered or unexported fields
}
func GetK8s ¶
func GetK8s() *K8s
GetK8s gets a reference to the global Kubernetes instance. The caller must call ReleaseK8s.
func (*K8s) MultiYamlApply ¶
MultiYamlApply does a server-side apply of a given YAML string, which may contain multiple documents
func (*K8s) MultiYamlApplySelectively ¶
func (k *K8s) MultiYamlApplySelectively(yaml string, namespace string, selector SelectorFunc) error
MultiYamlApplySelectively does a selective server-side apply of multiple docs from a given YAML string
func (*K8s) MultiYamlDelete ¶
MultiYamlDelete deletes the resources identified in a given YAML string
func (*K8s) Reinit ¶
Reinit reinitializes Kubernetes. The caller must not hold an open GetK8s() reference.
func (*K8s) ReleaseK8s ¶
func (k *K8s) ReleaseK8s()
ReleaseK8s releases the reference held by the caller.
func (*K8s) SingleObjectCreate ¶
func (k *K8s) SingleObjectCreate(obj *unstructured.Unstructured, namespace string) error
SingleObjectCreate creates a new resource from a single unstructured object
func (*K8s) SingleObjectUpdate ¶
func (k *K8s) SingleObjectUpdate(obj *unstructured.Unstructured, namespace string) error
SingleObjectUpdate updates an existing object from a single unstructured object
type SelectorFunc ¶
type SelectorFunc func([]*unstructured.Unstructured) []*unstructured.Unstructured