builder

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultManifestLimit = 50 * 1024

DefaultManifestLimit is the max size of manifests data which is 50k bytes by default.

View Source
const DefaultManifestThreshold = 0.8

DefaultManifestThreshold is the threshold size of manifests for the first new created manifestWork.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateManifestWorkObjectMeta

type GenerateManifestWorkObjectMeta func(index int) metav1.ObjectMeta

GenerateManifestWorkObjectMeta is to generate a new manifestWork meta, need to make sure the name is unique.

type WorkBuilder

type WorkBuilder struct {
	// contains filtered or unexported fields
}

func NewWorkBuilder

func NewWorkBuilder() *WorkBuilder

func (*WorkBuilder) Build

func (w *WorkBuilder) Build(objects []runtime.Object,
	generateManifestWorkObjectMeta GenerateManifestWorkObjectMeta,
	options ...WorkBuilderOption) (applied, deleted []*workapiv1.ManifestWork, err error)

Build is to build a set of applied/deleted manifestWorks with the objects and options.

func (*WorkBuilder) BuildAndApply

func (w *WorkBuilder) BuildAndApply(ctx context.Context,
	objects []runtime.Object,
	generateManifestWorkObjectMeta GenerateManifestWorkObjectMeta,
	workApplier *workapplier.WorkApplier,
	options ...WorkBuilderOption) error

BuildAndApply is to build a set manifestWorks using the objects and update the existing manifestWorks.

func (*WorkBuilder) WithManifestsLimit

func (w *WorkBuilder) WithManifestsLimit(manifestsLimit int) *WorkBuilder

WithManifestsLimit is to set the total limit size of manifests in manifestWork. the unit of manifestsLimit is byte. the actual size of manifests will be the 80% of the limit. This is an optional setting, and the default limit is 50k.

type WorkBuilderOption

type WorkBuilderOption func(*internalWorkBuilder) *internalWorkBuilder

func DeletionOption

func DeletionOption(option *workapiv1.DeleteOption) WorkBuilderOption

func ExistingManifestWorksOption

func ExistingManifestWorksOption(works []workapiv1.ManifestWork) WorkBuilderOption

func ManifestAnnotations

func ManifestAnnotations(annotations map[string]string) WorkBuilderOption

func ManifestConfigOption

func ManifestConfigOption(option []workapiv1.ManifestConfigOption) WorkBuilderOption

func ManifestWorkExecutorOption

func ManifestWorkExecutorOption(executor *workapiv1.ManifestWorkExecutor) WorkBuilderOption

Jump to

Keyboard shortcuts

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