Documentation ¶
Overview ¶
The Input Reconciler calls a simple func() error whenever a storage event is received for any of: * Settings * TrafficTargets * Workloads * Meshes * TrafficPolicies * AccessPolicies * VirtualMeshes * FailoverServices * Secrets * KubernetesClusters 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 ¶
- func RegisterMultiClusterReconciler(ctx context.Context, clusters multicluster.ClusterWatcher, ...) input.MultiClusterReconciler
- func RegisterSingleClusterReconciler(ctx context.Context, mgr manager.Manager, ...) (input.SingleClusterReconciler, error)
- type BuildOptions
- type Builder
- type InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddAccessPolicies(accessPolicies []*networking_mesh_gloo_solo_io_v1alpha2.AccessPolicy) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddFailoverServices(failoverServices []*networking_mesh_gloo_solo_io_v1alpha2.FailoverService) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddKubernetesClusters(kubernetesClusters []*multicluster_solo_io_v1alpha1.KubernetesCluster) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddMeshes(meshes []*discovery_mesh_gloo_solo_io_v1alpha2.Mesh) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddSecrets(secrets []*v1.Secret) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddSettings(settings []*settings_mesh_gloo_solo_io_v1alpha2.Settings) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddTrafficPolicies(trafficPolicies []*networking_mesh_gloo_solo_io_v1alpha2.TrafficPolicy) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddTrafficTargets(trafficTargets []*discovery_mesh_gloo_solo_io_v1alpha2.TrafficTarget) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddVirtualMeshes(virtualMeshes []*networking_mesh_gloo_solo_io_v1alpha2.VirtualMesh) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddWorkloads(workloads []*discovery_mesh_gloo_solo_io_v1alpha2.Workload) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) Build() Snapshot
- type ReconcileOptions
- type ResourceBuildOptions
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMultiClusterReconciler ¶
func RegisterMultiClusterReconciler( ctx context.Context, clusters multicluster.ClusterWatcher, reconcileFunc input.MultiClusterReconcileFunc, reconcileInterval time.Duration, options ReconcileOptions, predicates ...predicate.Predicate, ) input.MultiClusterReconciler
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.SingleClusterReconciler, 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 Settings Settings ResourceBuildOptions // List options for composing a snapshot from TrafficTargets TrafficTargets ResourceBuildOptions // List options for composing a snapshot from Workloads Workloads ResourceBuildOptions // List options for composing a snapshot from Meshes Meshes ResourceBuildOptions // List options for composing a snapshot from TrafficPolicies TrafficPolicies ResourceBuildOptions // List options for composing a snapshot from AccessPolicies AccessPolicies ResourceBuildOptions // List options for composing a snapshot from VirtualMeshes VirtualMeshes ResourceBuildOptions // List options for composing a snapshot from FailoverServices FailoverServices ResourceBuildOptions // List options for composing a snapshot from Secrets Secrets ResourceBuildOptions // List options for composing a snapshot from KubernetesClusters KubernetesClusters 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. Two types of builders are available: a builder for snapshots of resources across multiple clusters a builder for snapshots of resources within a single 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 across all clusters defined in the ClusterSet
type InputSnapshotManualBuilder ¶
type InputSnapshotManualBuilder struct {
// contains filtered or unexported fields
}
func NewInputSnapshotManualBuilder ¶
func NewInputSnapshotManualBuilder(name string) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddAccessPolicies ¶
func (i *InputSnapshotManualBuilder) AddAccessPolicies(accessPolicies []*networking_mesh_gloo_solo_io_v1alpha2.AccessPolicy) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddFailoverServices ¶
func (i *InputSnapshotManualBuilder) AddFailoverServices(failoverServices []*networking_mesh_gloo_solo_io_v1alpha2.FailoverService) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddKubernetesClusters ¶
func (i *InputSnapshotManualBuilder) AddKubernetesClusters(kubernetesClusters []*multicluster_solo_io_v1alpha1.KubernetesCluster) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddMeshes ¶
func (i *InputSnapshotManualBuilder) AddMeshes(meshes []*discovery_mesh_gloo_solo_io_v1alpha2.Mesh) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddSecrets ¶
func (i *InputSnapshotManualBuilder) AddSecrets(secrets []*v1.Secret) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddSettings ¶
func (i *InputSnapshotManualBuilder) AddSettings(settings []*settings_mesh_gloo_solo_io_v1alpha2.Settings) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddTrafficPolicies ¶
func (i *InputSnapshotManualBuilder) AddTrafficPolicies(trafficPolicies []*networking_mesh_gloo_solo_io_v1alpha2.TrafficPolicy) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddTrafficTargets ¶
func (i *InputSnapshotManualBuilder) AddTrafficTargets(trafficTargets []*discovery_mesh_gloo_solo_io_v1alpha2.TrafficTarget) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddVirtualMeshes ¶
func (i *InputSnapshotManualBuilder) AddVirtualMeshes(virtualMeshes []*networking_mesh_gloo_solo_io_v1alpha2.VirtualMesh) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddWorkloads ¶
func (i *InputSnapshotManualBuilder) AddWorkloads(workloads []*discovery_mesh_gloo_solo_io_v1alpha2.Workload) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) Build ¶
func (i *InputSnapshotManualBuilder) Build() Snapshot
type ReconcileOptions ¶
type ReconcileOptions struct { // Options for reconciling Settings Settings reconcile.Options // Options for reconciling TrafficTargets TrafficTargets reconcile.Options // Options for reconciling Workloads Workloads reconcile.Options // Options for reconciling Meshes Meshes reconcile.Options // Options for reconciling TrafficPolicies TrafficPolicies reconcile.Options // Options for reconciling AccessPolicies AccessPolicies reconcile.Options // Options for reconciling VirtualMeshes VirtualMeshes reconcile.Options // Options for reconciling FailoverServices FailoverServices reconcile.Options // Options for reconciling Secrets Secrets reconcile.Options // Options for reconciling KubernetesClusters KubernetesClusters reconcile.Options }
Options for reconcileing 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 Settings Settings() settings_mesh_gloo_solo_io_v1alpha2_sets.SettingsSet // return the set of input TrafficTargets TrafficTargets() discovery_mesh_gloo_solo_io_v1alpha2_sets.TrafficTargetSet // return the set of input Workloads Workloads() discovery_mesh_gloo_solo_io_v1alpha2_sets.WorkloadSet // return the set of input Meshes Meshes() discovery_mesh_gloo_solo_io_v1alpha2_sets.MeshSet // return the set of input TrafficPolicies TrafficPolicies() networking_mesh_gloo_solo_io_v1alpha2_sets.TrafficPolicySet // return the set of input AccessPolicies AccessPolicies() networking_mesh_gloo_solo_io_v1alpha2_sets.AccessPolicySet // return the set of input VirtualMeshes VirtualMeshes() networking_mesh_gloo_solo_io_v1alpha2_sets.VirtualMeshSet // return the set of input FailoverServices FailoverServices() networking_mesh_gloo_solo_io_v1alpha2_sets.FailoverServiceSet // return the set of input Secrets Secrets() v1_sets.SecretSet // return the set of input KubernetesClusters KubernetesClusters() multicluster_solo_io_v1alpha1_sets.KubernetesClusterSet // update the status of all input objects which support // the Status subresource (in the local cluster) SyncStatuses(ctx context.Context, c client.Client) error // update the status of all input objects which support // the Status subresource (across multiple clusters) SyncStatusesMultiCluster(ctx context.Context, mcClient multicluster.Client) error // serialize the entire snapshot as JSON MarshalJSON() ([]byte, error) }
the snapshot of input resources consumed by translation
func NewSnapshot ¶
func NewSnapshot( name string, settings settings_mesh_gloo_solo_io_v1alpha2_sets.SettingsSet, trafficTargets discovery_mesh_gloo_solo_io_v1alpha2_sets.TrafficTargetSet, workloads discovery_mesh_gloo_solo_io_v1alpha2_sets.WorkloadSet, meshes discovery_mesh_gloo_solo_io_v1alpha2_sets.MeshSet, trafficPolicies networking_mesh_gloo_solo_io_v1alpha2_sets.TrafficPolicySet, accessPolicies networking_mesh_gloo_solo_io_v1alpha2_sets.AccessPolicySet, virtualMeshes networking_mesh_gloo_solo_io_v1alpha2_sets.VirtualMeshSet, failoverServices networking_mesh_gloo_solo_io_v1alpha2_sets.FailoverServiceSet, secrets v1_sets.SecretSet, kubernetesClusters multicluster_solo_io_v1alpha1_sets.KubernetesClusterSet, ) Snapshot