initialize

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 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 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 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 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/

Types

This section is empty.

Jump to

Keyboard shortcuts

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