input

package
v1.0.0-beta7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Overview

Utility for manually building input snapshots. Used primarily in tests.

Utility for manually building input snapshots. Used primarily in tests.

Index

Constants

This section is empty.

Variables

View Source
var LocalSnapshotGVKs = []schema.GroupVersionKind{

	schema.GroupVersionKind{
		Group:   "settings.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "Settings",
	},

	schema.GroupVersionKind{
		Group:   "discovery.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "Destination",
	},
	schema.GroupVersionKind{
		Group:   "discovery.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "Workload",
	},
	schema.GroupVersionKind{
		Group:   "discovery.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "Mesh",
	},

	schema.GroupVersionKind{
		Group:   "networking.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "TrafficPolicy",
	},
	schema.GroupVersionKind{
		Group:   "networking.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "AccessPolicy",
	},
	schema.GroupVersionKind{
		Group:   "networking.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "VirtualMesh",
	},

	schema.GroupVersionKind{
		Group:   "networking.enterprise.mesh.gloo.solo.io",
		Version: "v1beta1",
		Kind:    "WasmDeployment",
	},
	schema.GroupVersionKind{
		Group:   "networking.enterprise.mesh.gloo.solo.io",
		Version: "v1beta1",
		Kind:    "VirtualDestination",
	},

	schema.GroupVersionKind{
		Group:   "observability.enterprise.mesh.gloo.solo.io",
		Version: "v1",
		Kind:    "AccessLogRecord",
	},

	schema.GroupVersionKind{
		Group:   "",
		Version: "v1",
		Kind:    "Secret",
	},

	schema.GroupVersionKind{
		Group:   "multicluster.solo.io",
		Version: "v1alpha1",
		Kind:    "KubernetesCluster",
	},
}

SnapshotGVKs is a list of the GVKs included in this snapshot

View Source
var RemoteSnapshotGVKs = []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:    "PodBounceDirective",
	},

	schema.GroupVersionKind{
		Group:   "xds.agent.enterprise.mesh.gloo.solo.io",
		Version: "v1beta1",
		Kind:    "XdsConfig",
	},

	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "DestinationRule",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "EnvoyFilter",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "Gateway",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "ServiceEntry",
	},
	schema.GroupVersionKind{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
		Kind:    "VirtualService",
	},

	schema.GroupVersionKind{
		Group:   "security.istio.io",
		Version: "v1beta1",
		Kind:    "AuthorizationPolicy",
	},
}

SnapshotGVKs is a list of the GVKs included in this snapshot

Functions

func RegisterInputReconciler added in v0.11.1

func RegisterInputReconciler(
	ctx context.Context,
	clusters multicluster.ClusterWatcher,
	multiClusterReconcileFunc input.MultiClusterReconcileFunc,
	mgr manager.Manager,
	singleClusterReconcileFunc input.SingleClusterReconcileFunc,
	options ReconcileOptions,
) (input.InputReconciler, error)

register the given multi cluster reconcile func with the cluster watcher register the given single cluster reconcile func with the local manager

Types

type InputLocalSnapshotManualBuilder added in v0.11.1

type InputLocalSnapshotManualBuilder struct {
	// contains filtered or unexported fields
}

func NewInputLocalSnapshotManualBuilder added in v0.11.1

func NewInputLocalSnapshotManualBuilder(name string) *InputLocalSnapshotManualBuilder

func (*InputLocalSnapshotManualBuilder) AddAccessLogRecords added in v0.12.3

func (*InputLocalSnapshotManualBuilder) AddAccessPolicies added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddDestinations added in v1.0.0

func (*InputLocalSnapshotManualBuilder) AddKubernetesClusters added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddMeshes added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddSecrets added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddSettings added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddTrafficPolicies added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddVirtualDestinations added in v1.0.0

func (*InputLocalSnapshotManualBuilder) AddVirtualMeshes added in v0.11.1

func (*InputLocalSnapshotManualBuilder) AddWasmDeployments added in v0.12.1

func (*InputLocalSnapshotManualBuilder) AddWorkloads added in v0.11.1

func (*InputLocalSnapshotManualBuilder) Build added in v0.11.1

type InputRemoteSnapshotManualBuilder added in v0.11.1

type InputRemoteSnapshotManualBuilder struct {
	// contains filtered or unexported fields
}

func NewInputRemoteSnapshotManualBuilder added in v0.11.1

