Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfNewContextDeletion(doList *lsv1alpha1.DataObjectList, targetList *lsv1alpha1.TargetList) bool
- func ClientsFromManagers(lsMgr, hostMgr manager.Manager) (...)
- func ConvertCommonControllerConfigToControllerOptions(cfg config.CommonControllerConfig) controller.Options
- func CopyFS(src, dst vfs.FileSystem, srcPath, dstPath string) error
- func EmptyDeployItemMetadata() *metav1.PartialObjectMetadata
- func EmptyExecutionMetadata() *metav1.PartialObjectMetadata
- func EmptyInstallationMetadata() *metav1.PartialObjectMetadata
- func EmptyPodMetadata() *metav1.PartialObjectMetadata
- func EmptyPodMetadataList() *metav1.PartialObjectMetadataList
- func GetCurrentPodName() string
- func GetCurrentPodNamespace() string
- func GetHostClientRequestRestrictions(log logging.Logger, hostAndResourceClusterDifferent bool) (int, int)
- func GetResourceClientRequestRestrictions(log logging.Logger) (int, int)
- func GetSizeOfDirectory(filesystem vfs.FileSystem, root string) (int64, error)
- func HandlePanics(ctx context.Context, result *reconcile.Result, ...)
- func InitErrors(deployItemStatus *lsv1alpha1.DeployItemStatus)
- func IsDeployItemJobIDsIdentical(di *lsv1alpha1.DeployItem) bool
- func IsDeployItemPhase(di *lsv1alpha1.DeployItem, phase lsv1alpha1.DeployItemPhase) bool
- func IsExecutionJobIDsIdentical(exec *lsv1alpha1.Execution) bool
- func IsInstallationJobIDsIdentical(inst *lsv1alpha1.Installation) bool
- func IsInstallationPhase(inst *lsv1alpha1.Installation, phase lsv1alpha1.InstallationPhase) bool
- func IsRecoverableError(err error) bool
- func JSONSerializeToGenericObject(in interface{}) (interface{}, error)
- func MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func NewContextAwareWriter(ctx context.Context, writer io.Writer) io.Writer
- func NewForConfig(burst, qps int, config *rest.Config) (*kubernetes.Clientset, error)
- func NewTransitionTimes() *lsv1alpha1.TransitionTimes
- func NewUncached(burst, qps int, config *rest.Config, options client.Options) (client.Client, error)
- func NewUncachedClient(burst, qps int) func(config *rest.Config, options client.Options) (client.Client, error)
- func NewUncachedClientFromManager(mgr manager.Manager) (client.Client, error)
- func RestConfigWithModifiedClientRequestRestrictions(log logging.Logger, restConfig *rest.Config, burst, qps int) *rest.Config
- func SetExclusiveOwnerReference(owner client.Object, obj client.Object) (error, error)
- func SetFinishedTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
- func SetInitTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
- func SetLastError(deployItemStatus *lsv1alpha1.DeployItemStatus, err *lsv1alpha1.Error)
- func SetWaitTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
- func StringIsOneOf(in string, s ...string) bool
- func YAMLReadFromFile(fs vfs.FileSystem, path string, obj interface{}) error
- type ContextAwareWriter
- type CriticalProblemsHandler
- type DeployItemBuilder
- func (b *DeployItemBuilder) AddAnnotation(key, val string) *DeployItemBuilder
- func (b *DeployItemBuilder) Build() (*lsv1alpha1.DeployItem, error)
- func (b *DeployItemBuilder) DeepCopy() *DeployItemBuilder
- func (b *DeployItemBuilder) GenerateJobID() *DeployItemBuilder
- func (b *DeployItemBuilder) Key(namespace, name string) *DeployItemBuilder
- func (b *DeployItemBuilder) ProviderConfig(obj runtime.Object) *DeployItemBuilder
- func (b *DeployItemBuilder) Scheme(scheme *runtime.Scheme) *DeployItemBuilder
- func (b *DeployItemBuilder) Target(namespace, name string) *DeployItemBuilder
- func (b *DeployItemBuilder) TargetFromObjectKey(tgt client.ObjectKey) *DeployItemBuilder
- func (b *DeployItemBuilder) TargetFromObjectRef(tgt *lsv1alpha1.ObjectReference) *DeployItemBuilder
- func (b *DeployItemBuilder) Validate() error
- func (b *DeployItemBuilder) WithContext(name string) *DeployItemBuilder
- func (b *DeployItemBuilder) WithTimeout(timeout time.Duration) *DeployItemBuilder
- type FinishedObjectCache
- type LogHelper
- func (LogHelper) LogErrorAndGetReconcileResult(ctx context.Context, lsError lserrors.LsError) (reconcile.Result, error)
- func (LogHelper) LogErrorButNotFoundAsInfo(ctx context.Context, err error, message string)
- func (LogHelper) LogStandardErrorAndGetReconcileResult(ctx context.Context, err error) (reconcile.Result, error)
- type PerformanceMeasurement
- type TargetBuilder
- func (b *TargetBuilder) AddAnnotation(key, val string) *TargetBuilder
- func (b *TargetBuilder) Build() (*lsv1alpha1.Target, error)
- func (b *TargetBuilder) Config(obj interface{}) *TargetBuilder
- func (b *TargetBuilder) Key(namespace, name string) *TargetBuilder
- func (b *TargetBuilder) SecretRef(secretRef *lsv1alpha1.LocalSecretReference) *TargetBuilder
- type WorkerCounter
Constants ¶
const ( NoPodname = "nopodname" NoPodnamespace = "nopodnamespace" LsHostClientBurstVar = "LS_HOST_CLIENT_BURST" LsHostClientQpsVar = "LS_HOST_CLIENT_QPS" LsResourceClientBurstVar = "LS_RESOURCE_CLIENT_BURST" LsResourceClientQpsVar = "LS_RESOURCE_CLIENT_QPS" LsHostClientBurstDefault = 30 LsHostClientQpsDefault = 20 LsResourceClientBurstDefault = 60 LsResourceClientQpsDefault = 40 )
const ( Version = "v1alpha1" DeployItemKind = "DeployItem" ExecutionKind = "Execution" InstallationKind = "Installation" )
Variables ¶
var DeployItemGVK = schema.GroupVersionKind{ Group: core.GroupName, Version: Version, Kind: DeployItemKind, }
var ExecutionGVK = schema.GroupVersionKind{ Group: core.GroupName, Version: Version, Kind: ExecutionKind, }
var InstallationGVK = schema.GroupVersionKind{ Group: core.GroupName, Version: Version, Kind: InstallationKind, }
Functions ¶
func CheckIfNewContextDeletion ¶
func CheckIfNewContextDeletion(doList *lsv1alpha1.DataObjectList, targetList *lsv1alpha1.TargetList) bool
added 29th Jan 2024
func ClientsFromManagers ¶
func ConvertCommonControllerConfigToControllerOptions ¶
func ConvertCommonControllerConfigToControllerOptions(cfg config.CommonControllerConfig) controller.Options
ConvertCommonControllerConfigToControllerOptions converts the landscaper CommonControllerConfig to controller.Options.
func CopyFS ¶
func CopyFS(src, dst vfs.FileSystem, srcPath, dstPath string) error
CopyFS copies all files and directories of a filesystem to another.
func EmptyDeployItemMetadata ¶
func EmptyDeployItemMetadata() *metav1.PartialObjectMetadata
func EmptyExecutionMetadata ¶
func EmptyExecutionMetadata() *metav1.PartialObjectMetadata
func EmptyInstallationMetadata ¶
func EmptyInstallationMetadata() *metav1.PartialObjectMetadata
func EmptyPodMetadata ¶
func EmptyPodMetadata() *metav1.PartialObjectMetadata
func EmptyPodMetadataList ¶
func EmptyPodMetadataList() *metav1.PartialObjectMetadataList
func GetCurrentPodName ¶
func GetCurrentPodName() string
func GetCurrentPodNamespace ¶
func GetCurrentPodNamespace() string
func GetSizeOfDirectory ¶
func GetSizeOfDirectory(filesystem vfs.FileSystem, root string) (int64, error)
GetSizeOfDirectory returns the size of all files in a root directory.
func HandlePanics ¶
func InitErrors ¶
func InitErrors(deployItemStatus *lsv1alpha1.DeployItemStatus)
func IsDeployItemJobIDsIdentical ¶
func IsDeployItemJobIDsIdentical(di *lsv1alpha1.DeployItem) bool
func IsDeployItemPhase ¶
func IsDeployItemPhase(di *lsv1alpha1.DeployItem, phase lsv1alpha1.DeployItemPhase) bool
func IsExecutionJobIDsIdentical ¶
func IsExecutionJobIDsIdentical(exec *lsv1alpha1.Execution) bool
func IsInstallationJobIDsIdentical ¶
func IsInstallationJobIDsIdentical(inst *lsv1alpha1.Installation) bool
func IsInstallationPhase ¶
func IsInstallationPhase(inst *lsv1alpha1.Installation, phase lsv1alpha1.InstallationPhase) bool
func IsRecoverableError ¶
func JSONSerializeToGenericObject ¶
func JSONSerializeToGenericObject(in interface{}) (interface{}, error)
JSONSerializeToGenericObject converts a typed struct to an generic interface using json serialization.
func MergeMaps ¶
MergeMaps takes two maps <a>, <b> and merges them. If <b> defines a value with a key already existing in the <a> map, the <a> value for that key will be overwritten.
func NewContextAwareWriter ¶
NewContextAwareWriter creates a new context aware writer.
func NewForConfig ¶
func NewTransitionTimes ¶
func NewTransitionTimes() *lsv1alpha1.TransitionTimes
NewTransitionTimes creates a TransitionTimes structure. The status of Installations, Executions, and DeployItems contain such a structure with important timestamps. The timestamps are intended to help in the analysis of errors.
- The TriggerTime is set when the object is triggered, i.e. when it gets a new jobID.
- The InitTime is set when the responsible controller observes that an object has a new jobID, starts processing it, and sets its phase to Init.
- The WaitTime is set when the controller has triggered its subobjects (resp. has done its deployment) and starts waiting for its subobjects (resp. for the readiness check).
- The FinishedTime is set when an object gets into a final phase (Succeeded, Failed, DeleteFailed) and the jobIDFinished is set.
func NewUncached ¶
func NewUncachedClient ¶
func SetExclusiveOwnerReference ¶
SetExclusiveOwnerReference is a wrapper around controllerutil.SetOwnerReference The first return value will contain an error if the object contains already an owner reference of the same kind but pointing to a different owner. The second return value is meant for unexpected errors during the process.
func SetFinishedTransitionTime ¶
func SetFinishedTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
func SetInitTransitionTime ¶
func SetInitTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
func SetLastError ¶
func SetLastError(deployItemStatus *lsv1alpha1.DeployItemStatus, err *lsv1alpha1.Error)
func SetWaitTransitionTime ¶
func SetWaitTransitionTime(transitionTimes *lsv1alpha1.TransitionTimes) *lsv1alpha1.TransitionTimes
func StringIsOneOf ¶
StringIsOneOf checks whether in is one of s.
func YAMLReadFromFile ¶
func YAMLReadFromFile(fs vfs.FileSystem, path string, obj interface{}) error
YAMLReadFromFile reads a file from a filesystem and decodes it into the given obj using YAMl/JSON decoder.
Types ¶
type ContextAwareWriter ¶
type ContextAwareWriter struct {
// contains filtered or unexported fields
}
ContextAwareWriter wraps a context and an io writer. When the context is cancelled, the write function will return early before calling write on the io writer.
type CriticalProblemsHandler ¶
type CriticalProblemsHandler interface { ReportProblem(ctx context.Context, hostUncachedClient client.Client, description string) GetCriticalProblems(ctx context.Context, hostUncachedClient client.Client) (*v1alpha1.CriticalProblems, error) AccessAllowed(ctx context.Context, hostUncachedClient client.Client) error }
func GetCriticalProblemsHandler ¶
func GetCriticalProblemsHandler() CriticalProblemsHandler
type DeployItemBuilder ¶
type DeployItemBuilder struct { ObjectKey *lsv1alpha1.ObjectReference Type string ProviderConfiguration runtime.Object Context string // contains filtered or unexported fields }
DeployItemBuilder is a helper struct to build deploy items
func NewDeployItemBuilder ¶
func NewDeployItemBuilder(tType string) *DeployItemBuilder
NewDeployItemBuilder creates a new deploy item builder
func (*DeployItemBuilder) AddAnnotation ¶
func (b *DeployItemBuilder) AddAnnotation(key, val string) *DeployItemBuilder
AddAnnotation sets a annotation for the deployitem
func (*DeployItemBuilder) Build ¶
func (b *DeployItemBuilder) Build() (*lsv1alpha1.DeployItem, error)
Build creates the deploy items using the given options.
func (*DeployItemBuilder) DeepCopy ¶
func (b *DeployItemBuilder) DeepCopy() *DeployItemBuilder
DeepCopy creates a deep copy of the builder and its options. Note that the scheme is not deep copied.
func (*DeployItemBuilder) GenerateJobID ¶
func (b *DeployItemBuilder) GenerateJobID() *DeployItemBuilder
func (*DeployItemBuilder) Key ¶
func (b *DeployItemBuilder) Key(namespace, name string) *DeployItemBuilder
Key sets the deployitem's namespace and name.
func (*DeployItemBuilder) ProviderConfig ¶
func (b *DeployItemBuilder) ProviderConfig(obj runtime.Object) *DeployItemBuilder
ProviderConfig sets the deployitem provider configuration.
func (*DeployItemBuilder) Scheme ¶
func (b *DeployItemBuilder) Scheme(scheme *runtime.Scheme) *DeployItemBuilder
Scheme sets the deployitem scheme that is used for the provider config
func (*DeployItemBuilder) Target ¶
func (b *DeployItemBuilder) Target(namespace, name string) *DeployItemBuilder
Target sets the deployitem's target from a name and namespace
func (*DeployItemBuilder) TargetFromObjectKey ¶
func (b *DeployItemBuilder) TargetFromObjectKey(tgt client.ObjectKey) *DeployItemBuilder
TargetFromObjectKey sets the deployitem's target from a client key.
func (*DeployItemBuilder) TargetFromObjectRef ¶
func (b *DeployItemBuilder) TargetFromObjectRef(tgt *lsv1alpha1.ObjectReference) *DeployItemBuilder
TargetFromObjectRef sets the deployitem's target.
func (*DeployItemBuilder) Validate ¶
func (b *DeployItemBuilder) Validate() error
func (*DeployItemBuilder) WithContext ¶
func (b *DeployItemBuilder) WithContext(name string) *DeployItemBuilder
WithContext sets the Landscaper Context to use for the deployitem. If not set explicitly, the default context will be used.
func (*DeployItemBuilder) WithTimeout ¶
func (b *DeployItemBuilder) WithTimeout(timeout time.Duration) *DeployItemBuilder
type FinishedObjectCache ¶
type FinishedObjectCache struct {
// contains filtered or unexported fields
}
func NewFinishedObjectCache ¶
func NewFinishedObjectCache() *FinishedObjectCache
func (*FinishedObjectCache) Add ¶
func (c *FinishedObjectCache) Add(m *metav1.ObjectMeta)
func (*FinishedObjectCache) AddSynchonized ¶
func (c *FinishedObjectCache) AddSynchonized(m *metav1.ObjectMeta)
func (*FinishedObjectCache) IsContained ¶
func (c *FinishedObjectCache) IsContained(req reconcile.Request) bool
func (*FinishedObjectCache) IsFinishedOrRemove ¶
func (c *FinishedObjectCache) IsFinishedOrRemove(m *metav1.PartialObjectMetadata) bool
type LogHelper ¶
type LogHelper struct { }
func (LogHelper) LogErrorAndGetReconcileResult ¶
func (LogHelper) LogErrorButNotFoundAsInfo ¶
type PerformanceMeasurement ¶
type PerformanceMeasurement struct {
// contains filtered or unexported fields
}
func StartPerformanceMeasurement ¶
func StartPerformanceMeasurement(log *logging.Logger, description string) *PerformanceMeasurement
func (*PerformanceMeasurement) Stop ¶
func (p *PerformanceMeasurement) Stop()
type TargetBuilder ¶
type TargetBuilder struct { Type string ObjectKey *lsv1alpha1.ObjectReference Configuration interface{} Ref *lsv1alpha1.LocalSecretReference // contains filtered or unexported fields }
TargetBuilder is a helper struct to build targets
func NewTargetBuilder ¶
func NewTargetBuilder(tType string) *TargetBuilder
NewTargetBuilder creates a new target builder
func (*TargetBuilder) AddAnnotation ¶
func (b *TargetBuilder) AddAnnotation(key, val string) *TargetBuilder
AddAnnotation sets a annotation for the deployitem
func (*TargetBuilder) Build ¶
func (b *TargetBuilder) Build() (*lsv1alpha1.Target, error)
Build creates the target using the given options.
func (*TargetBuilder) Config ¶
func (b *TargetBuilder) Config(obj interface{}) *TargetBuilder
Config sets the target config that is used for the provider config
func (*TargetBuilder) Key ¶
func (b *TargetBuilder) Key(namespace, name string) *TargetBuilder
Key sets the deployitem's namespace and name.
func (*TargetBuilder) SecretRef ¶
func (b *TargetBuilder) SecretRef(secretRef *lsv1alpha1.LocalSecretReference) *TargetBuilder
type WorkerCounter ¶
type WorkerCounter struct {
// contains filtered or unexported fields
}
func NewWorkerCounter ¶
func NewWorkerCounter(maxNumOfWorker int) *WorkerCounter
func (*WorkerCounter) Enter ¶
func (r *WorkerCounter) Enter() int
func (*WorkerCounter) EnterWithLog ¶
func (*WorkerCounter) Exit ¶
func (r *WorkerCounter) Exit() int