Files
netbird-kubernetes-operator/pkg/applyconfigurations/api/v1alpha1/workloadoverride.go
T
Philip LaineandGitHub 69afe3aade Fix SPDX license header (#231)
This change adds SPDX license headers to all files and eforces it with
the linter.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-05 12:59:36 +02:00

73 lines
3.1 KiB
Go

// SPDX-License-Identifier: BSD-3-Clause
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
)
// WorkloadOverrideApplyConfiguration represents a declarative configuration of the WorkloadOverride type for use
// with apply.
type WorkloadOverrideApplyConfiguration struct {
// Labels that will be added.
Labels map[string]string `json:"labels,omitempty"`
// Annotations that will be added.
Annotations map[string]string `json:"annotations,omitempty"`
// Replicas sets the amount of client replicas.
Replicas *int32 `json:"replicas,omitempty"`
// PodTemplate overrides the pod template.
PodTemplate *v1.PodTemplateSpec `json:"podTemplate,omitempty"`
}
// WorkloadOverrideApplyConfiguration constructs a declarative configuration of the WorkloadOverride type for use with
// apply.
func WorkloadOverride() *WorkloadOverrideApplyConfiguration {
return &WorkloadOverrideApplyConfiguration{}
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *WorkloadOverrideApplyConfiguration) WithLabels(entries map[string]string) *WorkloadOverrideApplyConfiguration {
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *WorkloadOverrideApplyConfiguration) WithAnnotations(entries map[string]string) *WorkloadOverrideApplyConfiguration {
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Annotations[k] = v
}
return b
}
// WithReplicas sets the Replicas field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Replicas field is set to the value of the last call.
func (b *WorkloadOverrideApplyConfiguration) WithReplicas(value int32) *WorkloadOverrideApplyConfiguration {
b.Replicas = &value
return b
}
// WithPodTemplate sets the PodTemplate field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PodTemplate field is set to the value of the last call.
func (b *WorkloadOverrideApplyConfiguration) WithPodTemplate(value v1.PodTemplateSpec) *WorkloadOverrideApplyConfiguration {
b.PodTemplate = &value
return b
}