func NewInputRemoteSnapshotManualBuilder(name string) *InputRemoteSnapshotManualBuilder

func (*InputRemoteSnapshotManualBuilder) AddAuthorizationPolicies added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddDestinationRules added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddEnvoyFilters added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddGateways added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddIssuedCertificates added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddPodBounceDirectives added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddServiceEntries added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddVirtualServices added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) AddXdsConfigs added in v0.11.1

func (*InputRemoteSnapshotManualBuilder) Build added in v0.11.1

type LocalBuildOptions added in v0.11.1

type LocalBuildOptions struct {

	// List options for composing a snapshot from Settings
	Settings ResourceLocalBuildOptions

	// List options for composing a snapshot from Destinations
	Destinations ResourceLocalBuildOptions
	// List options for composing a snapshot from Workloads
	Workloads ResourceLocalBuildOptions
	// List options for composing a snapshot from Meshes
	Meshes ResourceLocalBuildOptions

	// List options for composing a snapshot from TrafficPolicies
	TrafficPolicies ResourceLocalBuildOptions
	// List options for composing a snapshot from AccessPolicies
	AccessPolicies ResourceLocalBuildOptions
	// List options for composing a snapshot from VirtualMeshes
	VirtualMeshes ResourceLocalBuildOptions

	// List options for composing a snapshot from WasmDeployments
	WasmDeployments ResourceLocalBuildOptions
	// List options for composing a snapshot from VirtualDestinations
	VirtualDestinations ResourceLocalBuildOptions

	// List options for composing a snapshot from AccessLogRecords
	AccessLogRecords ResourceLocalBuildOptions

	// List options for composing a snapshot from Secrets
	Secrets ResourceLocalBuildOptions

	// List options for composing a snapshot from KubernetesClusters
	KubernetesClusters ResourceLocalBuildOptions
}

Options for building a snapshot

type LocalBuilder added in v0.11.1

type LocalBuilder interface {
	BuildSnapshot(ctx context.Context, name string, opts LocalBuildOptions) (LocalSnapshot, error)
}

builds the input snapshot from API Clients.

func NewInMemoryLocalBuilder added in v0.12.7

func NewInMemoryLocalBuilder(
	getSnapshot func() (resource.ClusterSnapshot, error),
) LocalBuilder

Produces snapshots of resources read from the manager for the given cluster

func NewMultiClusterLocalBuilder added in v0.12.0

func NewMultiClusterLocalBuilder(
	clusters multicluster.Interface,
	client multicluster.Client,
) LocalBuilder

Produces snapshots of resources across all clusters defined in the ClusterSet

func NewSingleClusterLocalBuilder added in v0.11.1

func NewSingleClusterLocalBuilder(
	mgr manager.Manager,
) LocalBuilder

Produces snapshots of resources read from the manager for the given cluster

func NewSingleClusterLocalBuilderWithClusterName added in v0.12.0

func NewSingleClusterLocalBuilderWithClusterName(
	mgr manager.Manager,
	clusterName string,
) LocalBuilder

Produces snapshots of resources read from the manager for the given cluster. Snapshot resources will be marked with the given ClusterName.

type LocalReconcileOptions added in v0.11.1

type LocalReconcileOptions struct {

	// Options for reconciling Settings
	Settings reconcile.Options

	// Options for reconciling Destinations
	Destinations 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 WasmDeployments
	WasmDeployments reconcile.Options
	// Options for reconciling VirtualDestinations
	VirtualDestinations reconcile.Options

	// Options for reconciling AccessLogRecords
	AccessLogRecords reconcile.Options

	// Options for reconciling Secrets
	Secrets reconcile.Options

	// Options for reconciling KubernetesClusters
	KubernetesClusters reconcile.Options

	// optional predicates for filtering local events
	Predicates []predicate.Predicate
}

Options for reconciling a snapshot in remote clusters

type LocalSnapshot added in v0.11.1

