mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Add ingress feature to controller (#5)
Co-authored-by: Maycon Santos <mlsmaycon@gmail.com>
This commit is contained in:
co-authored by
Maycon Santos
parent
cea60745d2
commit
166091b8e0
@@ -0,0 +1,52 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NBGroupSpec defines the desired state of NBGroup.
|
||||
type NBGroupSpec struct {
|
||||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// NBGroupStatus defines the observed state of NBGroup.
|
||||
type NBGroupStatus struct {
|
||||
// +optional
|
||||
GroupID *string `json:"groupID"`
|
||||
// +optional
|
||||
Conditions []NBCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// Equal returns if NBGroupStatus is equal to this one
|
||||
func (a NBGroupStatus) Equal(b NBGroupStatus) bool {
|
||||
return a.GroupID == b.GroupID && slices.Equal(a.Conditions, b.Conditions)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
// NBGroup is the Schema for the nbgroups API.
|
||||
type NBGroup struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec NBGroupSpec `json:"spec,omitempty"`
|
||||
Status NBGroupStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// NBGroupList contains a list of NBGroup.
|
||||
type NBGroupList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []NBGroup `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&NBGroup{}, &NBGroupList{})
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NBPolicySpec defines the desired state of NBPolicy.
|
||||
type NBPolicySpec struct {
|
||||
// Name Policy name
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
Name string `json:"name"`
|
||||
// +optional
|
||||
Description string `json:"description,omitempty"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:items:MinLength=1
|
||||
SourceGroups []string `json:"sourceGroups,omitempty"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:items:MinLength=1
|
||||
DestinationGroups []string `json:"destinationGroups,omitempty"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:items:Enum=tcp;udp
|
||||
Protocols []string `json:"protocols,omitempty"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:items:Minimum=0
|
||||
// +kubebuilder:validation:items:Maximum=65535
|
||||
Ports []int32 `json:"ports,omitempty"`
|
||||
// +optional
|
||||
// +default:value=true
|
||||
Bidirectional bool `json:"bidirectional"`
|
||||
}
|
||||
|
||||
// NBPolicyStatus defines the observed state of NBPolicy.
|
||||
type NBPolicyStatus struct {
|
||||
// +optional
|
||||
TCPPolicyID *string `json:"tcpPolicyID"`
|
||||
// +optional
|
||||
UDPPolicyID *string `json:"udpPolicyID"`
|
||||
// +optional
|
||||
LastUpdatedAt *metav1.Time `json:"lastUpdatedAt"`
|
||||
// +optional
|
||||
ManagedServiceList []string `json:"managedServiceList"`
|
||||
// +optional
|
||||
Conditions []NBCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// Equal returns if NBPolicyStatus is equal to this one
|
||||
func (a NBPolicyStatus) Equal(b NBPolicyStatus) bool {
|
||||
return a.TCPPolicyID == b.TCPPolicyID &&
|
||||
a.UDPPolicyID == b.UDPPolicyID &&
|
||||
a.LastUpdatedAt == b.LastUpdatedAt &&
|
||||
slices.Equal(a.ManagedServiceList, b.ManagedServiceList) &&
|
||||
slices.Equal(a.Conditions, b.Conditions)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:resource:scope=Cluster
|
||||
|
||||
// NBPolicy is the Schema for the nbpolicies API.
|
||||
type NBPolicy struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec NBPolicySpec `json:"spec,omitempty"`
|
||||
Status NBPolicyStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// NBPolicyList contains a list of NBPolicy.
|
||||
type NBPolicyList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []NBPolicy `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&NBPolicy{}, &NBPolicyList{})
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NBResourceSpec defines the desired state of NBResource.
|
||||
type NBResourceSpec struct {
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
Name string `json:"name"`
|
||||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
|
||||
NetworkID string `json:"networkID"`
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
Address string `json:"address"`
|
||||
// +kubebuilder:validation:items:MinLength=1
|
||||
Groups []string `json:"groups"`
|
||||
// +optional
|
||||
PolicyName string `json:"policyName,omitempty"`
|
||||
// +optional
|
||||
TCPPorts []int32 `json:"tcpPorts,omitempty"`
|
||||
// +optional
|
||||
UDPPorts []int32 `json:"udpPorts,omitempty"`
|
||||
}
|
||||
|
||||
// NBResourceStatus defines the observed state of NBResource.
|
||||
type NBResourceStatus struct {
|
||||
// +optional
|
||||
NetworkResourceID *string `json:"networkResourceID,omitempty"`
|
||||
// +optional
|
||||
PolicyName *string `json:"policyName,omitempty"`
|
||||
// +optional
|
||||
TCPPorts []int32 `json:"tcpPorts,omitempty"`
|
||||
// +optional
|
||||
UDPPorts []int32 `json:"udpPorts,omitempty"`
|
||||
// +optional
|
||||
Groups []string `json:"groups,omitempty"`
|
||||
// +optional
|
||||
Conditions []NBCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// Equal returns if NBResourceStatus is equal to this one
|
||||
func (a NBResourceStatus) Equal(b NBResourceStatus) bool {
|
||||
return a.NetworkResourceID == b.NetworkResourceID &&
|
||||
a.PolicyName == b.PolicyName &&
|
||||
slices.Equal(a.TCPPorts, b.TCPPorts) &&
|
||||
slices.Equal(a.UDPPorts, b.UDPPorts) &&
|
||||
slices.Equal(a.Groups, b.Groups) &&
|
||||
slices.Equal(a.Conditions, b.Conditions)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
// NBResource is the Schema for the nbresources API.
|
||||
type NBResource struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec NBResourceSpec `json:"spec,omitempty"`
|
||||
Status NBResourceStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// NBResourceList contains a list of NBResource.
|
||||
type NBResourceList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []NBResource `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&NBResource{}, &NBResourceList{})
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NBRoutingPeerSpec defines the desired state of NBRoutingPeer.
|
||||
type NBRoutingPeerSpec struct {
|
||||
// +optional
|
||||
Replicas *int32 `json:"replicas"`
|
||||
// +optional
|
||||
Resources corev1.ResourceRequirements `json:"resources"`
|
||||
// +optional
|
||||
Labels map[string]string `json:"labels"`
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations"`
|
||||
// +optional
|
||||
NodeSelector map[string]string `json:"nodeSelector"`
|
||||
// +optional
|
||||
Tolerations []corev1.Toleration `json:"tolerations"`
|
||||
}
|
||||
|
||||
// NBRoutingPeerStatus defines the observed state of NBRoutingPeer.
|
||||
type NBRoutingPeerStatus struct {
|
||||
// +optional
|
||||
NetworkID *string `json:"networkID"`
|
||||
// +optional
|
||||
SetupKeyID *string `json:"setupKeyID"`
|
||||
// +optional
|
||||
RouterID *string `json:"routerID"`
|
||||
// +optional
|
||||
Conditions []NBCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// Equal returns if NBRoutingPeerStatus is equal to this one
|
||||
func (a NBRoutingPeerStatus) Equal(b NBRoutingPeerStatus) bool {
|
||||
return a.NetworkID == b.NetworkID &&
|
||||
a.SetupKeyID == b.SetupKeyID &&
|
||||
a.RouterID == b.RouterID &&
|
||||
slices.Equal(a.Conditions, b.Conditions)
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
// NBRoutingPeer is the Schema for the nbroutingpeers API.
|
||||
type NBRoutingPeer struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec NBRoutingPeerSpec `json:"spec,omitempty"`
|
||||
Status NBRoutingPeerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// NBRoutingPeerList contains a list of NBRoutingPeer.
|
||||
type NBRoutingPeerList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []NBRoutingPeer `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&NBRoutingPeer{}, &NBRoutingPeerList{})
|
||||
}
|
||||
+40
-13
@@ -21,13 +21,13 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NBSetupKeyConditionType is a valid value for PodCondition.Type
|
||||
type NBSetupKeyConditionType string
|
||||
// NBConditionType is a valid value for PodCondition.Type
|
||||
type NBConditionType string
|
||||
|
||||
// These are built-in conditions of pod. An application may use a custom condition not listed here.
|
||||
const (
|
||||
// Ready indicates whether NBSetupKey is valid and ready to use.
|
||||
Ready NBSetupKeyConditionType = "Ready"
|
||||
// NBSetupKeyReady indicates whether NBSetupKey is valid and ready to use.
|
||||
NBSetupKeyReady NBConditionType = "Ready"
|
||||
)
|
||||
|
||||
// NBSetupKeySpec defines the desired state of NBSetupKey.
|
||||
@@ -40,28 +40,55 @@ type NBSetupKeySpec struct {
|
||||
|
||||
// NBSetupKeyStatus defines the observed state of NBSetupKey.
|
||||
type NBSetupKeyStatus struct {
|
||||
Conditions []NBSetupKeyCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
|
||||
// +optional
|
||||
Conditions []NBCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// NBSetupKeyCondition defines a condition in NBSetupKey status.
|
||||
type NBSetupKeyCondition struct {
|
||||
// NBCondition defines a condition in NBSetupKey status.
|
||||
type NBCondition struct {
|
||||
// Type is the type of the condition.
|
||||
Type NBSetupKeyConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NBSetupKeyConditionType"`
|
||||
Type NBConditionType `json:"type"`
|
||||
// Status is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`
|
||||
Status corev1.ConditionStatus `json:"status"`
|
||||
// Last time we probed the condition.
|
||||
// +optional
|
||||
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
|
||||
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// Unique, one-word, CamelCase reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// Human-readable message indicating details about last transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// NBConditionTrue returns default true condition
|
||||
func NBConditionTrue() []NBCondition {
|
||||
return []NBCondition{
|
||||
{
|
||||
Type: NBSetupKeyReady,
|
||||
LastProbeTime: metav1.Now(),
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Status: corev1.ConditionTrue,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NBConditionFalse returns default false condition
|
||||
func NBConditionFalse(reason, msg string) []NBCondition {
|
||||
return []NBCondition{
|
||||
{
|
||||
Type: NBSetupKeyReady,
|
||||
LastProbeTime: metav1.Now(),
|
||||
LastTransitionTime: metav1.Now(),
|
||||
Status: corev1.ConditionFalse,
|
||||
Reason: reason,
|
||||
Message: msg,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
+536
-18
@@ -5,9 +5,544 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBCondition) DeepCopyInto(out *NBCondition) {
|
||||
*out = *in
|
||||
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBCondition.
|
||||
func (in *NBCondition) DeepCopy() *NBCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBGroup) DeepCopyInto(out *NBGroup) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBGroup.
|
||||
func (in *NBGroup) DeepCopy() *NBGroup {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBGroup)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBGroup) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBGroupList) DeepCopyInto(out *NBGroupList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]NBGroup, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBGroupList.
|
||||
func (in *NBGroupList) DeepCopy() *NBGroupList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBGroupList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBGroupList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBGroupSpec) DeepCopyInto(out *NBGroupSpec) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBGroupSpec.
|
||||
func (in *NBGroupSpec) DeepCopy() *NBGroupSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBGroupSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBGroupStatus) DeepCopyInto(out *NBGroupStatus) {
|
||||
*out = *in
|
||||
if in.GroupID != nil {
|
||||
in, out := &in.GroupID, &out.GroupID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]NBCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBGroupStatus.
|
||||
func (in *NBGroupStatus) DeepCopy() *NBGroupStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBGroupStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBPolicy) DeepCopyInto(out *NBPolicy) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBPolicy.
|
||||
func (in *NBPolicy) DeepCopy() *NBPolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBPolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBPolicy) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBPolicyList) DeepCopyInto(out *NBPolicyList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]NBPolicy, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBPolicyList.
|
||||
func (in *NBPolicyList) DeepCopy() *NBPolicyList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBPolicyList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBPolicyList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBPolicySpec) DeepCopyInto(out *NBPolicySpec) {
|
||||
*out = *in
|
||||
if in.SourceGroups != nil {
|
||||
in, out := &in.SourceGroups, &out.SourceGroups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.DestinationGroups != nil {
|
||||
in, out := &in.DestinationGroups, &out.DestinationGroups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Protocols != nil {
|
||||
in, out := &in.Protocols, &out.Protocols
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Ports != nil {
|
||||
in, out := &in.Ports, &out.Ports
|
||||
*out = make([]int32, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBPolicySpec.
|
||||
func (in *NBPolicySpec) DeepCopy() *NBPolicySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBPolicySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBPolicyStatus) DeepCopyInto(out *NBPolicyStatus) {
|
||||
*out = *in
|
||||
if in.TCPPolicyID != nil {
|
||||
in, out := &in.TCPPolicyID, &out.TCPPolicyID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.UDPPolicyID != nil {
|
||||
in, out := &in.UDPPolicyID, &out.UDPPolicyID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.LastUpdatedAt != nil {
|
||||
in, out := &in.LastUpdatedAt, &out.LastUpdatedAt
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.ManagedServiceList != nil {
|
||||
in, out := &in.ManagedServiceList, &out.ManagedServiceList
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]NBCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBPolicyStatus.
|
||||
func (in *NBPolicyStatus) DeepCopy() *NBPolicyStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBPolicyStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBResource) DeepCopyInto(out *NBResource) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBResource.
|
||||
func (in *NBResource) DeepCopy() *NBResource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBResource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBResource) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBResourceList) DeepCopyInto(out *NBResourceList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]NBResource, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBResourceList.
|
||||
func (in *NBResourceList) DeepCopy() *NBResourceList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBResourceList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBResourceList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBResourceSpec) DeepCopyInto(out *NBResourceSpec) {
|
||||
*out = *in
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.TCPPorts != nil {
|
||||
in, out := &in.TCPPorts, &out.TCPPorts
|
||||
*out = make([]int32, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.UDPPorts != nil {
|
||||
in, out := &in.UDPPorts, &out.UDPPorts
|
||||
*out = make([]int32, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBResourceSpec.
|
||||
func (in *NBResourceSpec) DeepCopy() *NBResourceSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBResourceSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBResourceStatus) DeepCopyInto(out *NBResourceStatus) {
|
||||
*out = *in
|
||||
if in.NetworkResourceID != nil {
|
||||
in, out := &in.NetworkResourceID, &out.NetworkResourceID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.PolicyName != nil {
|
||||
in, out := &in.PolicyName, &out.PolicyName
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.TCPPorts != nil {
|
||||
in, out := &in.TCPPorts, &out.TCPPorts
|
||||
*out = make([]int32, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.UDPPorts != nil {
|
||||
in, out := &in.UDPPorts, &out.UDPPorts
|
||||
*out = make([]int32, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]NBCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBResourceStatus.
|
||||
func (in *NBResourceStatus) DeepCopy() *NBResourceStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBResourceStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBRoutingPeer) DeepCopyInto(out *NBRoutingPeer) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBRoutingPeer.
|
||||
func (in *NBRoutingPeer) DeepCopy() *NBRoutingPeer {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBRoutingPeer)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBRoutingPeer) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBRoutingPeerList) DeepCopyInto(out *NBRoutingPeerList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]NBRoutingPeer, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBRoutingPeerList.
|
||||
func (in *NBRoutingPeerList) DeepCopy() *NBRoutingPeerList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBRoutingPeerList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NBRoutingPeerList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBRoutingPeerSpec) DeepCopyInto(out *NBRoutingPeerSpec) {
|
||||
*out = *in
|
||||
if in.Replicas != nil {
|
||||
in, out := &in.Replicas, &out.Replicas
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.NodeSelector != nil {
|
||||
in, out := &in.NodeSelector, &out.NodeSelector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Tolerations != nil {
|
||||
in, out := &in.Tolerations, &out.Tolerations
|
||||
*out = make([]corev1.Toleration, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBRoutingPeerSpec.
|
||||
func (in *NBRoutingPeerSpec) DeepCopy() *NBRoutingPeerSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBRoutingPeerSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBRoutingPeerStatus) DeepCopyInto(out *NBRoutingPeerStatus) {
|
||||
*out = *in
|
||||
if in.NetworkID != nil {
|
||||
in, out := &in.NetworkID, &out.NetworkID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.SetupKeyID != nil {
|
||||
in, out := &in.SetupKeyID, &out.SetupKeyID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.RouterID != nil {
|
||||
in, out := &in.RouterID, &out.RouterID
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]NBCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBRoutingPeerStatus.
|
||||
func (in *NBRoutingPeerStatus) DeepCopy() *NBRoutingPeerStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBRoutingPeerStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBSetupKey) DeepCopyInto(out *NBSetupKey) {
|
||||
*out = *in
|
||||
@@ -35,23 +570,6 @@ func (in *NBSetupKey) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBSetupKeyCondition) DeepCopyInto(out *NBSetupKeyCondition) {
|
||||
*out = *in
|
||||
in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NBSetupKeyCondition.
|
||||
func (in *NBSetupKeyCondition) DeepCopy() *NBSetupKeyCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NBSetupKeyCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NBSetupKeyList) DeepCopyInto(out *NBSetupKeyList) {
|
||||
*out = *in
|
||||
@@ -105,7 +623,7 @@ func (in *NBSetupKeyStatus) DeepCopyInto(out *NBSetupKeyStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]NBSetupKeyCondition, len(*in))
|
||||
*out = make([]NBCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user