istio

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Definitions for Output Snapshots

Index

Constants

This section is empty.

Variables

View Source
var MissingRequiredLabelError = func(labelKey, resourceKind string, obj ezkube.ResourceId) error {
	return eris.Errorf("expected label %v not on labels of %v %v", labelKey, resourceKind, sets.Key(obj))
}

this error can occur if constructing a Partitioned Snapshot from a resource that is missing the partition label

View Source
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:    "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 NewBuilder

func NewBuilder(ctx context.Context, name string) *builder

Types

type Builder

type Builder interface {

	// add IssuedCertificates to the collected outputs
	AddIssuedCertificates(issuedCertificates ...*certificates_mesh_gloo_solo_io_v1.IssuedCertificate)

	// get the collected IssuedCertificates
	GetIssuedCertificates() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet

	// add PodBounceDirectives to the collected outputs
	AddPodBounceDirectives(podBounceDirectives ...*certificates_mesh_gloo_solo_io_v1.PodBounceDirective)

	// get the collected PodBounceDirectives
	GetPodBounceDirectives() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet

	// add XdsConfigs to the collected outputs
	AddXdsConfigs(xdsConfigs ...*xds_agent_enterprise_mesh_gloo_solo_io_v1beta1.XdsConfig)

	// get the collected XdsConfigs
	GetXdsConfigs() xds_agent_enterprise_mesh_gloo_solo_io_v1beta1_sets.XdsConfigSet

	// add DestinationRules to the collected outputs
	AddDestinationRules(destinationRules ...*networking_istio_io_v1alpha3.DestinationRule)

	// get the collected DestinationRules
	GetDestinationRules() networking_istio_io_v1alpha3_sets.DestinationRuleSet

	// add EnvoyFilters to the collected outputs
	AddEnvoyFilters(envoyFilters ...*networking_istio_io_v1alpha3.EnvoyFilter)

	// get the collected EnvoyFilters
	GetEnvoyFilters() networking_istio_io_v1alpha3_sets.EnvoyFilterSet

	// add Gateways to the collected outputs
	AddGateways(gateways ...*networking_istio_io_v1alpha3.Gateway)

	// get the collected Gateways
	GetGateways() networking_istio_io_v1alpha3_sets.GatewaySet

	// add ServiceEntries to the collected outputs
	AddServiceEntries(serviceEntries ...*networking_istio_io_v1alpha3.ServiceEntry)

	// get the collected ServiceEntries
	GetServiceEntries() networking_istio_io_v1alpha3_sets.ServiceEntrySet

	// add VirtualServices to the collected outputs
	AddVirtualServices(virtualServices ...*networking_istio_io_v1alpha3.VirtualService)

	// get the collected VirtualServices
	GetVirtualServices() networking_istio_io_v1alpha3_sets.VirtualServiceSet

	// add AuthorizationPolicies to the collected outputs
	AddAuthorizationPolicies(authorizationPolicies ...*security_istio_io_v1beta1.AuthorizationPolicy)

	// get the collected AuthorizationPolicies
	GetAuthorizationPolicies() security_istio_io_v1beta1_sets.AuthorizationPolicySet

	// build the collected outputs into a label-partitioned snapshot
	BuildLabelPartitionedSnapshot(labelKey string) (Snapshot, error)

	// build the collected outputs into a snapshot with a single partition
	BuildSinglePartitionedSnapshot(snapshotLabels map[string]string) (Snapshot, error)

	// add a cluster to the collected clusters.
	// this can be used to collect clusters for use with MultiCluster snapshots.
	AddCluster(cluster string)

	// returns the set of clusters currently stored in this builder
	Clusters() []string

	// merge all the resources from another Builder into this one
	Merge(other Builder)

	// create a clone of this builder (deepcopying all resources)
	Clone() Builder

	// convert this snapshot to its generic form
	Generic() resource.ClusterSnapshot
}

the output Builder uses a builder pattern to allow iteratively collecting outputs before producing a final snapshot

type LabeledAuthorizationPolicySet