type LocalSnapshot interface {

	// return the set of input Settings
	Settings() settings_mesh_gloo_solo_io_v1_sets.SettingsSet

	// return the set of input Destinations
	Destinations() discovery_mesh_gloo_solo_io_v1_sets.DestinationSet
	// return the set of input Workloads
	Workloads() discovery_mesh_gloo_solo_io_v1_sets.WorkloadSet
	// return the set of input Meshes
	Meshes() discovery_mesh_gloo_solo_io_v1_sets.MeshSet

	// return the set of input TrafficPolicies
	TrafficPolicies() networking_mesh_gloo_solo_io_v1_sets.TrafficPolicySet
	// return the set of input AccessPolicies
	AccessPolicies() networking_mesh_gloo_solo_io_v1_sets.AccessPolicySet
	// return the set of input VirtualMeshes
	VirtualMeshes() networking_mesh_gloo_solo_io_v1_sets.VirtualMeshSet

	// return the set of input WasmDeployments
	WasmDeployments() networking_enterprise_mesh_gloo_solo_io_v1beta1_sets.WasmDeploymentSet
	// return the set of input VirtualDestinations
	VirtualDestinations() networking_enterprise_mesh_gloo_solo_io_v1beta1_sets.VirtualDestinationSet

	// return the set of input AccessLogRecords
	AccessLogRecords() observability_enterprise_mesh_gloo_solo_io_v1_sets.AccessLogRecordSet

	// 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 (across multiple clusters)
	SyncStatusesMultiCluster(ctx context.Context, mcClient multicluster.Client, opts LocalSyncStatusOptions) 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 LocalSyncStatusOptions) error
	// serialize the entire snapshot as JSON
	MarshalJSON() ([]byte, error)
}

the snapshot of input resources consumed by translation

func NewLocalSnapshotFromGeneric added in v0.12.7

func NewLocalSnapshotFromGeneric(
	name string,
	genericSnapshot resource.ClusterSnapshot,
) LocalSnapshot

type LocalSyncStatusOptions added in v0.11.1

type LocalSyncStatusOptions struct {

	// sync status of Settings objects
	Settings bool

	// sync status of Destination objects
	Destination bool
	// sync status of Workload objects
	Workload bool
	// sync status of Mesh objects
	Mesh bool

	// sync status of TrafficPolicy objects
	TrafficPolicy bool
	// sync status of AccessPolicy objects
	AccessPolicy bool
	// sync status of VirtualMesh objects
	VirtualMesh bool

	// sync status of WasmDeployment objects
	WasmDeployment bool
	// sync status of VirtualDestination objects
	VirtualDestination bool

	// sync status of AccessLogRecord objects
	AccessLogRecord bool

	// sync status of Secret objects
	Secret bool

	// sync status of KubernetesCluster objects
	KubernetesCluster bool
}

options for syncing input object statuses

type ReconcileOptions

type ReconcileOptions struct {
	Remote RemoteReconcileOptions
	Local  LocalReconcileOptions

	// the ReconcileInterval, if greater than 0, will limit the number of reconciles
	// to one per interval.
	ReconcileInterval time.Duration
}

type RemoteBuildOptions added in v0.11.1

type RemoteBuildOptions struct {

	// List options for composing a snapshot from IssuedCertificates
	IssuedCertificates ResourceRemoteBuildOptions
	// List options for composing a snapshot from PodBounceDirectives
	PodBounceDirectives ResourceRemoteBuildOptions

	// List options for composing a snapshot from XdsConfigs
	XdsConfigs ResourceRemoteBuildOptions

	// List options for composing a snapshot from DestinationRules
	DestinationRules ResourceRemoteBuildOptions
	// List options for composing a snapshot from EnvoyFilters
	EnvoyFilters ResourceRemoteBuildOptions
	// List options for composing a snapshot from Gateways
	Gateways ResourceRemoteBuildOptions
	// List options for composing a snapshot from ServiceEntries
	ServiceEntries ResourceRemoteBuildOptions
	// List options for composing a snapshot from VirtualServices
	VirtualServices ResourceRemoteBuildOptions

	// List options for composing a snapshot from AuthorizationPolicies
	AuthorizationPolicies ResourceRemoteBuildOptions
}

Options for building a snapshot

type RemoteBuilder added in v0.11.1

type RemoteBuilder interface {
	BuildSnapshot(ctx context.Context, name string, opts RemoteBuildOptions) (RemoteSnapshot, error)
}

builds the input snapshot from API Clients.

func NewInMemoryRemoteBuilder added in v0.12.7

func NewInMemoryRemoteBuilder(
	getSnapshot func() (resource.ClusterSnapshot, error),
) RemoteBuilder

Produces snapshots of resources read from the manager for the given cluster

func NewMultiClusterRemoteBuilder added in v0.11.1

func NewMultiClusterRemoteBuilder(
	clusters multicluster.Interface,
	client multicluster.Client,
) RemoteBuilder

