hive

package
v0.0.0-...-ed9f9c9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterDeploymentName = "cluster"
)

Changing values of these constants most likely would require some sort of migration on the Hive cluster for existing clusters.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterManager

type ClusterManager interface {
	CreateNamespace(ctx context.Context, docID string) (*corev1.Namespace, error)

	// CreateOrUpdate reconciles the ClusterDocument and related secrets for an
	// existing cluster. This may adopt the cluster (Create) or amend the
	// existing resources (Update).
	CreateOrUpdate(ctx context.Context, sub *api.SubscriptionDocument, doc *api.OpenShiftClusterDocument) error
	// Delete removes the cluster from Hive.
	Delete(ctx context.Context, doc *api.OpenShiftClusterDocument) error
	// Install creates a ClusterDocument and related secrets for a new cluster
	// so that it can be provisioned by Hive.
	Install(ctx context.Context, sub *api.SubscriptionDocument, doc *api.OpenShiftClusterDocument, version *api.OpenShiftVersion, customManifests map[string]kruntime.Object) error
	IsClusterDeploymentReady(ctx context.Context, doc *api.OpenShiftClusterDocument) (bool, error)
	IsClusterInstallationComplete(ctx context.Context, doc *api.OpenShiftClusterDocument) (bool, error)
	GetClusterDeployment(ctx context.Context, doc *api.OpenShiftClusterDocument) (*hivev1.ClusterDeployment, error)
	ResetCorrelationData(ctx context.Context, doc *api.OpenShiftClusterDocument) error
}

func NewFromConfig

func NewFromConfig(log *logrus.Entry, _env env.Core, restConfig *rest.Config) (ClusterManager, error)

NewFromConfig creates a ClusterManager. It MUST NOT take cluster or subscription document as values in these structs can be change during the lifetime of the cluster manager.

func NewFromEnv

func NewFromEnv(ctx context.Context, log *logrus.Entry, env env.Interface) (ClusterManager, error)

NewFromEnv can return a nil ClusterManager when hive features are disabled. This exists to support regions where we don't have hive, and we do not want to restrict the frontend from starting up successfully. It has the caveat of requiring a nil check on any operations performed with the returned ClusterManager until this conditional return is removed (we have hive everywhere).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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