builder

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToNewBuilderConfigMap

func ToNewBuilderConfigMap(builder []BuilderConfigMap) func(*Builder)

func ToNewBuilderContext

func ToNewBuilderContext(builder BuilderContext) func(*Builder)

func ToNewBuilderDeploymentStatefulSet

func ToNewBuilderDeploymentStatefulSet(builder []BuilderDeploymentStatefulSet) func(*Builder)

func ToNewBuilderNetworkPolicy added in v0.0.4

func ToNewBuilderNetworkPolicy(builder []BuilderNetworkPolicy) func(*Builder)

func ToNewBuilderRecorder

func ToNewBuilderRecorder(builder BuilderRecorder) func(*Builder)

func ToNewBuilderService

func ToNewBuilderService(builder []BuilderService) func(*Builder)

func ToNewBuilderStorageConfig

func ToNewBuilderStorageConfig(builder []BuilderStorageConfig) func(*Builder)

func ToNewBuilderStore

func ToNewBuilderStore(builder InternalStore) func(*Builder)

Types

type Builder

type Builder struct {
	ConfigMaps              []BuilderConfigMap
	DeploymentOrStatefulset []BuilderDeploymentStatefulSet
	StorageConfig           []BuilderStorageConfig
	Service                 []BuilderService
	NetworkPolicy           []BuilderNetworkPolicy
	Recorder                BuilderRecorder
	Context                 BuilderContext
	Store                   InternalStore
}

func NewBuilder

func NewBuilder(opts ...ToBuilder) *Builder

func (*Builder) Exists

func (s *Builder) Exists(key string) bool

func (*Builder) Put

func (s *Builder) Put(key, value string)

func (*Builder) ReconcileConfigMap

func (s *Builder) ReconcileConfigMap() (controllerutil.OperationResult, error)

func (*Builder) ReconcileDeployOrSts

func (s *Builder) ReconcileDeployOrSts() (controllerutil.OperationResult, error)

func (*Builder) ReconcileNetworkPolicy added in v0.0.4

func (s *Builder) ReconcileNetworkPolicy() (controllerutil.OperationResult, error)

func (*Builder) ReconcileService

func (s *Builder) ReconcileService() (controllerutil.OperationResult, error)

func (*Builder) ReconcileStorage

func (s *Builder) ReconcileStorage() (controllerutil.OperationResult, error)

func (*Builder) ReconcileStore

func (s *Builder) ReconcileStore() error

type BuilderConfigMap

type BuilderConfigMap struct {
	Data map[string]string
	CommonBuilder
}

type BuilderContext

type BuilderContext struct {
	Context context.Context
}

type BuilderDeploymentStatefulSet

type BuilderDeploymentStatefulSet struct {
	Replicas            int32
	Labels              map[string]string
	VolumeClaimTemplate []BuilderStorageConfig
	ServiceName         string
	PodSpec             *v1.PodSpec
	Kind                string
	CommonBuilder
}

func (*BuilderDeploymentStatefulSet) MakeStatefulSet

func (b *BuilderDeploymentStatefulSet) MakeStatefulSet() (*appsv1.StatefulSet, error)

func (*BuilderDeploymentStatefulSet) MakeVolumeClaimTemplates

func (b *BuilderDeploymentStatefulSet) MakeVolumeClaimTemplates() []v1.PersistentVolumeClaim

type BuilderNetworkPolicy added in v0.0.4

type BuilderNetworkPolicy struct {
	NetworkPolicySpec *networkingv1.NetworkPolicySpec
	CommonBuilder
}

type BuilderRecorder

type BuilderRecorder struct {
	Recorder       record.EventRecorder
	ControllerName string
}

func (*BuilderRecorder) GenericEvent

func (b *BuilderRecorder) GenericEvent(crObj client.Object, eventType, reason, message string)

type BuilderService

type BuilderService struct {
	ServiceSpec    *v1.ServiceSpec
	SelectorLabels map[string]string
	CommonBuilder
}

type BuilderStorageConfig

type BuilderStorageConfig struct {
	PvcSpec *v1.PersistentVolumeClaimSpec
	CommonBuilder
}

func (*BuilderStorageConfig) MakePvc

type CommonBuilder

type CommonBuilder struct {
	ObjectMeta   metav1.ObjectMeta
	Client       client.Client
	OwnerRef     metav1.OwnerReference
	CrObject     client.Object
	DesiredState client.Object
	CurrentState client.Object
	ObjectList   client.ObjectList
	Labels       map[string]string
}

func (*CommonBuilder) Create

func (*CommonBuilder) CreateOrUpdate

func (b *CommonBuilder) CreateOrUpdate(ctx context.Context, buildRecorder BuilderRecorder) (controllerutil.OperationResult, error)

func (*CommonBuilder) Delete

func (*CommonBuilder) Get

func (b *CommonBuilder) Get(ctx context.Context, buildRecorder BuilderRecorder) (client.Object, error)

func (*CommonBuilder) List

func (b *CommonBuilder) List(ctx context.Context, buildRecorder BuilderRecorder) (client.ObjectList, error)

func (*CommonBuilder) Update

type InternalStore

type InternalStore struct {
	ObjectNameKind map[string]string
	CommonBuilder
}

func NewStore

func NewStore(
	client client.Client,
	labels map[string]string,
	namespace string,
	crObject client.Object,
) *InternalStore

type K8sObjectName

type K8sObjectName string

type ToBuilder

type ToBuilder func(opts *Builder)

Jump to

Keyboard shortcuts

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