Produces snapshots of resources across all clusters defined in the ClusterSet

func NewSingleClusterRemoteBuilder added in v0.12.0

func NewSingleClusterRemoteBuilder(
	mgr manager.Manager,
) RemoteBuilder

Produces snapshots of resources read from the manager for the given cluster

func NewSingleClusterRemoteBuilderWithClusterName added in v0.12.0

func NewSingleClusterRemoteBuilderWithClusterName(
	mgr manager.Manager,
	clusterName string,
) RemoteBuilder

Produces snapshots of resources read from the manager for the given cluster. Snapshot resources will be marked with the given ClusterName.

type RemoteReconcileOptions added in v0.11.1

type RemoteReconcileOptions struct {

	// Options for reconciling IssuedCertificates
	IssuedCertificates reconcile.Options
	// Options for reconciling PodBounceDirectives
	PodBounceDirectives reconcile.Options

	// Options for reconciling XdsConfigs
	XdsConfigs reconcile.Options

	// Options for reconciling DestinationRules
	DestinationRules reconcile.Options
	// Options for reconciling EnvoyFilters
	EnvoyFilters reconcile.Options
	// Options for reconciling Gateways
	Gateways reconcile.Options
	// Options for reconciling ServiceEntries
	ServiceEntries reconcile.Options
	// Options for reconciling VirtualServices
	VirtualServices reconcile.Options

	// Options for reconciling AuthorizationPolicies
	AuthorizationPolicies reconcile.Options

	// optional predicates for filtering remote events
	Predicates []predicate.Predicate
}

Options for reconciling a snapshot in remote clusters

type RemoteSnapshot added in v0.11.1

type RemoteSnapshot interface {

	// return the set of input IssuedCertificates
	IssuedCertificates() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet
	// return the set of input PodBounceDirectives
	PodBounceDirectives() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet

	// return the set of input XdsConfigs
	XdsConfigs() xds_agent_enterprise_mesh_gloo_solo_io_v1beta1_sets.XdsConfigSet

	// return the set of input DestinationRules
	DestinationRules() networking_istio_io_v1alpha3_sets.DestinationRuleSet
	// return the set of input EnvoyFilters
	EnvoyFilters() networking_istio_io_v1alpha3_sets.EnvoyFilterSet
	// return the set of input Gateways
	Gateways() networking_istio_io_v1alpha3_sets.GatewaySet
	// return the set of input ServiceEntries
	ServiceEntries() networking_istio_io_v1alpha3_sets.ServiceEntrySet
	// return the set of input VirtualServices
	VirtualServices() networking_istio_io_v1alpha3_sets.VirtualServiceSet

	// return the set of input AuthorizationPolicies
	AuthorizationPolicies() security_istio_io_v1beta1_sets.AuthorizationPolicySet
	// update the status of all input objects which support
	// the Status subresource (across multiple clusters)
	SyncStatusesMultiCluster(ctx context.Context, mcClient multicluster.Client, opts RemoteSyncStatusOptions) 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 RemoteSyncStatusOptions) error
	// serialize the entire snapshot as JSON
	MarshalJSON() ([]byte, error)
}

the snapshot of input resources consumed by translation

func NewRemoteSnapshotFromGeneric added in v0.12.7

func NewRemoteSnapshotFromGeneric(
	name string,
	genericSnapshot resource.ClusterSnapshot,
) RemoteSnapshot

type RemoteSyncStatusOptions added in v0.11.1

type RemoteSyncStatusOptions struct {

	// sync status of IssuedCertificate objects
	IssuedCertificate bool
	// sync status of PodBounceDirective objects
	PodBounceDirective bool

	// sync status of XdsConfig objects
	XdsConfig bool

	// sync status of DestinationRule objects
	DestinationRule bool
	// sync status of EnvoyFilter objects
	EnvoyFilter bool
	// sync status of Gateway objects
	Gateway bool
	// sync status of ServiceEntry objects
	ServiceEntry bool
	// sync status of VirtualService objects
	VirtualService bool

	// sync status of AuthorizationPolicy objects
	AuthorizationPolicy bool
}

options for syncing input object statuses

type ResourceLocalBuildOptions added in v0.11.1

type ResourceLocalBuildOptions 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 ResourceRemoteBuildOptions added in v0.11.1

type ResourceRemoteBuildOptions 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

Directories

Path Synopsis
Package mock_input is a generated GoMock package.
Package mock_input is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL