Files
netbird-kubernetes-operator/pkg/applyconfigurations/api/v1alpha1/setupkeyspec.go
T

68 lines
2.8 KiB
Go
Raw Normal View History

2026-05-05 12:59:36 +02:00
// SPDX-License-Identifier: BSD-3-Clause
2026-04-13 12:20:35 +02:00
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// SetupKeySpecApplyConfiguration represents a declarative configuration of the SetupKeySpec type for use
// with apply.
//
// SetupKeySpec defines the desired state of SetupKey.
2026-04-13 12:20:35 +02:00
type SetupKeySpecApplyConfiguration struct {
2026-04-23 08:55:49 +02:00
// Name of the setup key.
Name *string `json:"name,omitempty"`
2026-04-13 12:20:35 +02:00
// Ephemeral decides if peers added with the key are ephemeral or not.
Ephemeral *bool `json:"ephemeral,omitempty"`
// Duration sets how long the setup key is valid for.
Duration *v1.Duration `json:"duration,omitempty"`
// AutoGroups are groups that will be automatically assigned to peers using setup key.
2026-04-23 13:12:09 +02:00
AutoGroups []GroupReferenceApplyConfiguration `json:"autoGroups,omitempty"`
2026-04-13 12:20:35 +02:00
}
// SetupKeySpecApplyConfiguration constructs a declarative configuration of the SetupKeySpec type for use with
// apply.
func SetupKeySpec() *SetupKeySpecApplyConfiguration {
return &SetupKeySpecApplyConfiguration{}
}
2026-04-23 08:55:49 +02:00
// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *SetupKeySpecApplyConfiguration) WithName(value string) *SetupKeySpecApplyConfiguration {
b.Name = &value
return b
}
2026-04-13 12:20:35 +02:00
// WithEphemeral sets the Ephemeral 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 Ephemeral field is set to the value of the last call.
func (b *SetupKeySpecApplyConfiguration) WithEphemeral(value bool) *SetupKeySpecApplyConfiguration {
b.Ephemeral = &value
return b
}
// WithDuration sets the Duration 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 Duration field is set to the value of the last call.
func (b *SetupKeySpecApplyConfiguration) WithDuration(value v1.Duration) *SetupKeySpecApplyConfiguration {
b.Duration = &value
return b
}
2026-04-15 10:16:10 +02:00
// WithAutoGroups adds the given value to the AutoGroups field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the AutoGroups field.
2026-04-23 13:12:09 +02:00
func (b *SetupKeySpecApplyConfiguration) WithAutoGroups(values ...*GroupReferenceApplyConfiguration) *SetupKeySpecApplyConfiguration {
2026-04-15 10:16:10 +02:00
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAutoGroups")
}
b.AutoGroups = append(b.AutoGroups, *values[i])
}
return b
}