Documentation ¶
Index ¶
- func Create(ctx context.Context, c client.Client, sts *appsv1.StatefulSet) error
- func Delete(ctx context.Context, c client.Client, key client.ObjectKey) error
- func Get(ctx context.Context, c client.Client, key client.ObjectKey) (*appsv1.StatefulSet, error)
- func List(ctx context.Context, c client.Client, namespace string, ...) ([]appsv1.StatefulSet, error)
- func Update(ctx context.Context, c client.Client, sts *appsv1.StatefulSet, ...) error
- type Builder
- type EqualityFunc
- type MutateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create will create the given statefulset on the api server or return an error on failure
func List ¶
func List(ctx context.Context, c client.Client, namespace string, selector map[string]string) ([]appsv1.StatefulSet, error)
List returns a list of statefulsets that match the given selector.
func Update ¶
func Update(ctx context.Context, c client.Client, sts *appsv1.StatefulSet, equal EqualityFunc, mutate MutateFunc) error
Update will update an existing statefulset if compare func returns true or else leave it unchanged. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represents the struct to build k8s statefulsets
func (*Builder) Build ¶
func (b *Builder) Build() *appsv1.StatefulSet
Build returns the final statefulset.
func (*Builder) WithSelector ¶
func (b *Builder) WithSelector(s metav1.LabelSelector) *Builder
WithSelector sets the statefulset pod selector.
func (*Builder) WithTemplate ¶
func (b *Builder) WithTemplate(t corev1.PodTemplateSpec) *Builder
WithTemplate sets the statefulset spec pod template spec
func (*Builder) WithUpdateStrategy ¶
func (b *Builder) WithUpdateStrategy(s appsv1.StatefulSetUpdateStrategy) *Builder
WithStrategy sets the statefulset spec update strategy
type EqualityFunc ¶
type EqualityFunc func(current, desired *appsv1.StatefulSet) bool
EqualityFunc is the type for functions that compare two statefulsets. Return true if two statefulset are not not equal.
type MutateFunc ¶
type MutateFunc func(current, desired *appsv1.StatefulSet)
MutateFunc is the type for functions that mutate the current statefulset by applying the values from the desired statefulset.