foreigncluster

package
v0.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 14 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 DeleteGenericCondition

func DeleteGenericCondition(foreignCluster *liqov1alpha1.ForeignCluster, conditionType liqov1alpha1.ConditionType)

DeleteGenericCondition ensure the absence of a generic condition in the foreign cluster status.

func DeleteModuleCondition

func DeleteModuleCondition(module *liqov1alpha1.Module, conditionType liqov1alpha1.ConditionType)

DeleteModuleCondition ensure the absence of a condition of the given type in the module.

func DisableModuleAuthentication

func DisableModuleAuthentication(foreignCluster *liqov1alpha1.ForeignCluster)

DisableModuleAuthentication disables the authentication module.

func DisableModuleNetworking

func DisableModuleNetworking(foreignCluster *liqov1alpha1.ForeignCluster)

DisableModuleNetworking disables the networking module.

func DisableModuleOffloading

func DisableModuleOffloading(foreignCluster *liqov1alpha1.ForeignCluster)

DisableModuleOffloading disables the offloading module.

func EnableModuleAuthentication

func EnableModuleAuthentication(foreignCluster *liqov1alpha1.ForeignCluster)

EnableModuleAuthentication enables the authentication module.

func EnableModuleNetworking

func EnableModuleNetworking(foreignCluster *liqov1alpha1.ForeignCluster)

EnableModuleNetworking enables the networking module.

func EnableModuleOffloading

func EnableModuleOffloading(foreignCluster *liqov1alpha1.ForeignCluster)

EnableModuleOffloading enables the offloading module.

func EnsureGenericCondition

func EnsureGenericCondition(foreignCluster *liqov1alpha1.ForeignCluster,
	conditionType liqov1alpha1.ConditionType,
	status liqov1alpha1.ConditionStatusType,
	reason, message string)

EnsureGenericCondition ensures the presence of a generic condition in the foreign cluster status.

func EnsureModuleCondition

func EnsureModuleCondition(module *liqov1alpha1.Module,
	conditionType liqov1alpha1.ConditionType,
	status liqov1alpha1.ConditionStatusType,
	reason, message string)

EnsureModuleCondition ensures the presence of a condition in the module.

func GetAPIServerStatus

func GetAPIServerStatus(foreignCluster *liqov1alpha1.ForeignCluster) liqov1alpha1.ConditionStatusType

GetAPIServerStatus returns the status of the api server.

func GetForeignClusterByID

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

GetForeignClusterByID returns a ForeignCluster CR retrieving it by its clusterID.

func GetForeignClusterByIDWithDynamicClient

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

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

func GetLocalTenantNamespaceName

func GetLocalTenantNamespaceName(ctx context.Context, cl client.Client, remoteCluster liqov1alpha1.ClusterID) (string, error)

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

func GetMessage

func GetMessage(conditions []liqov1alpha1.Condition, conditionType liqov1alpha1.ConditionType) string

GetMessage returns the message for the given condition. If the condition is not set, it returns an empty string.

func GetOlderForeignCluster

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

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

func GetReason

func GetReason(conditions []liqov1alpha1.Condition, conditionType liqov1alpha1.ConditionType) string

GetReason returns the reason for the given condition. If the condition is not set, it returns an empty string.

func GetRemoteTenantNamespaceName

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

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

func GetStatus

GetStatus returns the status for the given condition. If the condition is not set, it returns the None status.

func IsAPIServerReadyOrDisabled

func IsAPIServerReadyOrDisabled(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsAPIServerReadyOrDisabled checks if the api server is ready or not applicable.

func IsAuthenticationModuleEnabled

func IsAuthenticationModuleEnabled(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsAuthenticationModuleEnabled checks if the authentication module is enabled.

func IsConsumer

func IsConsumer(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsConsumer checks if a foreign cluster is a consumer.

func IsConsumerAndProvider

func IsConsumerAndProvider(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsConsumerAndProvider checks if a foreign cluster is both a consumer and a provider.

func IsNetworkingEstablished

func IsNetworkingEstablished(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsNetworkingEstablished checks if the networking is established.

func IsNetworkingEstablishedOrDisabled

func IsNetworkingEstablishedOrDisabled(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsNetworkingEstablishedOrDisabled checks if the networking is established or if the liqo networking module is disabled.

func IsNetworkingModuleEnabled

func IsNetworkingModuleEnabled(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsNetworkingModuleEnabled checks if the networking module is enabled.

func IsOffloadingModuleEnabled

func IsOffloadingModuleEnabled(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsOffloadingModuleEnabled checks if the offloading module is enabled.

func IsProvider

func IsProvider(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsProvider checks if a foreign cluster is a provider.

func IsUnknown

func IsUnknown(foreignCluster *liqov1alpha1.ForeignCluster) bool

IsUnknown checks if a foreign cluster has an unknown role.

func PollForEvent

func PollForEvent(ctx context.Context, cl client.Client, id liqov1alpha1.ClusterID,
	checker fcEventChecker, interval time.Duration) error

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

func SetRole

func SetRole(foreignCluster *liqov1alpha1.ForeignCluster, consumer, provider bool)

SetRole sets the role of a foreign cluster.

func UniqueName

func UniqueName(cluster liqov1alpha1.ClusterID) string

UniqueName returns a unique name for the given cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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