Documentation ¶
Index ¶
- func IsMerge(opts []WithOption) bool
- func IsOverwrite(opts []WithOption) bool
- func IsOverwriteIfDefaultValue(opts []WithOption) bool
- func MergeK8s(dst any, src, new any) (err error)
- func MergeSliceOrDie(dst *[]any, key string, src ...[]any)
- type ContainerBuilder
- type ContainerBuilderDefault
- func (h *ContainerBuilderDefault) Container() *corev1.Container
- func (h *ContainerBuilderDefault) WithContainer(container *corev1.Container, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithEnv(envs []corev1.EnvVar, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithEnvFrom(envFroms []corev1.EnvFromSource, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithImage(image string, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithImagePullPolicy(pullPolicy corev1.PullPolicy, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithLivenessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithPort(ports []corev1.ContainerPort, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithReadinessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithResource(resources *corev1.ResourceRequirements, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithSecurityContext(sc *corev1.SecurityContext, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithStartupProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
- func (h *ContainerBuilderDefault) WithVolumeMount(volumeMounts []corev1.VolumeMount, opts ...WithOption) ContainerBuilder
- type IngressBuilder
- type IngressBuilderDefault
- func (h *IngressBuilderDefault) Build() (i *networkingv1.Ingress, err error)
- func (h *IngressBuilderDefault) WithAnnotations(annotations map[string]string, opts ...WithOption) IngressBuilder
- func (h *IngressBuilderDefault) WithIngressSpec(is *networkingv1.IngressSpec, opts ...WithOption) IngressBuilder
- func (h *IngressBuilderDefault) WithLabels(labels map[string]string, opts ...WithOption) IngressBuilder
- func (h *IngressBuilderDefault) WithName(name string, opts ...WithOption) IngressBuilder
- func (h *IngressBuilderDefault) WithNamespace(namespace string, opts ...WithOption) IngressBuilder
- type Operation
- type PodTemplateBuilder
- type PodTemplateBuilderDefault
- func (h *PodTemplateBuilderDefault) PodTemplate() *corev1.PodTemplateSpec
- func (h *PodTemplateBuilderDefault) WithAffinity(affinity corev1.Affinity, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithAnnotations(annotations map[string]string, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithImagePullSecrets(ips []corev1.LocalObjectReference, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithInitContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithLabels(labels map[string]string, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithNodeSelector(nodeSelector map[string]string, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithPodTemplateSpec(pts *corev1.PodTemplateSpec, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithSecurityContext(sc *corev1.PodSecurityContext, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithTerminationGracePeriodSeconds(nb int64, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithTolerations(tolerations []corev1.Toleration, opts ...WithOption) PodTemplateBuilder
- func (h *PodTemplateBuilderDefault) WithVolumes(volumes []corev1.Volume, opts ...WithOption) PodTemplateBuilder
- type WithOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMerge ¶
func IsMerge(opts []WithOption) bool
IsMerge permit to know if I need to merge items. Default to false
func IsOverwrite ¶
func IsOverwrite(opts []WithOption) bool
IsOverwrite permit to know if i should overwrite or not, base on options Default to true
func IsOverwriteIfDefaultValue ¶
func IsOverwriteIfDefaultValue(opts []WithOption) bool
IsOverwriteIfDefaultValue permit to know if I need to overwrite only if not default value Default to false
func MergeSliceOrDie ¶
MergeSliceOrDie permit to merge some slice on dst It avoid to set the same item based on key value
Types ¶
type ContainerBuilder ¶
type ContainerBuilder interface { Container() *corev1.Container WithContainer(container *corev1.Container, opts ...WithOption) ContainerBuilder WithEnvFrom(envFroms []corev1.EnvFromSource, opts ...WithOption) ContainerBuilder WithEnv(envs []corev1.EnvVar, opts ...WithOption) ContainerBuilder WithImage(image string, opts ...WithOption) ContainerBuilder WithImagePullPolicy(pullPolicy corev1.PullPolicy, opts ...WithOption) ContainerBuilder WithPort(ports []corev1.ContainerPort, opts ...WithOption) ContainerBuilder WithResource(ressources *corev1.ResourceRequirements, opts ...WithOption) ContainerBuilder WithSecurityContext(sc *corev1.SecurityContext, opts ...WithOption) ContainerBuilder WithVolumeMount(volumeMounts []corev1.VolumeMount, opts ...WithOption) ContainerBuilder WithLivenessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder WithReadinessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder WithStartupProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder }
func NewContainerBuilder ¶
func NewContainerBuilder() ContainerBuilder
NewContainerBuilder permit to get new container builder
type ContainerBuilderDefault ¶
type ContainerBuilderDefault struct {
// contains filtered or unexported fields
}
func (*ContainerBuilderDefault) Container ¶
func (h *ContainerBuilderDefault) Container() *corev1.Container
Container permit to get current container
func (*ContainerBuilderDefault) WithContainer ¶
func (h *ContainerBuilderDefault) WithContainer(container *corev1.Container, opts ...WithOption) ContainerBuilder
WithContainer permit to set existing container
func (*ContainerBuilderDefault) WithEnv ¶
func (h *ContainerBuilderDefault) WithEnv(envs []corev1.EnvVar, opts ...WithOption) ContainerBuilder
WithEnv permit to set env
func (*ContainerBuilderDefault) WithEnvFrom ¶
func (h *ContainerBuilderDefault) WithEnvFrom(envFroms []corev1.EnvFromSource, opts ...WithOption) ContainerBuilder
WithEnvFrom permit to set envFrom
func (*ContainerBuilderDefault) WithImage ¶
func (h *ContainerBuilderDefault) WithImage(image string, opts ...WithOption) ContainerBuilder
WithImage permit to set image
func (*ContainerBuilderDefault) WithImagePullPolicy ¶
func (h *ContainerBuilderDefault) WithImagePullPolicy(pullPolicy corev1.PullPolicy, opts ...WithOption) ContainerBuilder
WithImagePullPolicy permit to set image pull policy
func (*ContainerBuilderDefault) WithLivenessProbe ¶
func (h *ContainerBuilderDefault) WithLivenessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
func (*ContainerBuilderDefault) WithPort ¶
func (h *ContainerBuilderDefault) WithPort(ports []corev1.ContainerPort, opts ...WithOption) ContainerBuilder
func (*ContainerBuilderDefault) WithReadinessProbe ¶
func (h *ContainerBuilderDefault) WithReadinessProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
func (*ContainerBuilderDefault) WithResource ¶
func (h *ContainerBuilderDefault) WithResource(resources *corev1.ResourceRequirements, opts ...WithOption) ContainerBuilder
WithResource permit to set resources
func (*ContainerBuilderDefault) WithSecurityContext ¶
func (h *ContainerBuilderDefault) WithSecurityContext(sc *corev1.SecurityContext, opts ...WithOption) ContainerBuilder
WithSecurityContext permit to set security context
func (*ContainerBuilderDefault) WithStartupProbe ¶
func (h *ContainerBuilderDefault) WithStartupProbe(probe *corev1.Probe, opts ...WithOption) ContainerBuilder
func (*ContainerBuilderDefault) WithVolumeMount ¶
func (h *ContainerBuilderDefault) WithVolumeMount(volumeMounts []corev1.VolumeMount, opts ...WithOption) ContainerBuilder
WithVolumeMount permit to set volume mounts
type IngressBuilder ¶
type IngressBuilder interface { WithIngressSpec(is *networkingv1.IngressSpec, opts ...WithOption) IngressBuilder WithLabels(labels map[string]string, opts ...WithOption) IngressBuilder WithAnnotations(annotations map[string]string, opts ...WithOption) IngressBuilder WithName(name string, opts ...WithOption) IngressBuilder WithNamespace(namespace string, opts ...WithOption) IngressBuilder Build() (i *networkingv1.Ingress, err error) }
IngressBuilder is the ingress builder interface
func NewIngressBuilder ¶
func NewIngressBuilder() IngressBuilder
NewIngressBuilder permit to get the default ingress builder
type IngressBuilderDefault ¶
type IngressBuilderDefault struct {
// contains filtered or unexported fields
}
IngressBuilderDefault is the default implementation for ingress builder
func (*IngressBuilderDefault) Build ¶
func (h *IngressBuilderDefault) Build() (i *networkingv1.Ingress, err error)
Build permit to build the expected object It will execute all pending operation in the same order At the end, it will clean all pending operations
func (*IngressBuilderDefault) WithAnnotations ¶
func (h *IngressBuilderDefault) WithAnnotations(annotations map[string]string, opts ...WithOption) IngressBuilder
WithAnnotations permit to set annotation
func (*IngressBuilderDefault) WithIngressSpec ¶
func (h *IngressBuilderDefault) WithIngressSpec(is *networkingv1.IngressSpec, opts ...WithOption) IngressBuilder
WithIngressSpec permit to initialize ingress from ingress Spec
func (*IngressBuilderDefault) WithLabels ¶
func (h *IngressBuilderDefault) WithLabels(labels map[string]string, opts ...WithOption) IngressBuilder
WithLabels permit to set labels
func (*IngressBuilderDefault) WithName ¶
func (h *IngressBuilderDefault) WithName(name string, opts ...WithOption) IngressBuilder
WithName permit to set name
func (*IngressBuilderDefault) WithNamespace ¶
func (h *IngressBuilderDefault) WithNamespace(namespace string, opts ...WithOption) IngressBuilder
WithNamespace permit to set namespace
type PodTemplateBuilder ¶
type PodTemplateBuilder interface { WithPodTemplateSpec(pts *corev1.PodTemplateSpec, opts ...WithOption) PodTemplateBuilder WithLabels(labels map[string]string, opts ...WithOption) PodTemplateBuilder WithAnnotations(annotations map[string]string, opts ...WithOption) PodTemplateBuilder WithImagePullSecrets(ips []corev1.LocalObjectReference, opts ...WithOption) PodTemplateBuilder WithTerminationGracePeriodSeconds(nb int64, opts ...WithOption) PodTemplateBuilder WithTolerations(tolerations []corev1.Toleration, opts ...WithOption) PodTemplateBuilder WithNodeSelector(nodeSelector map[string]string, opts ...WithOption) PodTemplateBuilder WithInitContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder WithContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder WithVolumes(volumes []corev1.Volume, opts ...WithOption) PodTemplateBuilder WithAffinity(affinity corev1.Affinity, opts ...WithOption) PodTemplateBuilder WithSecurityContext(sc *corev1.PodSecurityContext, opts ...WithOption) PodTemplateBuilder PodTemplate() *corev1.PodTemplateSpec }
func NewPodTemplateBuilder ¶
func NewPodTemplateBuilder() PodTemplateBuilder
NewPodTemplateBuilder permit to init pod template builder
type PodTemplateBuilderDefault ¶
type PodTemplateBuilderDefault struct {
// contains filtered or unexported fields
}
func (*PodTemplateBuilderDefault) PodTemplate ¶
func (h *PodTemplateBuilderDefault) PodTemplate() *corev1.PodTemplateSpec
PodTemplate permit to get current pod template
func (*PodTemplateBuilderDefault) WithAffinity ¶
func (h *PodTemplateBuilderDefault) WithAffinity(affinity corev1.Affinity, opts ...WithOption) PodTemplateBuilder
WithAffinity permit to set affinity
func (*PodTemplateBuilderDefault) WithAnnotations ¶
func (h *PodTemplateBuilderDefault) WithAnnotations(annotations map[string]string, opts ...WithOption) PodTemplateBuilder
WithAnnotations permit to set annotations
func (*PodTemplateBuilderDefault) WithContainers ¶
func (h *PodTemplateBuilderDefault) WithContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder
WithContainers permit to set containers
func (*PodTemplateBuilderDefault) WithImagePullSecrets ¶
func (h *PodTemplateBuilderDefault) WithImagePullSecrets(ips []corev1.LocalObjectReference, opts ...WithOption) PodTemplateBuilder
WithImagePullSecrets permit to set ImagePullSecret
func (*PodTemplateBuilderDefault) WithInitContainers ¶
func (h *PodTemplateBuilderDefault) WithInitContainers(containers []corev1.Container, opts ...WithOption) PodTemplateBuilder
WithInitContainers permit to set init containers
func (*PodTemplateBuilderDefault) WithLabels ¶
func (h *PodTemplateBuilderDefault) WithLabels(labels map[string]string, opts ...WithOption) PodTemplateBuilder
WithLabels permit to set labels
func (*PodTemplateBuilderDefault) WithNodeSelector ¶
func (h *PodTemplateBuilderDefault) WithNodeSelector(nodeSelector map[string]string, opts ...WithOption) PodTemplateBuilder
WithNodeSelector permit to set nodeSelector
func (*PodTemplateBuilderDefault) WithPodTemplateSpec ¶
func (h *PodTemplateBuilderDefault) WithPodTemplateSpec(pts *corev1.PodTemplateSpec, opts ...WithOption) PodTemplateBuilder
WithPodTemplateSpec permit to use existing podTemplateSpec
func (*PodTemplateBuilderDefault) WithSecurityContext ¶
func (h *PodTemplateBuilderDefault) WithSecurityContext(sc *corev1.PodSecurityContext, opts ...WithOption) PodTemplateBuilder
WithSecurityContext permit to set security context
func (*PodTemplateBuilderDefault) WithTerminationGracePeriodSeconds ¶
func (h *PodTemplateBuilderDefault) WithTerminationGracePeriodSeconds(nb int64, opts ...WithOption) PodTemplateBuilder
WithTerminationGracePeriodSeconds permit to set TerminationGracePeriodSeconds
func (*PodTemplateBuilderDefault) WithTolerations ¶
func (h *PodTemplateBuilderDefault) WithTolerations(tolerations []corev1.Toleration, opts ...WithOption) PodTemplateBuilder
WithTolerations permit to set tolerations
func (*PodTemplateBuilderDefault) WithVolumes ¶
func (h *PodTemplateBuilderDefault) WithVolumes(volumes []corev1.Volume, opts ...WithOption) PodTemplateBuilder
WithContainers permit to set containers
type WithOption ¶
type WithOption string
const ( Overwrite WithOption = "overwrite" OverwriteIfDefaultValue WithOption = "overwriteIfDefaultValue" Merge WithOption = "merge" )