type LabeledAuthorizationPolicySet interface {
	// returns the set of Labels shared by this AuthorizationPolicySet
	Labels() map[string]string

	// returns the set of AuthorizationPolicyes with the given labels
	Set() security_istio_io_v1beta1_sets.AuthorizationPolicySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledAuthorizationPolicySet represents a set of authorizationPolicies which share a common set of labels. These labels are used to find diffs between AuthorizationPolicySets.

type LabeledDestinationRuleSet

type LabeledDestinationRuleSet interface {
	// returns the set of Labels shared by this DestinationRuleSet
	Labels() map[string]string

	// returns the set of DestinationRulees with the given labels
	Set() networking_istio_io_v1alpha3_sets.DestinationRuleSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledDestinationRuleSet represents a set of destinationRules which share a common set of labels. These labels are used to find diffs between DestinationRuleSets.

type LabeledEnvoyFilterSet

type LabeledEnvoyFilterSet interface {
	// returns the set of Labels shared by this EnvoyFilterSet
	Labels() map[string]string

	// returns the set of EnvoyFilteres with the given labels
	Set() networking_istio_io_v1alpha3_sets.EnvoyFilterSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledEnvoyFilterSet represents a set of envoyFilters which share a common set of labels. These labels are used to find diffs between EnvoyFilterSets.

type LabeledGatewaySet

type LabeledGatewaySet interface {
	// returns the set of Labels shared by this GatewaySet
	Labels() map[string]string

	// returns the set of Gatewayes with the given labels
	Set() networking_istio_io_v1alpha3_sets.GatewaySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledGatewaySet represents a set of gateways which share a common set of labels. These labels are used to find diffs between GatewaySets.

type LabeledIssuedCertificateSet

type LabeledIssuedCertificateSet interface {
	// returns the set of Labels shared by this IssuedCertificateSet
	Labels() map[string]string

	// returns the set of IssuedCertificatees with the given labels
	Set() certificates_mesh_gloo_solo_io_v1_sets.IssuedCertificateSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledIssuedCertificateSet represents a set of issuedCertificates which share a common set of labels. These labels are used to find diffs between IssuedCertificateSets.

type LabeledPodBounceDirectiveSet

type LabeledPodBounceDirectiveSet interface {
	// returns the set of Labels shared by this PodBounceDirectiveSet
	Labels() map[string]string

	// returns the set of PodBounceDirectivees with the given labels
	Set() certificates_mesh_gloo_solo_io_v1_sets.PodBounceDirectiveSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledPodBounceDirectiveSet represents a set of podBounceDirectives which share a common set of labels. These labels are used to find diffs between PodBounceDirectiveSets.

type LabeledServiceEntrySet

type LabeledServiceEntrySet interface {
	// returns the set of Labels shared by this ServiceEntrySet
	Labels() map[string]string

	// returns the set of ServiceEntryes with the given labels
	Set() networking_istio_io_v1alpha3_sets.ServiceEntrySet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledServiceEntrySet represents a set of serviceEntries which share a common set of labels. These labels are used to find diffs between ServiceEntrySets.

type LabeledVirtualServiceSet

type LabeledVirtualServiceSet interface {
	// returns the set of Labels shared by this VirtualServiceSet
	Labels() map[string]string

	// returns the set of VirtualServicees with the given labels
	Set() networking_istio_io_v1alpha3_sets.VirtualServiceSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledVirtualServiceSet represents a set of virtualServices which share a common set of labels. These labels are used to find diffs between VirtualServiceSets.

type LabeledXdsConfigSet added in v0.10.4

type LabeledXdsConfigSet interface {
	// returns the set of Labels shared by this XdsConfigSet
	Labels() map[string]string

	// returns the set of XdsConfiges with the given labels
	Set() xds_agent_enterprise_mesh_gloo_solo_io_v1beta1_sets.XdsConfigSet

	// converts the set to a generic format which can be applied by the Snapshot.Apply functions
	Generic() output.ResourceList
}

LabeledXdsConfigSet represents a set of xdsConfigs which share a common set of labels. These labels are used to find diffs between XdsConfigSets.

type Snapshot

type Snapshot interface {

	// return the set of IssuedCertificates with a given set of labels
	IssuedCertificates() []LabeledIssuedCertificateSet
	// return the set of PodBounceDirectives with a given set of labels
	PodBounceDirectives() []LabeledPodBounceDirectiveSet
	// return the set of XdsConfigs with a given set of labels
	XdsConfigs() []LabeledXdsConfigSet
	// return the set of DestinationRules with a given set of labels
	DestinationRules() []LabeledDestinationRuleSet
	// return the set of EnvoyFilters with a given set of labels
	EnvoyFilters() []LabeledEnvoyFilterSet
	// return the set of Gateways with a given set of labels
	Gateways() []LabeledGatewaySet
	// return the set of ServiceEntries with a given set of labels
	ServiceEntries() []LabeledServiceEntrySet
	// return the set of VirtualServices with a given set of labels
	VirtualServices() []LabeledVirtualServiceSet
	// return the set of AuthorizationPolicies with a given set of labels
	AuthorizationPolicies() []LabeledAuthorizationPolicySet

	// apply the snapshot to the local cluster, garbage collecting stale resources
	ApplyLocalCluster(ctx context.Context, clusterClient client.Client, errHandler output.ErrorHandler)

	// apply resources from the snapshot across multiple clusters, garbage collecting stale resources
	ApplyMultiCluster(ctx context.Context, multiClusterClient multicluster.Client, errHandler output.ErrorHandler)

	// serialize the entire snapshot as JSON
	MarshalJSON() ([]byte, error)
}

the snapshot of output resources produced by a translation

func NewSinglePartitionedSnapshot

simplified constructor for a snapshot with a single label partition (i.e. all resources share a single set of labels).

func NewSnapshot

func NewSnapshot(
	name string,

	issuedCertificates []LabeledIssuedCertificateSet,
	podBounceDirectives []LabeledPodBounceDirectiveSet,
	xdsConfigs []LabeledXdsConfigSet,
	destinationRules []LabeledDestinationRuleSet,
	envoyFilters []LabeledEnvoyFilterSet,
	gateways []LabeledGatewaySet,
	serviceEntries []LabeledServiceEntrySet,
	virtualServices []LabeledVirtualServiceSet,
	authorizationPolicies []LabeledAuthorizationPolicySet,
	clusters ...string,
) Snapshot

Directories

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

Jump to

Keyboard shortcuts

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