Documentation ¶
Index ¶
- func ConnectToRemoteCluster(cd *hivev1.ClusterDeployment, remoteClientBuilder Builder, ...) (remoteClient client.Client, unreachable, requeue bool)
- func InitialURL(c client.Client, cd *hivev1.ClusterDeployment) (string, error)
- func IsPrimaryURLActive(cd *hivev1.ClusterDeployment) bool
- func SetUnreachableCondition(cd *hivev1.ClusterDeployment, connectionError error) (changed bool)
- func Unreachable(cd *hivev1.ClusterDeployment) (unreachable bool, lastCheck time.Time)
- type Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToRemoteCluster ¶ added in v1.0.1
func ConnectToRemoteCluster( cd *hivev1.ClusterDeployment, remoteClientBuilder Builder, localClient client.Client, logger log.FieldLogger, ) (remoteClient client.Client, unreachable, requeue bool)
ConnectToRemoteCluster connects to a remote cluster using the specified builder. If the ClusterDeployment is marked as unreachable, then no connection will be made. If there are problems connecting, then the specified clusterdeployment will be marked as unreachable.
func InitialURL ¶ added in v1.0.1
InitialURL returns the initial API URL for the ClusterDeployment.
func IsPrimaryURLActive ¶ added in v1.0.1
func IsPrimaryURLActive(cd *hivev1.ClusterDeployment) bool
IsPrimaryURLActive returns true if the remote cluster is reachable via the primary API URL.
func SetUnreachableCondition ¶ added in v1.0.1
func SetUnreachableCondition(cd *hivev1.ClusterDeployment, connectionError error) (changed bool)
SetUnreachableCondition sets the Unreachable condition on the ClusterDeployment based on the specified error encountered when attempting to connect to the remote cluster.
func Unreachable ¶ added in v1.0.1
func Unreachable(cd *hivev1.ClusterDeployment) (unreachable bool, lastCheck time.Time)
Unreachable returns true if Hive has not been able to reach the remote cluster. Note that this function will not attempt to reach the remote cluster. It only checks the current conditions on the ClusterDeployment to determine if the remote cluster is reachable.
Types ¶
type Builder ¶
type Builder interface { // Build will return a static controller-runtime client for the remote cluster. Build() (client.Client, error) // BuildDynamic will return a dynamic kubeclient for the remote cluster. BuildDynamic() (dynamic.Interface, error) // BuildKubeClient will return a kubernetes client for the remote cluster. BuildKubeClient() (kubeclient.Interface, error) // RESTConfig returns the config for a REST client that connects to the remote cluster. RESTConfig() (*rest.Config, error) // UsePrimaryAPIURL will use the primary API URL. If there is an API URL override, then that is the primary. // Otherwise, the primary is the default API URL. UsePrimaryAPIURL() Builder // UseSecondaryAPIURL will use the secondary API URL. If there is an API URL override, then the initial API URL // is the secondary. UseSecondaryAPIURL() Builder }
Builder is used to build API clients to the remote cluster
func NewBuilder ¶
func NewBuilder(c client.Client, cd *hivev1.ClusterDeployment, controllerName hivev1.ControllerName) Builder
NewBuilder creates a new Builder for creating a client to connect to the remote cluster associated with the specified ClusterDeployment. The controllerName is needed for metrics. If the ClusterDeployment carries the fake cluster annotation, a fake client will be returned populated with runtime.Objects we need to query for in all our controllers.