Documentation ¶
Overview ¶
Package foreigncluster contains shared utility methods to handle the ForeignCluster resources.
Index ¶
- func AllowIncomingPeering(foreignCluster *discoveryv1alpha1.ForeignCluster, ...) bool
- func GetDiscoveryType(foreignCluster *discoveryv1alpha1.ForeignCluster) discovery.Type
- func GetForeignClusterByID(ctx context.Context, cl client.Client, clusterID string) (*discoveryv1alpha1.ForeignCluster, error)
- func GetLocalTenantNamespaceName(ctx context.Context, cl client.Client, remoteClusterID string) (string, error)
- func GetOlderForeignCluster(foreignClusterList *discoveryv1alpha1.ForeignClusterList) (foreignCluster *discoveryv1alpha1.ForeignCluster)
- func GetPeeringPhase(fc *discoveryv1alpha1.ForeignCluster) consts.PeeringPhase
- func GetRemoteTenantNamespaceName(ctx context.Context, cl client.Client, remoteClusterID string) (string, error)
- func HasHigherPriority(fc *discoveryv1alpha1.ForeignCluster, discoveryType discovery.Type) bool
- func HasToBeRemoved(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func InsecureSkipTLSVerify(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func IsExpired(fc *discoveryv1alpha1.ForeignCluster) bool
- func IsIncomingEnabled(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func IsIncomingJoined(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func IsOutgoingEnabled(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func IsOutgoingJoined(foreignCluster *discoveryv1alpha1.ForeignCluster) bool
- func IsReplicationEnabled(peeringPhase consts.PeeringPhase, resource *configv1alpha1.Resource) bool
- func LastUpdateNow(fc *discoveryv1alpha1.ForeignCluster)
- func SetDiscoveryType(foreignCluster *discoveryv1alpha1.ForeignCluster, discoveryType discovery.Type)
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 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 ¶
func GetPeeringPhase(fc *discoveryv1alpha1.ForeignCluster) consts.PeeringPhase
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.