Files
Philip LaineandGitHub da90b6ae42 Add groups option to cluster proxy (#297)
This change adds an option to specify groups a cluster proxy peer is a
member of.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added optional `spec.groups` to the ClusterProxy custom resource to
associate group references by `id`, `name`, or `localRef`.
* CRD schema includes OpenAPI validation to enforce that each group
reference specifies exactly one selector.

* **Bug Fixes**
* Improved deep-copy behavior for ClusterProxy spec so group references
are copied safely and don’t share underlying slices.

* **Documentation**
* Updated API reference docs and README API table to include the new
`groups` field.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-16 10:49:57 +02:00

64 lines
3.0 KiB
Go

// SPDX-License-Identifier: BSD-3-Clause
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
// ClusterProxySpecApplyConfiguration represents a declarative configuration of the ClusterProxySpec type for use
// with apply.
//
// ClusterProxySpec defines the desired state of ClusterProxy.
type ClusterProxySpecApplyConfiguration struct {
// ClusterName is the name of the Kubernetes cluster.
ClusterName *string `json:"clusterName,omitempty"`
// APIServer is the URL of the Kubernetes API server to proxy requests to.
APIServer *string `json:"apiServer,omitempty"`
// ServiceAccountName is a reference to the service account used for impersonation.
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
// Groups are references to groups that the peer will be a part of.
Groups []GroupReferenceApplyConfiguration `json:"groups,omitempty"`
}
// ClusterProxySpecApplyConfiguration constructs a declarative configuration of the ClusterProxySpec type for use with
// apply.
func ClusterProxySpec() *ClusterProxySpecApplyConfiguration {
return &ClusterProxySpecApplyConfiguration{}
}
// WithClusterName sets the ClusterName 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 ClusterName field is set to the value of the last call.
func (b *ClusterProxySpecApplyConfiguration) WithClusterName(value string) *ClusterProxySpecApplyConfiguration {
b.ClusterName = &value
return b
}
// WithAPIServer sets the APIServer 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 APIServer field is set to the value of the last call.
func (b *ClusterProxySpecApplyConfiguration) WithAPIServer(value string) *ClusterProxySpecApplyConfiguration {
b.APIServer = &value
return b
}
// WithServiceAccountName sets the ServiceAccountName 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 ServiceAccountName field is set to the value of the last call.
func (b *ClusterProxySpecApplyConfiguration) WithServiceAccountName(value string) *ClusterProxySpecApplyConfiguration {
b.ServiceAccountName = &value
return b
}
// WithGroups adds the given value to the Groups 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 Groups field.
func (b *ClusterProxySpecApplyConfiguration) WithGroups(values ...*GroupReferenceApplyConfiguration) *ClusterProxySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithGroups")
}
b.Groups = append(b.Groups, *values[i])
}
return b
}