mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
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 -->
This commit is contained in:
@@ -21,6 +21,10 @@ type ClusterProxySpec struct {
|
||||
// ServiceAccountName is a reference to the service account used for impersonation.
|
||||
// +required
|
||||
ServiceAccountName string `json:"serviceAccountName"`
|
||||
|
||||
// Groups are references to groups that the peer will be a part of.
|
||||
// +optional
|
||||
Groups []GroupReference `json:"groups,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterProxyStatus defines the observed state of ClusterProxy.
|
||||
|
||||
@@ -17,7 +17,7 @@ func (in *ClusterProxy) DeepCopyInto(out *ClusterProxy) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
@@ -74,6 +74,13 @@ func (in *ClusterProxyList) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterProxySpec) DeepCopyInto(out *ClusterProxySpec) {
|
||||
*out = *in
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]GroupReference, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterProxySpec.
|
||||
|
||||
Reference in New Issue
Block a user