foreigncluster

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnpeerChecker checks if the two clusters are unpeered.
	UnpeerChecker fcEventChecker = func(fc *discoveryv1alpha1.ForeignCluster) bool {
		return IsIncomingPeeringNone(fc) && IsOutgoingPeeringNone(fc)
	}
)

Functions

func AllowIncomingPeering

func AllowIncomingPeering(foreignCluster *discoveryv1alpha1.ForeignCluster, defaultEnableIncomingPeering bool) bool

AllowIncomingPeering returns the value set in the ForeignCluster spec if it has been set, it returns the value set through the command line flag 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 GetForeignClusterByIDWithDynamicClient added in v0.8.2

func GetForeignClusterByIDWithDynamicClient(ctx context.Context, dynClient dynamic.Interface, clusterID string) (
	*discoveryv1alpha1.ForeignCluster, error)

GetForeignClusterByIDWithDynamicClient returns a ForeignCluster CR retrieving it by its clusterID, using the dynamic interface.

func GetHomeAuthURL

func GetHomeAuthURL(ctx context.Context, cl client.Client, 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, remoteCluster discoveryv1alpha1.ClusterIdentity) (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 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 IsAPIServerReady added in v0.8.2

func IsAPIServerReady(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsAPIServerReady checks if the api server is ready.

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 IsIncomingPeeringNo added in v0.10.2

func IsIncomingPeeringNo(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsIncomingPeeringNo checks if the incoming peering is set to No.

func IsIncomingPeeringNone added in v0.4.0

func IsIncomingPeeringNone(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsIncomingPeeringNone checks if the incoming peering is set to none.

func IsIncomingPeeringYes added in v0.10.2

func IsIncomingPeeringYes(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsIncomingPeeringYes checks if the incoming peering is set to Yes.

func IsNetworkingEnabled added in v0.4.0

func IsNetworkingEnabled(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsNetworkingEnabled checks if the automatic creation/propagation of NetworkConfigs is enabled.

func IsNetworkingEstablished added in v0.5.0

func IsNetworkingEstablished(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsNetworkingEstablished checks if the networking has be established.

func IsNetworkingEstablishedOrExternal added in v0.8.0

func IsNetworkingEstablishedOrExternal(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsNetworkingEstablishedOrExternal checks if the networking has be established or if the external network plugin is enabled.

func IsNetworkingExternal added in v0.8.0

func IsNetworkingExternal(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsNetworkingExternal checks if the external network plugin is enabled.

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 IsOutgoingPeeringNone added in v0.4.0

func IsOutgoingPeeringNone(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsOutgoingPeeringNone checks if the outgoing peering is set to none.

func IsUnpeered added in v0.5.0

func IsUnpeered(foreignCluster *discoveryv1alpha1.ForeignCluster) bool

IsUnpeered returns whether the no peering is currently active towards the remote cluster.

func LastUpdateNow

func LastUpdateNow(fc *discoveryv1alpha1.ForeignCluster)

LastUpdateNow sets lastUpdate annotation to current time.

func PollForEvent added in v0.5.0

func PollForEvent(ctx context.Context, cl client.Client, identity *discoveryv1alpha1.ClusterIdentity,
	checker fcEventChecker, interval time.Duration) error

PollForEvent polls until the given events occurs on the foreign cluster corresponding to the identity.

func SetDiscoveryType

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

SetDiscoveryType sets the discovery type to the given ForeignCluster.

func UniqueName added in v0.4.0

func UniqueName(cluster *discoveryv1alpha1.ClusterIdentity) string

UniqueName returns a user-friendly name that is unique *in the context of the current cluster*. It depends on ClusterName, so the same cluster may have different UniqueNames in different clusters.

Use it when reflecting resources on a remote cluster (see issue #966).

Types

This section is empty.

Jump to

Keyboard shortcuts

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