utils

package
v0.6.39 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsName

func AsName(val string) string

func ConvertMap

func ConvertMap(in map[string]any) map[string]string

ConvertMap converts map from `string: any` to `string: string`.

func DisableClientLimits

func DisableClientLimits(config *rest.Config)

func GetCurrentCanaryStep

func GetCurrentCanaryStep(rollout *v1alpha1.Rollout) (*v1alpha1.CanaryStep, *int32)

GetCurrentCanaryStep returns the current canary step. If there are no steps or the rollout has already executed the last step, the func returns nil

func GetOperatorNamespace

func GetOperatorNamespace() (string, error)

func HashObject

func HashObject(object any) (string, error)

func HashResource

func HashResource(resource unstructured.Unstructured) (string, error)

HashResource calculates SHA for an unstructured resource. It uses object metadata (name, namespace, labels, annotations, deletion timestamp) and all other top-level fields except status.

func Jitter

func Jitter(interval time.Duration) time.Duration

func MapIncludes

func MapIncludes(m, elements map[string]string) bool

MapIncludes checks if all `elements` are included in `m` map.

func MarkCondition

func MarkCondition(set func(condition metav1.Condition), conditionType v1alpha1.ConditionType, conditionStatus metav1.ConditionStatus, conditionReason v1alpha1.ConditionReason, message string)

func NewFactory

func NewFactory(cfg *rest.Config) util.Factory

func NewNamespacedFactory

func NewNamespacedFactory(cfg *rest.Config, namespace string) util.Factory

func PromoteRollout

func PromoteRollout(ctx context.Context, rolloutIf clientset.RolloutInterface, name string) (*v1alpha1.Rollout, error)

PromoteRollout promotes a rollout to the next step, or to end of all steps

func TryAddControllerRef

func TryAddControllerRef(ctx context.Context, client ctrlruntimeclient.Client, owner ctrlruntimeclient.Object, controlled ctrlruntimeclient.Object, scheme *runtime.Scheme) error

func UnstructuredAsJSON

func UnstructuredAsJSON(resource *unstructured.Unstructured) string

func UnstructuredToConditions

func UnstructuredToConditions(c []interface{}) []metav1.Condition

Types

This section is empty.

Jump to

Keyboard shortcuts

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