foreigncluster

package
v0.3.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Overview

Package foreigncluster contains shared utility methods to handle the ForeignCluster resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowIncomingPeering

func AllowIncomingPeering(foreignCluster *discoveryv1alpha1.ForeignCluster,
	clusterConfig *configv1alpha1.ClusterConfig) bool

AllowIncomingPeering returns the value set in the ForeignCluster spec if it has been set, it returns the value set in the ClusterConfig if it is automatic.

func GetDiscoveryType

func GetDiscoveryType(foreignCluster *discoveryv1alpha1.ForeignCluster) discovery.Type

GetDiscoveryType returns the discovery type for the given ForeignCluster.

func GetForeignClusterByID

func GetForeignClusterByID(ctx context.Context, cl client.Client, clusterID string) (*discoveryv1alpha1.ForeignCluster, error)

GetForeignClusterByID returns a ForeignCluster CR retrieving it by its clusterID.

func GetHomeAuthURL

func GetHomeAuthURL(ctx context.Context, namespacedClient, clusterWideClient client.Client, authServiceAddress,
	authServicePort, liqoNamespace string) (string, error)

GetHomeAuthURL retrieves the auth service endpoint by inspecting the cluster. It returns an empty string and an error if it does not succeed.

func GetLocalTenantNamespaceName

func GetLocalTenantNamespaceName(ctx context.Context, cl client.Client, remoteClusterID string) (string, error)

GetLocalTenantNamespaceName gets the name of the local tenant namespace associated with a specific peering (remoteClusterID).

func GetOlderForeignCluster

func GetOlderForeignCluster(
	foreignClusterList *discoveryv1alpha1.ForeignClusterList) (foreignCluster *discoveryv1alpha1.ForeignCluster)

GetOlderForeignCluster returns the ForeignCluster from the list with the older creationTimestamp.

func GetPeeringPhase

GetPeeringPhase returns the peering phase of a given ForignCluster CR.

func GetRemoteTenantNamespaceName

func GetRemoteTenantNamespaceName(ctx context.Context, cl client.Client, remoteClusterID string) (string, error)

GetRemoteTenantNamespaceName gets the name of the remote tenant namespace associated with a specific peering (remoteClusterID).

func HasHigherPriority

func HasHigherPriority(fc *discoveryv1alpha1.ForeignCluster, discoveryType discovery.Type) bool

HasHigherPriority upgrades the discovery type. If we discovered a cluster with IncomingPeering, we can upgrade this discovery when we found it also in other way, for example inserting a SearchDomain or adding it manually.

func HasToBeRemoved

func HasToBeRemoved(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

HasToBeRemoved indicates if a ForeignCluster CR has to be removed.

func InsecureSkipTLSVerify

func InsecureSkipTLSVerify(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

InsecureSkipTLSVerify returns true if the ForeignCluster has to be contacted without the TLS verification.

func IsAuthenticated

func IsAuthenticated(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsAuthenticated checks if the identity has been accepted by the remote cluster.

func IsExpired

func IsExpired(fc *discoveryv1alpha1.ForeignCluster) bool

IsExpired checks if this foreign cluster has been updated before the end of its TimeToLive.

func IsIncomingEnabled

func IsIncomingEnabled(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsIncomingEnabled checks if the incoming peering is enabled (i.e. Pending, Established or Deleting).

func IsIncomingJoined

func IsIncomingJoined(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsIncomingJoined checks if the incoming peering has been completely established.

func IsOutgoingEnabled

func IsOutgoingEnabled(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsOutgoingEnabled checks if the outgoing peering is enabled (i.e. Pending, Established or Deleting).

func IsOutgoingJoined

func IsOutgoingJoined(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsOutgoingJoined checks if the outgoing peering has been completely established.

func IsReplicationEnabled

func IsReplicationEnabled(peeringPhase consts.PeeringPhase, resource *configv1alpha1.Resource) bool

IsReplicationEnabled indicates if the replication has to be enabled for a given peeringPhase and a given CRD.

func LastUpdateNow

func LastUpdateNow(fc *discoveryv1alpha1.ForeignCluster)

LastUpdateNow sets lastUpdate annotation to current time.

func SetDiscoveryType

func SetDiscoveryType(foreignCluster *discoveryv1alpha1.ForeignCluster, discoveryType discovery.Type)

SetDiscoveryType sets the discovery type to the given ForeignCluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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