operations

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetClusterOperation

func SetClusterOperation(o ClusterOperation)

SetClusterOperation set up a new ClusterOperation

Types

type ClusterOperation

type ClusterOperation interface {
	// GetServicePackageByName get the service package CR by its name. This method will return the ServicePackage
	// if existed.
	GetServicePackageByName(name, namespace string) (enginev1alpha1.ServicePackage, bool, error)
	// DoesCustomResourceExist will use resource's schema.GroupVersion to find the cr in this cluster
	DoesCustomResourceExist(gv schema.GroupVersion, plural, name, namespace string) (bool, error)
	// DeployCustomResource will install the custom resource into cluster
	DeployCustomResource(gvr schema.GroupVersionResource, namespace string, resource interface{}) error
	// UpdateCustomResource will update the custom resource into cluster
	UpdateCustomResource(gvr schema.GroupVersionResource, namespace string, resource interface{}) error
	// DeleteCustomResource will delete the custom resource from cluster
	DeleteCustomResource(gvr schema.GroupVersionResource, name, namespace string) error
	// IsNamespaceExist will check cluster namespace is existed, true means is exists
	IsNamespaceExist(namespace string) (bool, error)
}

ClusterOperation the interface of all cluster actions' operation

func GetClusterOperation

func GetClusterOperation() ClusterOperation

GetClusterOperation return an ClusterOperation of this interface

Jump to

Keyboard shortcuts

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