Documentation ¶
Index ¶
- Constants
- func AcceptAllFilter(obj *BasicKubernetesObject) bool
- func ComputeReadinessForResourceReadyRequirements(resourceReadyRequirements []hubv1.Resource, resultReadiness string, ...) string
- func ContextWithEventWriter(ctx context.Context, eventWriter *EventWriter) context.Context
- func DoesTargetClusterExist(ctx context.Context, crAndSecretClient client.Client, ...) (bool, error)
- func GetTargetClient(ctx context.Context, crAndSecretClient client.Client, ...) (client.Client, error)
- func GetTargetConfig(ctx context.Context, crAndSecretClient client.Client, ...) ([]byte, error)
- func GetTargetSecret(ctx context.Context, crAndSecretClient client.Client, ...) (*corev1.Secret, error)
- func LogApplicationFailure(ctx context.Context, reason, message string)
- func LogHubFailure(ctx context.Context, reason, message string, err error)
- func LogSuccess(ctx context.Context, reason, message string)
- func MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func ReadinessFilter(obj *BasicKubernetesObject) bool
- func WorseState(state1, state2 string) string
- type BasicKubernetesObject
- type ClusterUnreachableError
- type DeployData
- func (d *DeployData) ComputeReadiness(ctx context.Context, basicKubernetesObjects []BasicKubernetesObject, ...) string
- func (d *DeployData) GetConfigID() string
- func (d *DeployData) GetDeployItem() *v1alpha1.DeployItem
- func (d *DeployData) GetDeployItemCondition(conditionType hubv1.HubDeploymentConditionType) *v1alpha1.Condition
- func (d *DeployData) GetDeployItemKey() *types.NamespacedName
- func (d *DeployData) GetExportReference() *v1alpha1.ObjectReference
- func (d *DeployData) GetGeneration() int64
- func (d *DeployData) GetNamespace() string
- func (d *DeployData) GetObservedGeneration() int64
- func (d *DeployData) GetSecretKey() *types.NamespacedName
- func (d *DeployData) GetStatus() (*v1alpha1.DeployItemStatus, error)
- func (d *DeployData) IsConditionTrue(conditionType hubv1.HubDeploymentConditionType) bool
- func (d *DeployData) IsDeleteOperation() bool
- func (d *DeployData) IsFinallyFailed() bool
- func (d *DeployData) IsInstallButNotReady() bool
- func (d *DeployData) IsInstallOperation() bool
- func (d *DeployData) IsLastDeployFailed() bool
- func (d *DeployData) IsNewOperation() bool
- func (d *DeployData) IsReconcile() bool
- func (d *DeployData) MarshalProviderStatus() error
- func (d *DeployData) ReplaceDeployItemCondition(conditionType hubv1.HubDeploymentConditionType, status v1.ConditionStatus, ...)
- func (d *DeployData) SetExportSecretName(secretName string)
- func (d *DeployData) SetPhase(phase v1alpha1.ExecutionPhase)
- func (d *DeployData) SetStatus(lastState, description string, numberOfTries int32, currentTime metav1.Time)
- func (d *DeployData) SetStatusForReachableCluster()
- func (d *DeployData) SetStatusForUnreachableCluster()
- func (d *DeployData) WorsifyDeployItemCondition(conditionType hubv1.HubDeploymentConditionType, status v1.ConditionStatus, ...)
- type DeployItemDeployer
- type DynamicTargetClient
- type EventWriter
- type EventWriterKey
- type SecretHandler
Constants ¶
View Source
const ( ReasonSuccessDeployment = "SuccessDeployment" ReasonFailedFetchingObject = "FailedFetchingObject" ReasonFailedClusterUnreachable = "FailedClusterUnreachable" ReasonFailedDeployment = "FailedDeployment" ReasonFailedJob = "FailedJob" ReasonFailedWriteState = "FailedWriteState" )
Variables ¶
This section is empty.
Functions ¶
func AcceptAllFilter ¶
func AcceptAllFilter(obj *BasicKubernetesObject) bool
func ContextWithEventWriter ¶
func ContextWithEventWriter(ctx context.Context, eventWriter *EventWriter) context.Context
func DoesTargetClusterExist ¶
func GetTargetClient ¶
func GetTargetConfig ¶
func GetTargetSecret ¶
func LogApplicationFailure ¶
func LogSuccess ¶
func ReadinessFilter ¶
func ReadinessFilter(obj *BasicKubernetesObject) bool
func WorseState ¶
Types ¶
type BasicKubernetesObject ¶
type BasicKubernetesObject struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` ObjectMeta types.NamespacedName `yaml:"metadata"` }
type ClusterUnreachableError ¶
type ClusterUnreachableError struct {
Err error
}
func (*ClusterUnreachableError) Error ¶
func (e *ClusterUnreachableError) Error() string
type DeployData ¶
type DeployData struct { Configuration *hubv1.HubDeployItemConfiguration ProviderStatus *hubv1.HubDeployItemProviderStatus ExportValues map[string]interface{} // contains filtered or unexported fields }
func NewDeployData ¶
func NewDeployData(deployItem *v1alpha1.DeployItem) (*DeployData, error)
func (*DeployData) ComputeReadiness ¶
func (d *DeployData) ComputeReadiness(ctx context.Context, basicKubernetesObjects []BasicKubernetesObject, targetClient client.Client, dynamicClient *DynamicTargetClient, namespace string) string
func (*DeployData) GetConfigID ¶
func (d *DeployData) GetConfigID() string
func (*DeployData) GetDeployItem ¶
func (d *DeployData) GetDeployItem() *v1alpha1.DeployItem
func (*DeployData) GetDeployItemCondition ¶
func (d *DeployData) GetDeployItemCondition(conditionType hubv1.HubDeploymentConditionType) *v1alpha1.Condition
func (*DeployData) GetDeployItemKey ¶
func (d *DeployData) GetDeployItemKey() *types.NamespacedName
func (*DeployData) GetExportReference ¶
func (d *DeployData) GetExportReference() *v1alpha1.ObjectReference
func (*DeployData) GetGeneration ¶
func (d *DeployData) GetGeneration() int64
func (*DeployData) GetNamespace ¶
func (d *DeployData) GetNamespace() string
func (*DeployData) GetObservedGeneration ¶
func (d *DeployData) GetObservedGeneration() int64
func (*DeployData) GetSecretKey ¶
func (d *DeployData) GetSecretKey() *types.NamespacedName
func (*DeployData) GetStatus ¶
func (d *DeployData) GetStatus() (*v1alpha1.DeployItemStatus, error)
func (*DeployData) IsConditionTrue ¶
func (d *DeployData) IsConditionTrue(conditionType hubv1.HubDeploymentConditionType) bool
func (*DeployData) IsDeleteOperation ¶
func (d *DeployData) IsDeleteOperation() bool
func (*DeployData) IsFinallyFailed ¶
func (d *DeployData) IsFinallyFailed() bool
func (*DeployData) IsInstallButNotReady ¶
func (d *DeployData) IsInstallButNotReady() bool
func (*DeployData) IsInstallOperation ¶
func (d *DeployData) IsInstallOperation() bool
func (*DeployData) IsLastDeployFailed ¶
func (d *DeployData) IsLastDeployFailed() bool
func (*DeployData) IsNewOperation ¶
func (d *DeployData) IsNewOperation() bool
func (*DeployData) IsReconcile ¶
func (d *DeployData) IsReconcile() bool
func (*DeployData) MarshalProviderStatus ¶
func (d *DeployData) MarshalProviderStatus() error
func (*DeployData) ReplaceDeployItemCondition ¶
func (d *DeployData) ReplaceDeployItemCondition(conditionType hubv1.HubDeploymentConditionType, status v1.ConditionStatus, now metav1.Time, reason hubv1.HubDeploymentConditionReason, message string)
func (*DeployData) SetExportSecretName ¶
func (d *DeployData) SetExportSecretName(secretName string)
func (*DeployData) SetPhase ¶
func (d *DeployData) SetPhase(phase v1alpha1.ExecutionPhase)
func (*DeployData) SetStatus ¶
func (d *DeployData) SetStatus(lastState, description string, numberOfTries int32, currentTime metav1.Time)
func (*DeployData) SetStatusForReachableCluster ¶
func (d *DeployData) SetStatusForReachableCluster()
func (*DeployData) SetStatusForUnreachableCluster ¶
func (d *DeployData) SetStatusForUnreachableCluster()
func (*DeployData) WorsifyDeployItemCondition ¶
func (d *DeployData) WorsifyDeployItemCondition(conditionType hubv1.HubDeploymentConditionType, status v1.ConditionStatus, now metav1.Time, reason hubv1.HubDeploymentConditionReason, message string)
type DeployItemDeployer ¶
type DeployItemDeployer interface { ProcessNewOperation(ctx context.Context, deployData *DeployData) RetryFailedOperation(ctx context.Context, deployData *DeployData) ReconcileOperation(ctx context.Context, deployData *DeployData) ProcessPendingOperation(ctx context.Context, deployData *DeployData) Cleanup(ctx context.Context, deployData *DeployData, clusterExists bool) error Preprocess(ctx context.Context, deployData *DeployData) }
type DynamicTargetClient ¶
type DynamicTargetClient struct {
// contains filtered or unexported fields
}
func NewDynamicTargetClient ¶
func NewDynamicTargetClient(ctx context.Context, crAndSecretClient client.Client, secretKey types.NamespacedName) (*DynamicTargetClient, error)
func (*DynamicTargetClient) GetResource ¶
func (d *DynamicTargetClient) GetResource(apiVersion, resource, namespace, name string) (*unstructured.Unstructured, error)
func (*DynamicTargetClient) GetResourceData ¶
func (d *DynamicTargetClient) GetResourceData(apiVersion, resource, namespace, name, fieldPath string) (interface{}, error)
type EventWriter ¶
type EventWriter struct {
// contains filtered or unexported fields
}
func GetEventWriterFromContext ¶
func GetEventWriterFromContext(ctx context.Context) *EventWriter
func NewEventWriter ¶
func NewEventWriter(clusterBom *hubv1.ClusterBom, eventRecorder record.EventRecorder) *EventWriter
func (*EventWriter) WriteEvent ¶
func (w *EventWriter) WriteEvent(eventtype, reason, message string)
type EventWriterKey ¶
type EventWriterKey struct{}
type SecretHandler ¶
type SecretHandler struct {
// contains filtered or unexported fields
}
func NewSecretHandler ¶
func NewSecretHandler(secretClient client.Client) *SecretHandler
func (*SecretHandler) CreateExportSecretForDi ¶
func (r *SecretHandler) CreateExportSecretForDi(ctx context.Context, deployData *DeployData, exportData []byte) (secretName string, err error)
func (*SecretHandler) RemoveUnreferencedExportSecrets ¶
func (r *SecretHandler) RemoveUnreferencedExportSecrets(ctx context.Context, deployItem *v1alpha1.DeployItem, referencedSecret *v1alpha1.ObjectReference) error
Click to show internal directories.
Click to hide internal directories.