foreigncluster

package
v0.3.0-rc.2 Latest Latest
Warning

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

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

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 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 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 for a fiver 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 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