Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorIsTransient(err error) bool
- type AdmissionReconciler
- type CacheSizeCollector
- type EspejoteError
- type EspejoteErrorType
- type ManagedResourceReconciler
- type ManifestImporter
- type MultiImporter
- type MultiImporterCacheEntry
- type MultiImporterConfig
- type Renderer
- type Request
- type TriggerInfo
- type WatchResource
Constants ¶
const MetricsNamespace = "espejote"
Variables ¶
var ErrCacheNotReady = errors.New("cache not ready")
var ErrFailedSyncCache = errors.New("failed to sync cache")
var EspejoteLibsonnet string
Functions ¶
func ErrorIsTransient ¶ added in v0.4.1
ErrorIsTransient returns true if the error is transient and the reconciliation should be retried without an error log and backoff.
Types ¶
type AdmissionReconciler ¶ added in v0.3.0
type AdmissionReconciler struct { client.Client MutatingWebhookName string ValidatingWebhookName string WebhookPort int32 WebhookServiceName string ControllerNamespace string }
AdmissionReconciler reconciles Admission objects.
func (*AdmissionReconciler) Reconcile ¶ added in v0.3.0
func (r *AdmissionReconciler) Reconcile(ctx context.Context, _ reconcile.Request) (ctrl.Result, error)
Reconcile adds admissions to the MutatingWebhookConfiguration and ValidatingWebhookConfigurations.
func (*AdmissionReconciler) SetupWithManager ¶ added in v0.3.0
func (r *AdmissionReconciler) SetupWithManager(mgr ctrl.Manager) error
Setup sets up the controller with the Manager.
type CacheSizeCollector ¶
type CacheSizeCollector struct {
ManagedResourceReconciler *ManagedResourceReconciler
}
CacheSizeCollector collects cache size metrics. It loops over all caches and collects the number of cached objects and the size of the cache.
func (*CacheSizeCollector) Collect ¶
func (c *CacheSizeCollector) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*CacheSizeCollector) Describe ¶
func (c *CacheSizeCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
type EspejoteError ¶
type EspejoteError struct { Type EspejoteErrorType // contains filtered or unexported fields }
func (EspejoteError) Error ¶
func (e EspejoteError) Error() string
func (EspejoteError) Transient ¶ added in v0.4.1
func (e EspejoteError) Transient() bool
Transient returns true if the error is transient and the reconciliation should be retried without an error log and backoff.
type EspejoteErrorType ¶
type EspejoteErrorType string
const ( ServiceAccountError EspejoteErrorType = "ServiceAccountError" WaitingForCacheSync EspejoteErrorType = "WaitingForCacheSync" DependencyConfigurationError EspejoteErrorType = "DependencyConfigurationError" TemplateError EspejoteErrorType = "TemplateError" ApplyError EspejoteErrorType = "ApplyError" TemplateReturnError EspejoteErrorType = "TemplateReturnError" )
type ManagedResourceReconciler ¶
type ManagedResourceReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder ControllerLifetimeCtx context.Context JsonnetLibraryNamespace string // contains filtered or unexported fields }
func (*ManagedResourceReconciler) SetupWithName ¶ added in v0.4.1
func (r *ManagedResourceReconciler) SetupWithName(cfg *rest.Config, mgr ctrl.Manager, name string) error
SetupWithName sets up the controller with the Manager and a name for the global metrics registry.
type ManifestImporter ¶
ManifestImporter imports data from espejotev1alpha1.JsonnetLibraries.
func (*ManifestImporter) Import ¶
func (importer *ManifestImporter) Import(_, importedPath string) (contents jsonnet.Contents, foundAt string, err error)
Import fetches from espejotev1alpha1.JsonnetLibraries in the cluster The first path segment is the name of the JsonnetLibrary object. The second path segment is the key in the JsonnetLibrary object.
type MultiImporter ¶
type MultiImporter struct { Importers []MultiImporterConfig Cache map[string]MultiImporterCacheEntry }
MultiImporter imports from multiple importers. It tries each importer in order until one succeeds. If all importers fail, it returns an error combining all errors. Lookup results are cached for the lifetime of the importer and can be accessed through the Cache field. The cache is not thread-safe. Same as the upstream FileImporter.
func FromClientImporter ¶
func FromClientImporter(c client.Client, localNamespace, libNamespace string) *MultiImporter
FromClientImporter returns an importer that fetches libraries from the cluster using the given client. "espejote.libsonnet" is statically embedded.
type MultiImporterCacheEntry ¶
MultiImporterCacheEntry is a cache entry for MultiImporter. It holds the result of the last import.
type MultiImporterConfig ¶
type MultiImporterConfig struct { Importer jsonnet.Importer TrimPathPrefix string }
type Renderer ¶
type Renderer struct { Importer jsonnet.Importer TriggerClientGetter func(triggerName string) (client.Reader, error) ContextClientGetter func(contextName string) (client.Reader, error) }
Render renders the given ManagedResource.
func (*Renderer) Render ¶
func (r *Renderer) Render(ctx context.Context, managedResource espejotev1alpha1.ManagedResource, ti TriggerInfo) (string, error)
Render renders the given ManagedResource.
type Request ¶
type Request = struct { NamespacedName types.NamespacedName // Include more trigger info TriggerInfo TriggerInfo }
type TriggerInfo ¶
type TriggerInfo struct { TriggerName string WatchResource WatchResource }