initialize

package
v2.7.1-0...-d77f34b Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package initialize provides functions to initialize some common fields and types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotations

func Annotations(object metav1.Object)

Annotations initializes the Annotations of object when they are nil.

func Bool

func Bool(v bool) *bool

Bool returns a pointer to v.

func FromPointer

func FromPointer[T any](p *T) T

FromPointer returns the value that p points to. When p is nil, it returns the zero value of T.

func Int32

func Int32(v int32) *int32

Int32 returns a pointer to v.

func Int64

func Int64(v int64) *int64

Int64 returns a pointer to v.

func IntOrString

func IntOrString(ios intstr.IntOrString) *intstr.IntOrString

IntOrString returns a pointer to the provided IntOrString

func IntOrStringInt32

func IntOrStringInt32(i int32) *intstr.IntOrString

IntOrStringInt32 returns an *intstr.IntOrString containing i.

func IntOrStringString

func IntOrStringString(s string) *intstr.IntOrString

IntOrStringString returns an *intstr.IntOrString containing s.

func Labels

func Labels(object metav1.Object)

Labels initializes the Labels of object when they are nil.

func Map

func Map[M ~map[K]V, K comparable, V any](m *M)

Map initializes m when it points to nil.

func PodSecurityContext

func PodSecurityContext() *corev1.PodSecurityContext

PodSecurityContext returns a v1.PodSecurityContext with some defaults.

func Pointer

func Pointer[T any](v T) *T

Pointer returns a pointer to v.

func RestrictedSecurityContext

func RestrictedSecurityContext(enableSeccompProfile bool) *corev1.SecurityContext

RestrictedSecurityContext returns a v1.SecurityContext with safe defaults. See https://docs.k8s.io/concepts/security/pod-security-standards/

func String

func String(v string) *string

String returns a pointer to v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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