Documentation ¶
Index ¶
- type CallbackFunc
- type Conditionals
- type ConvertSchemaFn
- type FetchCRDFn
- type ForEach
- type ForEachResource
- type MapInterface
- type NullWatcher
- type PatchApplier
- type PatchType
- type RESTManager
- type ResourcePatch
- type SchemaCache
- func (sc *SchemaCache) CachedConvertSchema(gvk schema.GroupVersionKind, crd extv1.CustomResourceDefinitionVersion) (*spec.Schema, error)
- func (sc *SchemaCache) ExpireResources() error
- func (sc *SchemaCache) ExpireSchema() error
- func (sc *SchemaCache) FetchCRD() ([]extv1.CustomResourceDefinition, error)
- func (sc *SchemaCache) FetchResources() ([]*metav1.APIResourceList, error)
- func (sc *SchemaCache) FetchSchema() (*spec.Swagger, error)
- func (sc *SchemaCache) ResourceHasExpired() bool
- func (sc *SchemaCache) SchemaHasExpired() bool
- type SchemaManager
- func (m *SchemaManager) DuckType(gvk schema.GroupVersionKind, object *unstructured.Unstructured) error
- func (m *SchemaManager) FindSchemaForKind(gvk schema.GroupVersionKind) (*spec.Schema, bool, error)
- func (m *SchemaManager) FindTypeForKey(gvk schema.GroupVersionKind, key string) (*TypedField, error)
- func (m *SchemaManager) FindTypeForKeyFromSchema(schema *spec.Schema, key string) (*TypedField, error)
- type TemplateManager
- func (tm *TemplateManager) GetSourceNamespaces(ctx context.Context, template *templatev1.Template) ([]string, error)
- func (tm *TemplateManager) HandleSource(ctx context.Context, template *templatev1.Template, ...) (result ctrl.Result, err error)
- func (tm *TemplateManager) JSONPath(object interface{}, jsonpath string) (*ForEach, error)
- func (tm *TemplateManager) Run(ctx context.Context, template *templatev1.Template, cb CallbackFunc) (result ctrl.Result, err error)
- func (tm *TemplateManager) Template(data []byte, vars interface{}) ([]byte, error)
- type TypedField
- type Watcher
- type WatcherInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackFunc ¶ added in v0.1.18
type CallbackFunc func(unstructured.Unstructured) error
type Conditionals ¶ added in v0.1.11
type Conditionals struct {
When string `json:"when"`
}
type ConvertSchemaFn ¶ added in v0.7.0
type ConvertSchemaFn func(schema.GroupVersionKind, extv1.CustomResourceDefinitionVersion) (*spec.Schema, error)
type FetchCRDFn ¶ added in v0.7.0
type FetchCRDFn func(context.Context) ([]extv1.CustomResourceDefinition, error)
type ForEachResource ¶ added in v0.1.9
type ForEachResource struct {
ForEach string `json:"forEach"`
}
type MapInterface ¶ added in v0.1.2
type MapInterface map[string]interface{}
type NullWatcher ¶ added in v0.1.18
type NullWatcher struct{}
func (*NullWatcher) Watch ¶ added in v0.1.18
func (w *NullWatcher) Watch(exampleObject *unstructured.Unstructured, template *templatev1.Template, cb CallbackFunc) error
type PatchApplier ¶
type PatchApplier struct { Clientset *kubernetes.Clientset Log logr.Logger FuncMap template.FuncMap SchemaManager *SchemaManager }
func NewPatchApplier ¶
func NewPatchApplier(clientset *kubernetes.Clientset, schemaManager *SchemaManager, log logr.Logger) (*PatchApplier, error)
func (*PatchApplier) Apply ¶
func (p *PatchApplier) Apply(resource *unstructured.Unstructured, patchStr string, patchType PatchType) (*unstructured.Unstructured, error)
type RESTManager ¶ added in v0.5.0
type RESTManager struct { Client *kommons.Client kubernetes.Interface Log logr.Logger FuncMap template.FuncMap }
func NewRESTManager ¶ added in v0.5.0
func (*RESTManager) Delete ¶ added in v0.5.0
func (r *RESTManager) Delete(ctx context.Context, rest *templatev1.REST) error
func (*RESTManager) Update ¶ added in v0.5.0
func (r *RESTManager) Update(ctx context.Context, rest *templatev1.REST) (map[string]string, error)
type ResourcePatch ¶
type ResourcePatch struct { Resource *unstructured.Unstructured Patch string Kind string APIVersion string PatchType PatchType }
type SchemaCache ¶ added in v0.1.7
type SchemaCache struct {
// contains filtered or unexported fields
}
func NewSchemaCache ¶ added in v0.1.7
func NewSchemaCache(clientset *kubernetes.Clientset, crdClient extapi.ApiextensionsV1Interface, expire time.Duration, log logr.Logger) *SchemaCache
func (*SchemaCache) CachedConvertSchema ¶ added in v0.7.0
func (sc *SchemaCache) CachedConvertSchema(gvk schema.GroupVersionKind, crd extv1.CustomResourceDefinitionVersion) (*spec.Schema, error)
func (*SchemaCache) ExpireResources ¶ added in v0.1.15
func (sc *SchemaCache) ExpireResources() error
func (*SchemaCache) ExpireSchema ¶ added in v0.1.15
func (sc *SchemaCache) ExpireSchema() error
func (*SchemaCache) FetchCRD ¶ added in v0.7.0
func (sc *SchemaCache) FetchCRD() ([]extv1.CustomResourceDefinition, error)
func (*SchemaCache) FetchResources ¶ added in v0.1.7
func (sc *SchemaCache) FetchResources() ([]*metav1.APIResourceList, error)
func (*SchemaCache) FetchSchema ¶ added in v0.1.7
func (sc *SchemaCache) FetchSchema() (*spec.Swagger, error)
func (*SchemaCache) ResourceHasExpired ¶ added in v0.1.15
func (sc *SchemaCache) ResourceHasExpired() bool
func (*SchemaCache) SchemaHasExpired ¶ added in v0.1.15
func (sc *SchemaCache) SchemaHasExpired() bool
type SchemaManager ¶ added in v0.1.2
type SchemaManager struct {
// contains filtered or unexported fields
}
func NewSchemaManager ¶ added in v0.1.2
func NewSchemaManager(clientset *kubernetes.Clientset, crdClient extapi.ApiextensionsV1Interface, log logr.Logger) (*SchemaManager, error)
func NewSchemaManagerWithCache ¶ added in v0.1.7
func NewSchemaManagerWithCache(clientset *kubernetes.Clientset, crdClient extapi.ApiextensionsV1Interface, cache *SchemaCache, log logr.Logger) (*SchemaManager, error)
func (*SchemaManager) DuckType ¶ added in v0.1.2
func (m *SchemaManager) DuckType(gvk schema.GroupVersionKind, object *unstructured.Unstructured) error
func (*SchemaManager) FindSchemaForKind ¶ added in v0.1.2
func (m *SchemaManager) FindSchemaForKind(gvk schema.GroupVersionKind) (*spec.Schema, bool, error)
func (*SchemaManager) FindTypeForKey ¶ added in v0.1.2
func (m *SchemaManager) FindTypeForKey(gvk schema.GroupVersionKind, key string) (*TypedField, error)
func (*SchemaManager) FindTypeForKeyFromSchema ¶ added in v0.1.2
func (m *SchemaManager) FindTypeForKeyFromSchema(schema *spec.Schema, key string) (*TypedField, error)
type TemplateManager ¶
type TemplateManager struct { Client *kommons.Client kubernetes.Interface Log logr.Logger PatchApplier *PatchApplier SchemaManager *SchemaManager SchemaCache *SchemaCache FuncMap template.FuncMap Events record.EventRecorder Watcher WatcherInterface }
func NewTemplateManager ¶
func NewTemplateManager(c *kommons.Client, log logr.Logger, cache *SchemaCache, events record.EventRecorder, watcher WatcherInterface) (*TemplateManager, error)
func (*TemplateManager) GetSourceNamespaces ¶ added in v0.1.18
func (tm *TemplateManager) GetSourceNamespaces(ctx context.Context, template *templatev1.Template) ([]string, error)
func (*TemplateManager) HandleSource ¶ added in v0.1.18
func (tm *TemplateManager) HandleSource(ctx context.Context, template *templatev1.Template, source unstructured.Unstructured) (result ctrl.Result, err error)
func (*TemplateManager) JSONPath ¶ added in v0.1.9
func (tm *TemplateManager) JSONPath(object interface{}, jsonpath string) (*ForEach, error)
func (*TemplateManager) Run ¶
func (tm *TemplateManager) Run(ctx context.Context, template *templatev1.Template, cb CallbackFunc) (result ctrl.Result, err error)
type TypedField ¶ added in v0.1.2
type Watcher ¶ added in v0.1.18
type Watcher struct {
// contains filtered or unexported fields
}
func (*Watcher) Watch ¶ added in v0.1.18
func (w *Watcher) Watch(exampleObject *unstructured.Unstructured, template *templatev1.Template, cb CallbackFunc) error
type WatcherInterface ¶ added in v0.1.18
type WatcherInterface interface {
Watch(exampleObject *unstructured.Unstructured, template *templatev1.Template, cb CallbackFunc) error
}
func NewWatcher ¶ added in v0.1.18
Click to show internal directories.
Click to hide internal directories.