Documentation ¶
Overview ¶
The Input Reconciler calls a simple func() error whenever a storage event is received for any of: * IssuedCertificates * CertificateRequests * PodBounceDirectives * Secrets * ServiceAccounts * ConfigMaps * Pods for a given cluster or set of clusters.
Input Reconcilers can be be constructed from either a single Manager (watch events in a single cluster) or a ClusterWatcher (watch events in multiple clusters).
Utility for manually building input snapshots. Used primarily in tests.
Index ¶
- Variables
- func RegisterMultiClusterReconciler(ctx context.Context, clusters multicluster.ClusterWatcher, ...) input.InputReconciler
- func RegisterSingleClusterReconciler(ctx context.Context, mgr manager.Manager, ...) (input.InputReconciler, error)
- type BuildOptions
- type Builder
- func NewInMemoryBuilder(getSnapshot func() (resource.ClusterSnapshot, error)) Builder
- func NewMultiClusterBuilder(clusters multicluster.Interface, client multicluster.Client) Builder
- func NewSingleClusterBuilder(mgr manager.Manager) Builder
- func NewSingleClusterBuilderWithClusterName(mgr manager.Manager, clusterName string) Builder
- type InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddCertificateRequests(certificateRequests []*certificates_mesh_gloo_solo_io_v1.CertificateRequest) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddConfigMaps(configMaps []*v1.ConfigMap) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddIssuedCertificates(issuedCertificates []*certificates_mesh_gloo_solo_io_v1.IssuedCertificate) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddPodBounceDirectives(podBounceDirectives []*certificates_mesh_gloo_solo_io_v1.PodBounceDirective) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddPods(pods []*v1.Pod) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddSecrets(secrets []*v1.Secret) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddServiceAccounts(serviceAccounts []*v1.ServiceAccount) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) Build() Snapshot
- type ReconcileOptions
- type ResourceBuildOptions
- type Snapshot
- type SyncStatusOptions
Constants ¶
This section is empty.
Variables ¶
var SnapshotGVKs = []schema.GroupVersionKind{ schema.GroupVersionKind{ Group: "certificates.mesh.gloo.solo.io", Version: "v1", Kind: "IssuedCertificate", }, schema.GroupVersionKind{ Group: "certificates.mesh.gloo.solo.io", Version: "v1", Kind: "CertificateRequest", }, schema.GroupVersionKind{ Group: "certificates.mesh.gloo.solo.io", Version: "v1", Kind: "PodBounceDirective", }, schema.GroupVersionKind{ Group: "", Version: "v1", Kind: "Secret", }, schema.GroupVersionKind{ Group: "", Version: "v1", Kind: "ServiceAccount", }, schema.GroupVersionKind{ Group: "", Version: "v1", Kind: "ConfigMap", }, schema.GroupVersionKind{ Group: "", Version: "v1", Kind: "Pod", }, }
SnapshotGVKs is a list of the GVKs included in this snapshot
Functions ¶
func RegisterMultiClusterReconciler ¶
func RegisterMultiClusterReconciler( ctx context.Context, clusters multicluster.ClusterWatcher, reconcileFunc input.MultiClusterReconcileFunc, reconcileInterval time.Duration, options ReconcileOptions, predicates ...predicate.Predicate, ) input.InputReconciler
register the reconcile func with the cluster watcher the reconcileInterval, if greater than 0, will limit the number of reconciles to one per interval.
func RegisterSingleClusterReconciler ¶
func RegisterSingleClusterReconciler( ctx context.Context, mgr manager.Manager, reconcileFunc input.SingleClusterReconcileFunc, reconcileInterval time.Duration, options reconcile.Options, predicates ...predicate.Predicate, ) (input.InputReconciler, error)
register the reconcile func with the manager the reconcileInterval, if greater than 0, will limit the number of reconciles to one per interval.
Types ¶
type BuildOptions ¶
type BuildOptions struct { // List options for composing a snapshot from IssuedCertificates IssuedCertificates ResourceBuildOptions // List options for composing a snapshot from CertificateRequests CertificateRequests ResourceBuildOptions // List options for composing a snapshot from PodBounceDirectives PodBounceDirectives ResourceBuildOptions // List options for composing a snapshot from Secrets Secrets ResourceBuildOptions // List options for composing a snapshot from ServiceAccounts ServiceAccounts ResourceBuildOptions // List options for composing a snapshot from ConfigMaps ConfigMaps ResourceBuildOptions // List options for composing a snapshot from Pods Pods ResourceBuildOptions }
Options for building a snapshot
type Builder ¶
type Builder interface {
BuildSnapshot(ctx context.Context, name string, opts BuildOptions) (Snapshot, error)
}
builds the input snapshot from API Clients.
func NewInMemoryBuilder ¶ added in v0.12.7
func NewInMemoryBuilder( getSnapshot func() (resource.ClusterSnapshot, error), ) Builder
Produces snapshots of resources read from the manager for the given cluster
func NewMultiClusterBuilder ¶
func NewMultiClusterBuilder( clusters multicluster.Interface, client multicluster.Client, ) Builder
Produces snapshots of resources across all clusters defined in the ClusterSet
func NewSingleClusterBuilder ¶
Produces snapshots of resources read from the manager for the given cluster
type InputSnapshotManualBuilder ¶
type InputSnapshotManualBuilder struct {
// contains filtered or unexported fields
}
func NewInputSnapshotManualBuilder ¶
func NewInputSnapshotManualBuilder(name string) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddCertificateRequests ¶
func (i *InputSnapshotManualBuilder) AddCertificateRequests(certificateRequests []*certificates_mesh_gloo_solo_io_v1.CertificateRequest) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddConfigMaps ¶ added in v0.12.6
func (i *InputSnapshotManualBuilder) AddConfigMaps(configMaps []*v1.ConfigMap) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddIssuedCertificates ¶
func (i *InputSnapshotManualBuilder) AddIssuedCertificates(issuedCertificates []*certificates_mesh_gloo_solo_io_v1.IssuedCertificate) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddPodBounceDirectives ¶
func (i *InputSnapshotManualBuilder) AddPodBounceDirectives(podBounceDirectives []*certificates_mesh_gloo_solo_io_v1.PodBounceDirective) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddPods ¶
func (i *InputSnapshotManualBuilder) AddPods(pods []*v1.Pod) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddSecrets ¶
func (i *InputSnapshotManualBuilder) AddSecrets(secrets []*v1.Secret) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddServiceAccounts ¶ added in v1.1.0
func (i *InputSnapshotManualBuilder) AddServiceAccounts(serviceAccounts []*v1.ServiceAccount) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) Build ¶
func (i *InputSnapshotManualBuilder) Build() Snapshot
type ReconcileOptions ¶
type ReconcileOptions struct { // Options for reconciling IssuedCertificates IssuedCertificates reconcile.Options // Options for reconciling CertificateRequests CertificateRequests reconcile.Options // Options for reconciling PodBounceDirectives PodBounceDirectives reconcile.Options // Options for reconciling Secrets Secrets reconcile.Options // Options for reconciling ServiceAccounts ServiceAccounts reconcile.Options // Options for reconciling ConfigMaps ConfigMaps reconcile.Options // Options for reconciling Pods Pods reconcile.Options }
Options for reconciling a snapshot
type ResourceBuildOptions ¶
type ResourceBuildOptions struct { // List options for composing a snapshot from a resource type ListOptions []client.ListOption // If provided, ensure the resource has been verified before adding it to snapshots Verifier verifier.ServerResourceVerifier }
Options for reading resources of a given type
type Snapshot ¶
type Snapshot interface { // return the set of input IssuedCertificates IssuedCertificates() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet // return the set of input CertificateRequests CertificateRequests() certificates_mesh_gloo_solo_io_v1_sets.CertificateRequestSet // return the set of input PodBounceDirectives PodBounceDirectives() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet // return the set of input Secrets Secrets() v1_sets.SecretSet // return the set of input ServiceAccounts ServiceAccounts() v1_sets.ServiceAccountSet // return the set of input ConfigMaps ConfigMaps() v1_sets.ConfigMapSet // return the set of input Pods Pods() v1_sets.PodSet // update the status of all input objects which support // the Status subresource (across multiple clusters) SyncStatusesMultiCluster(ctx context.Context, mcClient multicluster.Client, opts SyncStatusOptions) error // update the status of all input objects which support // the Status subresource (in the local cluster) SyncStatuses(ctx context.Context, c client.Client, opts SyncStatusOptions) error // serialize the entire snapshot as JSON MarshalJSON() ([]byte, error) }
the snapshot of input resources consumed by translation
func NewSnapshot ¶
func NewSnapshot( name string, issuedCertificates certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet, certificateRequests certificates_mesh_gloo_solo_io_v1_sets.CertificateRequestSet, podBounceDirectives certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet, secrets v1_sets.SecretSet, serviceAccounts v1_sets.ServiceAccountSet, configMaps v1_sets.ConfigMapSet, pods v1_sets.PodSet, ) Snapshot
func NewSnapshotFromGeneric ¶ added in v0.12.7
func NewSnapshotFromGeneric( name string, genericSnapshot resource.ClusterSnapshot, ) Snapshot
type SyncStatusOptions ¶ added in v0.10.8
type SyncStatusOptions struct { // sync status of IssuedCertificate objects IssuedCertificate bool // sync status of CertificateRequest objects CertificateRequest bool // sync status of PodBounceDirective objects PodBounceDirective bool // sync status of Secret objects Secret bool // sync status of ServiceAccount objects ServiceAccount bool // sync status of ConfigMap objects ConfigMap bool // sync status of Pod objects Pod bool }
options for syncing input object statuses