Documentation
¶
Index ¶
- Constants
- func AddFinalizer(obj metav1.Object, finalizers ...string)
- func GetCluster(ctx context.Context, client ctrlruntimeclient.Client, ...) (*v1alpha1.Cluster, error)
- func GetConfigMapData(ctx context.Context, client ctrlruntimeclient.Client, namespace string, ...) (string, error)
- func GetEnv(key, fallback string) string
- func GetFuncMap() template.FuncMap
- func GetNotificationSink(ctx context.Context, client ctrlruntimeclient.Client, ...) (*v1alpha1.NotificationSink, error)
- func GetPluralEnv(key, fallback string) string
- func GetPrAutomation(ctx context.Context, client ctrlruntimeclient.Client, ...) (*v1alpha1.PrAutomation, error)
- func GetSecret(ctx context.Context, client ctrlruntimeclient.Client, ...) (*corev1.Secret, error)
- func GetServiceDeployment(ctx context.Context, client ctrlruntimeclient.Client, ...) (*v1alpha1.ServiceDeployment, error)
- func HashObject(a any) (string, error)
- func HashString(s string) string
- func MakeTemplate(tmplate string) (*template.Template, error)
- func MarkCondition(set func(condition metav1.Condition), conditionType v1alpha1.ConditionType, ...)
- func MarkFalse(set func(metav1.Condition), conditionType v1alpha1.ConditionType, ...)
- func MarkTrue(set func(metav1.Condition), conditionType v1alpha1.ConditionType, ...)
- func RemoveFinalizer(obj metav1.Object, toRemove ...string)
- func RenderString(tmplate string, ctx map[string]interface{}) (string, error)
- func RenderTemplate(wr io.Writer, tmplate string, ctx map[string]interface{}) error
- func SyncCondition(set func(condition metav1.Condition), ...)
- func TryAddControllerRef(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryAddOwnerRef(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryRemoveOwnerRef(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryToUpdate(ctx context.Context, client ctrlruntimeclient.Client, ...) error
- func TryUpdateStatus[PatchObject ctrlruntimeclient.Object](ctx context.Context, client ctrlruntimeclient.Client, object PatchObject, ...) error
- type ConsoleHelper
- type Patcher
Constants ¶
View Source
const (
EnvPrefix = "PLRL"
)
Variables ¶
This section is empty.
Functions ¶
func AddFinalizer ¶
AddFinalizer will add the given finalizer to the object. It uses a StringSet to avoid duplicates.
func GetCluster ¶
func GetCluster(ctx context.Context, client ctrlruntimeclient.Client, ref *corev1.ObjectReference) (*v1alpha1.Cluster, error)
func GetConfigMapData ¶
func GetConfigMapData(ctx context.Context, client ctrlruntimeclient.Client, namespace string, ref *corev1.ConfigMapKeySelector) (string, error)
func GetEnv ¶
GetEnv - Lookup the environment variable provided and set to default value if variable isn't found
func GetFuncMap ¶
func GetNotificationSink ¶
func GetNotificationSink(ctx context.Context, client ctrlruntimeclient.Client, ref *corev1.ObjectReference) (*v1alpha1.NotificationSink, error)
func GetPluralEnv ¶
GetPluralEnv - Lookup the plural environment variable. It has to be prefixed with EnvPrefix. If variable with the provided key is not found, fallback will be used.
func GetPrAutomation ¶
func GetPrAutomation(ctx context.Context, client ctrlruntimeclient.Client, ref *corev1.ObjectReference) (*v1alpha1.PrAutomation, error)
func GetSecret ¶
func GetSecret(ctx context.Context, client ctrlruntimeclient.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
func GetServiceDeployment ¶
func GetServiceDeployment(ctx context.Context, client ctrlruntimeclient.Client, ref *corev1.ObjectReference) (*v1alpha1.ServiceDeployment, error)
func HashObject ¶
func HashString ¶
func MarkCondition ¶
func MarkCondition(set func(condition metav1.Condition), conditionType v1alpha1.ConditionType, conditionStatus metav1.ConditionStatus, conditionReason v1alpha1.ConditionReason, message string)
func MarkFalse ¶
func MarkFalse(set func(metav1.Condition), conditionType v1alpha1.ConditionType, conditionReason v1alpha1.ConditionReason, message string)
func MarkTrue ¶
func MarkTrue(set func(metav1.Condition), conditionType v1alpha1.ConditionType, conditionReason v1alpha1.ConditionReason, message string)
func RemoveFinalizer ¶
RemoveFinalizer removes the given finalizers from the object.
func RenderTemplate ¶
func SyncCondition ¶
func TryAddControllerRef ¶
func TryAddControllerRef(ctx context.Context, client ctrlruntimeclient.Client, owner ctrlruntimeclient.Object, controlled ctrlruntimeclient.Object, scheme *runtime.Scheme) error
func TryAddFinalizer ¶
func TryAddFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func TryAddOwnerRef ¶
func TryAddOwnerRef(ctx context.Context, client ctrlruntimeclient.Client, owner ctrlruntimeclient.Object, object ctrlruntimeclient.Object, scheme *runtime.Scheme) error
func TryRemoveFinalizer ¶
func TryRemoveFinalizer(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object, finalizers ...string) error
func TryRemoveOwnerRef ¶
func TryRemoveOwnerRef(ctx context.Context, client ctrlruntimeclient.Client, owner ctrlruntimeclient.Object, controlled ctrlruntimeclient.Object, scheme *runtime.Scheme) error
func TryToUpdate ¶
func TryToUpdate(ctx context.Context, client ctrlruntimeclient.Client, object ctrlruntimeclient.Object) error
func TryUpdateStatus ¶
func TryUpdateStatus[PatchObject ctrlruntimeclient.Object](ctx context.Context, client ctrlruntimeclient.Client, object PatchObject, patch Patcher[PatchObject]) error
TryUpdateStatus TODO ...
Types ¶
type ConsoleHelper ¶
type ConsoleHelper struct {
// contains filtered or unexported fields
}
func NewConsoleHelper ¶
func NewConsoleHelper(ctx context.Context, k8sClient k8sclient.Client) *ConsoleHelper
func (*ConsoleHelper) IDFromRef ¶
func (in *ConsoleHelper) IDFromRef(ref *v1.ObjectReference, resource v1alpha1.PluralResource) (*string, error)
Click to show internal directories.
Click to hide internal directories.