discovery

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthServiceName = "liqo-auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthData

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

func NewAuthData

func NewAuthData(address string, port int, ttl uint32) *AuthData

func NewAuthDataTest

func NewAuthDataTest(address string, port int) *AuthData

func (*AuthData) Decode

func (authData *AuthData) Decode(entry *zeroconf.ServiceEntry, timeout time.Duration) error

populate the AuthData struct from a DNS entry takes as argument the DNS entry and a timeout used to find reachable remote services

func (*AuthData) Get

func (authData *AuthData) Get(discovery *DiscoveryCtrl, entry *zeroconf.ServiceEntry) error

func (*AuthData) GetUrl

func (authData *AuthData) GetUrl() string

func (*AuthData) IsComplete

func (authData *AuthData) IsComplete() bool

check if both address and port are correctly set

type ConfigProvider

type ConfigProvider interface {
	GetConfig() *configv1alpha1.DiscoveryConfig
	GetApiServerConfig() *configv1alpha1.ApiServerConfig
}

type DiscoverableData

type DiscoverableData interface {
	Get(discovery *DiscoveryCtrl, entry *zeroconf.ServiceEntry) error // populate the struct from a DNS entry
	IsComplete() bool                                                 // the struct has all the required fields
}

type DiscoveryCtrl

type DiscoveryCtrl struct {
	Namespace string

	Config *configv1alpha1.DiscoveryConfig

	ClusterId clusterID.ClusterID
	// contains filtered or unexported fields
}

func GetDiscoveryCtrl

func GetDiscoveryCtrl(namespace string, crdClient *crdClient.CRDClient, advClient *crdClient.CRDClient, clusterId clusterID.ClusterID, resolveContextRefreshTime int, dialTcpTimeout time.Duration) DiscoveryCtrl

func NewDiscoveryCtrl

func NewDiscoveryCtrl(namespace string, clusterId clusterID.ClusterID, kubeconfigPath string, resolveContextRefreshTime int, dialTcpTimeout time.Duration) (*DiscoveryCtrl, error)

func (*DiscoveryCtrl) CheckUpdate

func (discovery *DiscoveryCtrl) CheckUpdate(data *discoveryData, fc *v1alpha1.ForeignCluster, discoveryType discoveryPkg.DiscoveryType, searchDomain *v1alpha1.SearchDomain) (fcUpdated *v1alpha1.ForeignCluster, updated bool, err error)

func (*DiscoveryCtrl) CollectGarbage

func (discovery *DiscoveryCtrl) CollectGarbage() error

The GarbageCollector deletes all ForeignClusters discovered with LAN and WAN that have expired TTL

func (*DiscoveryCtrl) GetApiServerConfig

func (discovery *DiscoveryCtrl) GetApiServerConfig() *configv1alpha1.ApiServerConfig

func (*DiscoveryCtrl) GetConfig

func (discovery *DiscoveryCtrl) GetConfig() *configv1alpha1.DiscoveryConfig

func (*DiscoveryCtrl) GetDiscoveryConfig

func (discovery *DiscoveryCtrl) GetDiscoveryConfig(crdClient *crdClient.CRDClient, kubeconfigPath string) error

func (*DiscoveryCtrl) GetForeignClusterByID

func (discovery *DiscoveryCtrl) GetForeignClusterByID(clusterID string) (*v1alpha1.ForeignCluster, error)

func (*DiscoveryCtrl) Register

func (discovery *DiscoveryCtrl) Register()

func (*DiscoveryCtrl) Resolve

func (discovery *DiscoveryCtrl) Resolve(ctx context.Context, service string, domain string, resultChan chan DiscoverableData)

func (*DiscoveryCtrl) StartDiscovery

func (discovery *DiscoveryCtrl) StartDiscovery()

Start register and resolver goroutines

func (*DiscoveryCtrl) StartGarbageCollector

func (discovery *DiscoveryCtrl) StartGarbageCollector()

func (*DiscoveryCtrl) StartGratuitousAnswers

func (discovery *DiscoveryCtrl) StartGratuitousAnswers()

func (*DiscoveryCtrl) StartResolver

func (discovery *DiscoveryCtrl) StartResolver(stopChan <-chan bool)

func (*DiscoveryCtrl) UpdateForeignLAN

func (discovery *DiscoveryCtrl) UpdateForeignLAN(data *discoveryData, trustMode discoveryPkg.TrustMode)

func (*DiscoveryCtrl) UpdateForeignWAN

func (discovery *DiscoveryCtrl) UpdateForeignWAN(data []*AuthData, sd *v1alpha1.SearchDomain) []*v1alpha1.ForeignCluster

update the list of known foreign clusters: for each cluster retrieved with DNS discovery, if it is not the local cluster, check if it is already known, if not create it. In both cases update the ForeignCluster TTL This function also sets an owner reference and a label to the ForeignCluster pointing to the SearchDomain CR

func (*DiscoveryCtrl) WatchTrustedCAs

func (discovery *DiscoveryCtrl) WatchTrustedCAs() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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