Documentation ¶
Index ¶
- func CopySecret(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (*core.Secret, error)
- func CreateEventRecorder(kubernetes kubernetes.Interface, component string, log commonlog.Logger) record.EventRecorder
- func Exec(rest restpkg.Interface, config *restpkg.Config, namespace string, ...) error
- func FindResourceForKind(discovery discoverypkg.DiscoveryInterface, gvk schema.GroupVersionKind, ...) (schema.GroupVersionResource, error)
- func FindResourceForUnstructured(discovery discoverypkg.DiscoveryInterface, object *unstructured.Unstructured, ...) (schema.GroupVersionResource, error)
- func FindResourcesForKind(discovery discoverypkg.DiscoveryInterface, gvk schema.GroupVersionKind, ...) ([]schema.GroupVersionResource, error)
- func GetConfiguredNamespace(configPath string, context string) (string, bool)
- func GetControllerOf(metaObject meta.Object) (schema.GroupVersionKind, string, error)
- func GetFirstPodIP(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (string, error)
- func GetFirstPodName(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (string, error)
- func GetFirstServiceIP(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (string, error)
- func GetInternalRegistryHost(context contextpkg.Context, kubernetes kubernetespkg.Interface) (string, error)
- func GetMetaObject(object any, log commonlog.Logger) (meta.Object, error)
- func GetPodIPs(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) ([]string, error)
- func GetPodNames(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) ([]string, error)
- func GetPods(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (*core.PodList, error)
- func GetSecretTLSCertBytes(secret *core.Secret, secretDataKey string) ([]byte, error)
- func GetServiceAccountNamespace() string
- func GetServiceIPs(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) ([]string, error)
- func GetServices(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (*core.ServiceList, error)
- func GetUnstructuredGVK(object *unstructured.Unstructured) (schema.GroupVersionKind, error)
- func JSONString(value any) apiextensions.JSON
- func Log(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (io.ReadCloser, error)
- func NewConfig(configPath string, context string) (*rest.Config, error)
- func NewConfigForContext(configPath string, context string) (*rest.Config, error)
- func NewConfigFromFlags(masterUrl string, configPath string, context string, log commonlog.Logger) (*rest.Config, error)
- func NewNotFound(gk schema.GroupKind, message string) *errorspkg.StatusError
- func NewSelfContainedConfig(restConfig *rest.Config, namespace string) (*api.Config, error)
- func NewUnstructuredFromYAMLTemplate(code string, data any) (*unstructured.Unstructured, error)
- func ParseGVK(apiVersion string, kind string) (schema.GroupVersionKind, error)
- func ReadFromContainer(rest restpkg.Interface, config *restpkg.Config, namespace string, ...) error
- func RegistryCredentialsAuth(username string, password string) string
- func SetControllerOfUnstructured(object *unstructured.Unstructured, controllerObject meta.Object) error
- func Wait(context contextpkg.Context, condition wait.ConditionWithContextFunc) error
- func WaitForDeletion(context contextpkg.Context, log commonlog.Logger, name string, ...)
- func WaitForDeployment(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (*apps.Deployment, error)
- func WaitForPod(context contextpkg.Context, kubernetes kubernetespkg.Interface, ...) (*core.Pod, error)
- func WriteToContainer(rest restpkg.Interface, config *restpkg.Config, namespace string, ...) error
- type Dynamic
- func (self *Dynamic) AddResourceEventHandler(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, ...) error
- func (self *Dynamic) AddUnstructuredResourceChangeHandler(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, ...) error
- func (self *Dynamic) AddUnstructuredResourceEventHandlerFuncs(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, onAdded OnAddedFunc, ...) error
- func (self *Dynamic) CreateControlledResource(object *unstructured.Unstructured, controllerObject meta.Object, ...) (*unstructured.Unstructured, error)
- func (self *Dynamic) CreateResource(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (self *Dynamic) GetInformers(gvk schema.GroupVersionKind) ([]cache.SharedInformer, []cache.SharedInformer, error)
- func (self *Dynamic) GetResource(gvk schema.GroupVersionKind, name string, namespace string) (*unstructured.Unstructured, error)
- func (self *Dynamic) ListResources(gvk schema.GroupVersionKind, namespace string, labels map[string]string) ([]unstructured.Unstructured, error)
- func (self *Dynamic) UpdateResource(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (self *Dynamic) UpdateResourceStatus(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
- type ExecError
- type GetControllerObjectFunc
- type MemberlistPodDiscovery
- type OnAddedFunc
- type OnChangedFunc
- type OnDeletedFunc
- type OnUpdatedFunc
- type PodDiscovery
- type PodsDiscoveredFunc
- type ProcessFunc
- type Processor
- type Processors
- func (self *Processors) Add(gvk schema.GroupVersionKind, processor *Processor)
- func (self *Processors) Control(dynamic *Dynamic, controlledGvk schema.GroupVersionKind, ...) error
- func (self *Processors) Get(name string) (*Processor, bool)
- func (self *Processors) HasSynced() []cache.InformerSynced
- func (self *Processors) ShutDown()
- func (self *Processors) Start(concurrency uint, stopChannel <-chan struct{})
- func (self *Processors) WaitForCacheSync(stopChannel <-chan struct{}) error
- type RegistryCredentials
- type RegistryCredentialsTable
- type UnstructuredResourceEventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopySecret ¶ added in v0.1.6
func CreateEventRecorder ¶
func CreateEventRecorder(kubernetes kubernetes.Interface, component string, log commonlog.Logger) record.EventRecorder
func FindResourceForKind ¶
func FindResourceForKind(discovery discoverypkg.DiscoveryInterface, gvk schema.GroupVersionKind, supportedVerbs ...string) (schema.GroupVersionResource, error)
func FindResourceForUnstructured ¶
func FindResourceForUnstructured(discovery discoverypkg.DiscoveryInterface, object *unstructured.Unstructured, supportedVerbs ...string) (schema.GroupVersionResource, error)
func FindResourcesForKind ¶
func FindResourcesForKind(discovery discoverypkg.DiscoveryInterface, gvk schema.GroupVersionKind, supportedVerbs ...string) ([]schema.GroupVersionResource, error)
func GetConfiguredNamespace ¶
func GetControllerOf ¶
func GetFirstPodIP ¶
func GetFirstPodIP(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) (string, error)
func GetFirstPodName ¶
func GetFirstPodName(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) (string, error)
func GetFirstServiceIP ¶
func GetFirstServiceIP(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) (string, error)
func GetInternalRegistryHost ¶ added in v0.1.7
func GetInternalRegistryHost(context contextpkg.Context, kubernetes kubernetespkg.Interface) (string, error)
func GetPodIPs ¶
func GetPodIPs(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) ([]string, error)
func GetPodNames ¶
func GetPodNames(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) ([]string, error)
func GetPods ¶
func GetPods(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) (*core.PodList, error)
func GetSecretTLSCertBytes ¶ added in v0.1.7
func GetServiceAccountNamespace ¶
func GetServiceAccountNamespace() string
func GetServiceIPs ¶
func GetServiceIPs(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) ([]string, error)
func GetServices ¶
func GetServices(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, appName string) (*core.ServiceList, error)
func GetUnstructuredGVK ¶
func GetUnstructuredGVK(object *unstructured.Unstructured) (schema.GroupVersionKind, error)
func JSONString ¶ added in v0.1.6
func JSONString(value any) apiextensions.JSON
func Log ¶
func Log(context contextpkg.Context, kubernetes kubernetespkg.Interface, namespace string, podName string, containerName string, tail int, follow bool) (io.ReadCloser, error)
func NewConfigForContext ¶
func NewConfigFromFlags ¶
func NewConfigFromFlags(masterUrl string, configPath string, context string, log commonlog.Logger) (*rest.Config, error)
See: clientcmd.BuildConfigFromFlags
func NewNotFound ¶ added in v0.1.4
func NewNotFound(gk schema.GroupKind, message string) *errorspkg.StatusError
Variation on errorspkg.NewNotFound
func NewSelfContainedConfig ¶
func NewUnstructuredFromYAMLTemplate ¶
func NewUnstructuredFromYAMLTemplate(code string, data any) (*unstructured.Unstructured, error)
func ReadFromContainer ¶ added in v0.1.4
func RegistryCredentialsAuth ¶ added in v0.1.6
func SetControllerOfUnstructured ¶
func SetControllerOfUnstructured(object *unstructured.Unstructured, controllerObject meta.Object) error
controllerObject must also support schema.ObjectKind interface
func Wait ¶ added in v0.2.10
func Wait(context contextpkg.Context, condition wait.ConditionWithContextFunc) error
func WaitForDeletion ¶ added in v0.1.7
func WaitForDeployment ¶ added in v0.1.7
func WaitForDeployment(context contextpkg.Context, kubernetes kubernetespkg.Interface, log commonlog.Logger, namespace string, appName string) (*apps.Deployment, error)
func WaitForPod ¶ added in v0.1.7
Types ¶
type Dynamic ¶
type Dynamic struct { Dynamic dynamicpkg.Interface Discovery discovery.DiscoveryInterface InformerFactory dynamicinformer.DynamicSharedInformerFactory Log commonlog.Logger // contains filtered or unexported fields }
func NewDynamic ¶
func NewDynamic(toolName string, dynamic dynamicpkg.Interface, discovery discovery.DiscoveryInterface, namespace string, context context.Context) *Dynamic
func (*Dynamic) AddResourceEventHandler ¶
func (self *Dynamic) AddResourceEventHandler(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, handler cache.ResourceEventHandler) error
func (*Dynamic) AddUnstructuredResourceChangeHandler ¶
func (self *Dynamic) AddUnstructuredResourceChangeHandler(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, onChanged OnChangedFunc) error
func (*Dynamic) AddUnstructuredResourceEventHandlerFuncs ¶
func (self *Dynamic) AddUnstructuredResourceEventHandlerFuncs(gvk schema.GroupVersionKind, stopChannel <-chan struct{}, onAdded OnAddedFunc, onUpdated OnUpdatedFunc, onDeleted OnDeletedFunc) error
func (*Dynamic) CreateControlledResource ¶
func (self *Dynamic) CreateControlledResource(object *unstructured.Unstructured, controllerObject meta.Object, processors *Processors, stopChannel <-chan struct{}) (*unstructured.Unstructured, error)
controllerObject must also support schema.ObjectKind interface
func (*Dynamic) CreateResource ¶
func (self *Dynamic) CreateResource(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
func (*Dynamic) GetInformers ¶
func (self *Dynamic) GetInformers(gvk schema.GroupVersionKind) ([]cache.SharedInformer, []cache.SharedInformer, error)
func (*Dynamic) GetResource ¶
func (self *Dynamic) GetResource(gvk schema.GroupVersionKind, name string, namespace string) (*unstructured.Unstructured, error)
func (*Dynamic) ListResources ¶ added in v0.1.49
func (self *Dynamic) ListResources(gvk schema.GroupVersionKind, namespace string, labels map[string]string) ([]unstructured.Unstructured, error)
func (*Dynamic) UpdateResource ¶
func (self *Dynamic) UpdateResource(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
func (*Dynamic) UpdateResourceStatus ¶ added in v0.1.67
func (self *Dynamic) UpdateResourceStatus(object *unstructured.Unstructured) (*unstructured.Unstructured, error)
type ExecError ¶ added in v0.1.11
func NewExecError ¶ added in v0.1.11
type GetControllerObjectFunc ¶
type MemberlistPodDiscovery ¶ added in v0.1.50
type MemberlistPodDiscovery struct {
// contains filtered or unexported fields
}
func StartMemberlistPodDiscovery ¶ added in v0.1.50
func StartMemberlistPodDiscovery(cluster *memberlist.Memberlist, namespace string, selector string, frequency float64, log commonlog.Logger) (*MemberlistPodDiscovery, error)
func (*MemberlistPodDiscovery) Stop ¶ added in v0.1.50
func (self *MemberlistPodDiscovery) Stop()
type OnAddedFunc ¶
type OnAddedFunc = func(object *unstructured.Unstructured) error
type OnChangedFunc ¶
type OnChangedFunc = func(object *unstructured.Unstructured) error
type OnDeletedFunc ¶
type OnDeletedFunc = func(object *unstructured.Unstructured) error
type OnUpdatedFunc ¶
type OnUpdatedFunc = func(oldObject *unstructured.Unstructured, newObject *unstructured.Unstructured) error
type PodDiscovery ¶ added in v0.1.50
type PodDiscovery struct {
// contains filtered or unexported fields
}
func StartPodDiscovery ¶ added in v0.1.50
func StartPodDiscovery(namespace string, selector string, frequency float64, podsDiscovered PodsDiscoveredFunc, log commonlog.Logger) (*PodDiscovery, error)
func (*PodDiscovery) Stop ¶ added in v0.1.50
func (self *PodDiscovery) Stop()
type PodsDiscoveredFunc ¶ added in v0.1.50
type ProcessFunc ¶
type Processor ¶
type Processor struct { Name string GVK schema.GroupVersionKind Informer cache.SharedIndexInformer Workqueue workqueue.RateLimitingInterface Period time.Duration GetControllerObject GetControllerObjectFunc Process ProcessFunc Log commonlog.Logger }
func NewProcessor ¶
func NewProcessor(toolName string, name string, informer cache.SharedIndexInformer, period time.Duration, get GetControllerObjectFunc, process ProcessFunc) *Processor
func (*Processor) EnqueueFor ¶
type Processors ¶
type Processors struct {
// contains filtered or unexported fields
}
func NewProcessors ¶
func NewProcessors(toolName string) *Processors
func (*Processors) Add ¶
func (self *Processors) Add(gvk schema.GroupVersionKind, processor *Processor)
func (*Processors) Control ¶
func (self *Processors) Control(dynamic *Dynamic, controlledGvk schema.GroupVersionKind, stopChannel <-chan struct{}) error
func (*Processors) HasSynced ¶
func (self *Processors) HasSynced() []cache.InformerSynced
func (*Processors) ShutDown ¶
func (self *Processors) ShutDown()
func (*Processors) Start ¶
func (self *Processors) Start(concurrency uint, stopChannel <-chan struct{})
func (*Processors) WaitForCacheSync ¶
func (self *Processors) WaitForCacheSync(stopChannel <-chan struct{}) error
type RegistryCredentials ¶ added in v0.1.6
func NewRegistryCredentials ¶ added in v0.1.6
func NewRegistryCredentials(username string, password string) *RegistryCredentials
func NewRegistryCredentialsFromARD ¶ added in v0.1.6
func NewRegistryCredentialsFromARD(value ard.Value) (*RegistryCredentials, error)
func (*RegistryCredentials) ToARD ¶ added in v0.1.6
func (self *RegistryCredentials) ToARD() ard.Value
type RegistryCredentialsTable ¶ added in v0.1.6
type RegistryCredentialsTable map[string]*RegistryCredentials
func NewRegistryCredentialsTableFromARD ¶ added in v0.1.6
func NewRegistryCredentialsTableFromARD(value ard.Value) (RegistryCredentialsTable, error)
func NewRegistryCredentialsTableFromSecret ¶ added in v0.1.6
func NewRegistryCredentialsTableFromSecret(secret *core.Secret) (RegistryCredentialsTable, error)
func (RegistryCredentialsTable) ToARD ¶ added in v0.1.6
func (self RegistryCredentialsTable) ToARD() ard.Value
func (RegistryCredentialsTable) ToDockerConfigJSON ¶ added in v0.1.6
func (self RegistryCredentialsTable) ToDockerConfigJSON() (string, error)
type UnstructuredResourceEventHandler ¶
type UnstructuredResourceEventHandler struct {
// contains filtered or unexported fields
}
func NewUnstructuredResourceEventHandler ¶
func NewUnstructuredResourceEventHandler(onAdded OnAddedFunc, onUpdated OnUpdatedFunc, onDeleted OnDeletedFunc) *UnstructuredResourceEventHandler
func (*UnstructuredResourceEventHandler) OnAdd ¶
func (self *UnstructuredResourceEventHandler) OnAdd(object any, isInInitialList bool)
cache.ResourceEventHandler interface
func (*UnstructuredResourceEventHandler) OnDelete ¶
func (self *UnstructuredResourceEventHandler) OnDelete(object any)
cache.ResourceEventHandler interface
func (*UnstructuredResourceEventHandler) OnUpdate ¶
func (self *UnstructuredResourceEventHandler) OnUpdate(oldObject any, newObject any)
cache.ResourceEventHandler interface
Click to show internal directories.
Click to hide internal directories.