Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKey ¶
func GetKey(clusterNamespace, clusterName, applicant, featureID string, clusterType sveltosv1.ClusterType, cleanup bool) string
GetKey returns a unique ID for a request provided: - clusterNamespace and clusterName which are the namespace/name of the cluster where feature needs to be deployed; - featureID is a unique identifier for the feature that needs to be deployed.
Types ¶
type DeployerInterface ¶
type DeployerInterface interface { // RegisterFeatureID allows registering a feature ID. // If a featureID is already registered, it returns an error. RegisterFeatureID( featureID string, ) error // Deploy creates a request to deploy/cleanup a feature in a given // CAPI cluster (identified by clusterNamespace, clusterName). // cleanup indicates whether request is for feature to be provisioned // or removed. // When worker is available to fulfill such request, RequestHandler // will be invoked in the worker context. // If featureID is not registered, an error will be returned. // Applicant is an identifier of whatever is making this request. // It can be left empty (in case there is no need to differentiate between // different applicants). Deploy( ctx context.Context, clusterNamespace, clusterName, applicant, featureID string, clusterType sveltosv1.ClusterType, cleanup bool, f RequestHandler, m MetricHandler, o Options, ) error // IsInProgress returns true, if featureID for clusterNamespace/clusterName // requested by applicant is currently in progress. // cleanup indicates whether request for feature to be provisioned or // removed is currently in progress. IsInProgress( clusterNamespace, clusterName, applicant, featureID string, clusterType sveltosv1.ClusterType, cleanup bool, ) bool // GetResult returns result for a given request. GetResult( ctx context.Context, clusterNamespace, clusterName, applicant, featureID string, clusterType sveltosv1.ClusterType, cleanup bool, ) Result // CleanupEntries removes any entry (from any internal data structure) for // given feature CleanupEntries(clusterNamespace, clusterName, applicant, featureID string, clusterType sveltosv1.ClusterType, cleanup bool) }
type MetricHandler ¶
type RequestHandler ¶
type Result ¶
type Result struct { ResultStatus Err error }
type ResultStatus ¶
type ResultStatus int64
const ( Deployed ResultStatus = iota InProgress Failed Removed )
func (ResultStatus) String ¶
func (r ResultStatus) String() string
Click to show internal directories.
Click to hide internal directories.