Documentation ¶
Index ¶
- func RegisterFactory(kind Kind, factory FactoryFunc)
- type Cluster
- type Clusters
- func (c Clusters) ByNetwork() ClustersByNetwork
- func (c Clusters) Configs(excluded ...Cluster) Clusters
- func (c Clusters) Default() Cluster
- func (c Clusters) Exclude(excluded ...Cluster) Clusters
- func (c Clusters) GetByName(name string) Cluster
- func (c Clusters) GetOrDefault(cluster Cluster) Cluster
- func (c Clusters) IsMulticluster() bool
- func (c Clusters) Kube() Clusters
- func (c Clusters) Len() int
- func (c Clusters) MeshClusters(excluded ...Cluster) Clusters
- func (c Clusters) Names() []string
- func (c Clusters) Networks() []string
- func (c Clusters) OfKind(kind Kind) Clusters
- func (c Clusters) Primaries(excluded ...Cluster) Clusters
- func (c Clusters) Remotes(excluded ...Cluster) Clusters
- func (c Clusters) String() string
- type ClustersByNetwork
- type Config
- type Factory
- type FactoryFunc
- type FakeCluster
- type Kind
- type Map
- type Topology
- func (c Topology) Config() Cluster
- func (c Topology) ConfigName() string
- func (c Topology) HTTPProxy() string
- func (c Topology) IsConfig() bool
- func (c Topology) IsExternalControlPlane() bool
- func (c Topology) IsPrimary() bool
- func (c Topology) IsRemote() bool
- func (c Topology) Kind() Kind
- func (c Topology) MaxKubeVersion(minor uint) bool
- func (c Topology) MinKubeVersion(minor uint) bool
- func (c Topology) Name() string
- func (c Topology) NetworkName() string
- func (c Topology) Primary() Cluster
- func (c Topology) PrimaryName() string
- func (c Topology) StableName() string
- func (c Topology) String() string
- func (c Topology) WithConfig(configClusterName string) Topology
- func (c Topology) WithPrimary(primaryClusterName string) Topology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFactory ¶
func RegisterFactory(kind Kind, factory FactoryFunc)
RegisterFactory globally registers a base factory of a given Kind. The given factory should be immutable, as it will be used globally.
Types ¶
type Cluster ¶
type Cluster interface { fmt.Stringer kube.ExtendedClient // Name of this cluster. Use for interacting with the cluster or validation against clusters. // Use StableName instead of Name when creating subtests. Name() string // StableName gives a deterministic name for the cluster. Use this for test/subtest names to // allow test grid to compare runs, even when the underlying cluster names are dynamic. // Use Name for validation/interaction with the actual cluster. StableName() string // Kind of cluster Kind() Kind // NetworkName the cluster is on NetworkName() string // MinKubeVersion returns true if the cluster is at least the version specified, // false otherwise MinKubeVersion(minor uint) bool // MaxKubeVersion returns true if the cluster is at most the version specified, // false otherwise MaxKubeVersion(minor uint) bool // IsPrimary returns true if this is a primary cluster, containing an instance // of the Istio control plane. IsPrimary() bool // IsConfig returns true if this is a config cluster, used as the source of // Istio config for one or more control planes. IsConfig() bool // IsRemote returns true if this is a remote cluster, which uses a control plane // residing in another cluster. IsRemote() bool // IsExternalControlPlane returns true if this is a cluster containing an instance // of the Istio control plane but with its source of config in another cluster. IsExternalControlPlane() bool // Primary returns the primary cluster for this cluster. Will return itself if // IsPrimary. Primary() Cluster // PrimaryName returns the name of the primary cluster for this cluster. PrimaryName() string // Config returns the config cluster for this cluster. Will return itself if // IsConfig. Config() Cluster // ConfigName returns the name of the config cluster for this cluster. ConfigName() string // HTTPProxy returns the HTTP proxy config to connect to the cluster HTTPProxy() string }
Cluster in a multicluster environment.
type Clusters ¶
type Clusters []Cluster
Clusters is an ordered list of Cluster instances.
func (Clusters) ByNetwork ¶
func (c Clusters) ByNetwork() ClustersByNetwork
ByNetwork returns a map of network name to a subset of clusters
func (Clusters) GetByName ¶
GetByName returns the Cluster with the given name or nil if it is not in the list.
func (Clusters) GetOrDefault ¶
GetOrDefault returns the given cluster if non-nil. Otherwise returns the first Cluster in the list.
func (Clusters) IsMulticluster ¶
IsMulticluster is a utility method that indicates whether there are multiple Clusters available.
func (Clusters) MeshClusters ¶
MeshClusters returns the subset that are not external control plane clusters.
type ClustersByNetwork ¶
func (ClustersByNetwork) Networks ¶
func (c ClustersByNetwork) Networks() []string
type Config ¶
type Config struct { Kind Kind `yaml:"kind,omitempty"` Name string `yaml:"clusterName,omitempty"` Network string `yaml:"network,omitempty"` HTTPProxy string `yaml:"httpProxy,omitempty"` PrimaryClusterName string `yaml:"primaryClusterName,omitempty"` ConfigClusterName string `yaml:"configClusterName,omitempty"` Meta config.Map `yaml:"meta,omitempty"` }
type FactoryFunc ¶
FactoryFunc validates a config and builds a single echo instance.
func GetFactory ¶
func GetFactory(config Config) (FactoryFunc, error)
type FakeCluster ¶
type FakeCluster struct { kube.ExtendedClient Version *version.Info Topology }
FakeCluster used for testing.
func (FakeCluster) GetKubernetesVersion ¶
func (f FakeCluster) GetKubernetesVersion() (*version.Info, error)
type Map ¶
Map can be given as a shared reference to multiple Topology/Cluster implementations. allowing clusters to find each other for lookups of Primary, ConfigCluster, etc.
type Topology ¶
type Topology struct { ClusterName string ClusterKind Kind Network string ClusterHTTPProxy string PrimaryClusterName string ConfigClusterName string Index int // AllClusters should contain all AllClusters in the context AllClusters Map }
Topology gives information about the relationship between clusters. Cluster implementations can embed this struct to include common functionality.
func NewTopology ¶
func (Topology) ConfigName ¶
func (Topology) IsExternalControlPlane ¶
func (Topology) MaxKubeVersion ¶
func (Topology) MinKubeVersion ¶
func (Topology) PrimaryName ¶
func (Topology) StableName ¶
StableName provides a name used for testcase names. Deterministic, so testgrid can be consistent when the underlying cluster names are dynamic.