diff --git a/api/networking/v1alpha1/network_type.go b/api/networking/v1alpha1/network_type.go index b3dbe43e2..8865c5650 100644 --- a/api/networking/v1alpha1/network_type.go +++ b/api/networking/v1alpha1/network_type.go @@ -4,6 +4,8 @@ package v1alpha1 import ( + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -51,6 +53,20 @@ type NetworkPeering struct { // NetworkRef is the reference to the network to peer with. // An empty namespace indicates that the target network resides in the same namespace as the source network. NetworkRef NetworkPeeringNetworkRef `json:"networkRef"` + // Prefixes is a list of prefixes that we want only to be exposed + // to the peered network, if no prefixes are specified no filtering will be done. + Prefixes []PeeringPrefix `json:"prefixes,omitempty"` +} + +// PeeringPrefixes defines prefixes to be exposed to the peered network +type PeeringPrefix struct { + // Name is the semantical name of the peering prefixes + Name string `json:"name"` + // CIDR to be exposed to the peered network + Prefix *commonv1alpha1.IPPrefix `json:"prefix,omitempty"` + // PrefixRef is the reference to the prefix to be exposed to peered network + // An empty namespace indicates that the prefix resides in the same namespace as the source network. + PrefixRef corev1.LocalObjectReference `json:"prefixRef,omitempty"` } // NetworkStatus defines the observed state of Network @@ -86,6 +102,16 @@ type NetworkPeeringStatus struct { Name string `json:"name"` // State represents the network peering state State NetworkPeeringState `json:"state,omitempty"` + // Prefixes contains the prefixes exposed to the peered network + Prefixes []PeeringPrefixStatus `json:"prefixes,omitempty"` +} + +// PeeringPrefixStatus lists prefixes exposed to peered network +type PeeringPrefixStatus struct { + // Name is the name of the peering prefix + Name string `json:"name"` + // CIDR exposed to the peered network + Prefix *commonv1alpha1.IPPrefix `json:"prefix,omitempty"` } const ( diff --git a/api/networking/v1alpha1/zz_generated.deepcopy.go b/api/networking/v1alpha1/zz_generated.deepcopy.go index 5970f5240..cf63e51e2 100644 --- a/api/networking/v1alpha1/zz_generated.deepcopy.go +++ b/api/networking/v1alpha1/zz_generated.deepcopy.go @@ -705,6 +705,13 @@ func (in *NetworkList) DeepCopyObject() runtime.Object { func (in *NetworkPeering) DeepCopyInto(out *NetworkPeering) { *out = *in out.NetworkRef = in.NetworkRef + if in.Prefixes != nil { + in, out := &in.Prefixes, &out.Prefixes + *out = make([]PeeringPrefix, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -753,6 +760,13 @@ func (in *NetworkPeeringNetworkRef) DeepCopy() *NetworkPeeringNetworkRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkPeeringStatus) DeepCopyInto(out *NetworkPeeringStatus) { *out = *in + if in.Prefixes != nil { + in, out := &in.Prefixes, &out.Prefixes + *out = make([]PeeringPrefixStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -1022,7 +1036,9 @@ func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { if in.Peerings != nil { in, out := &in.Peerings, &out.Peerings *out = make([]NetworkPeering, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.PeeringClaimRefs != nil { in, out := &in.PeeringClaimRefs, &out.PeeringClaimRefs @@ -1048,7 +1064,9 @@ func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { if in.Peerings != nil { in, out := &in.Peerings, &out.Peerings *out = make([]NetworkPeeringStatus, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } @@ -1063,6 +1081,47 @@ func (in *NetworkStatus) DeepCopy() *NetworkStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeeringPrefix) DeepCopyInto(out *PeeringPrefix) { + *out = *in + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = (*in).DeepCopy() + } + out.PrefixRef = in.PrefixRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeeringPrefix. +func (in *PeeringPrefix) DeepCopy() *PeeringPrefix { + if in == nil { + return nil + } + out := new(PeeringPrefix) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeeringPrefixStatus) DeepCopyInto(out *PeeringPrefixStatus) { + *out = *in + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeeringPrefixStatus. +func (in *PeeringPrefixStatus) DeepCopy() *PeeringPrefixStatus { + if in == nil { + return nil + } + out := new(PeeringPrefixStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PrefixSource) DeepCopyInto(out *PrefixSource) { *out = *in diff --git a/client-go/applyconfigurations/internal/internal.go b/client-go/applyconfigurations/internal/internal.go index edc14f8e5..9e2203f54 100644 --- a/client-go/applyconfigurations/internal/internal.go +++ b/client-go/applyconfigurations/internal/internal.go @@ -964,6 +964,12 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.NetworkPeeringNetworkRef default: {} + - name: prefixes + type: + list: + elementType: + namedType: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.PeeringPrefix + elementRelationship: atomic - name: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.NetworkPeeringClaimRef map: fields: @@ -994,6 +1000,12 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: prefixes + type: + list: + elementType: + namedType: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.PeeringPrefixStatus + elementRelationship: atomic - name: state type: scalar: string @@ -1168,6 +1180,30 @@ var schemaYAML = typed.YAMLObject(`types: - name: state type: scalar: string +- name: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.PeeringPrefix + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: prefix + type: + namedType: com.github.ironcore-dev.ironcore.api.common.v1alpha1.IPPrefix + - name: prefixRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + default: {} +- name: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.PeeringPrefixStatus + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: prefix + type: + namedType: com.github.ironcore-dev.ironcore.api.common.v1alpha1.IPPrefix - name: com.github.ironcore-dev.ironcore.api.networking.v1alpha1.PrefixSource map: fields: diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go index 4a8b92b14..261e69e94 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go @@ -10,6 +10,7 @@ package v1alpha1 type NetworkPeeringApplyConfiguration struct { Name *string `json:"name,omitempty"` NetworkRef *NetworkPeeringNetworkRefApplyConfiguration `json:"networkRef,omitempty"` + Prefixes []PeeringPrefixApplyConfiguration `json:"prefixes,omitempty"` } // NetworkPeeringApplyConfiguration constructs an declarative configuration of the NetworkPeering type for use with @@ -33,3 +34,16 @@ func (b *NetworkPeeringApplyConfiguration) WithNetworkRef(value *NetworkPeeringN b.NetworkRef = value return b } + +// WithPrefixes adds the given value to the Prefixes 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 Prefixes field. +func (b *NetworkPeeringApplyConfiguration) WithPrefixes(values ...*PeeringPrefixApplyConfiguration) *NetworkPeeringApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPrefixes") + } + b.Prefixes = append(b.Prefixes, *values[i]) + } + return b +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go index b89d0e54c..1433e3d42 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go @@ -12,8 +12,9 @@ import ( // NetworkPeeringStatusApplyConfiguration represents an declarative configuration of the NetworkPeeringStatus type for use // with apply. type NetworkPeeringStatusApplyConfiguration struct { - Name *string `json:"name,omitempty"` - State *v1alpha1.NetworkPeeringState `json:"state,omitempty"` + Name *string `json:"name,omitempty"` + State *v1alpha1.NetworkPeeringState `json:"state,omitempty"` + Prefixes []PeeringPrefixStatusApplyConfiguration `json:"prefixes,omitempty"` } // NetworkPeeringStatusApplyConfiguration constructs an declarative configuration of the NetworkPeeringStatus type for use with @@ -37,3 +38,16 @@ func (b *NetworkPeeringStatusApplyConfiguration) WithState(value v1alpha1.Networ b.State = &value return b } + +// WithPrefixes adds the given value to the Prefixes 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 Prefixes field. +func (b *NetworkPeeringStatusApplyConfiguration) WithPrefixes(values ...*PeeringPrefixStatusApplyConfiguration) *NetworkPeeringStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPrefixes") + } + b.Prefixes = append(b.Prefixes, *values[i]) + } + return b +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go new file mode 100644 index 000000000..5c25772fb --- /dev/null +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + v1 "k8s.io/api/core/v1" +) + +// PeeringPrefixApplyConfiguration represents an declarative configuration of the PeeringPrefix type for use +// with apply. +type PeeringPrefixApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Prefix *v1alpha1.IPPrefix `json:"prefix,omitempty"` + PrefixRef *v1.LocalObjectReference `json:"prefixRef,omitempty"` +} + +// PeeringPrefixApplyConfiguration constructs an declarative configuration of the PeeringPrefix type for use with +// apply. +func PeeringPrefix() *PeeringPrefixApplyConfiguration { + return &PeeringPrefixApplyConfiguration{} +} + +// 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 *PeeringPrefixApplyConfiguration) WithName(value string) *PeeringPrefixApplyConfiguration { + b.Name = &value + return b +} + +// WithPrefix sets the Prefix 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 Prefix field is set to the value of the last call. +func (b *PeeringPrefixApplyConfiguration) WithPrefix(value v1alpha1.IPPrefix) *PeeringPrefixApplyConfiguration { + b.Prefix = &value + return b +} + +// WithPrefixRef sets the PrefixRef 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 PrefixRef field is set to the value of the last call. +func (b *PeeringPrefixApplyConfiguration) WithPrefixRef(value v1.LocalObjectReference) *PeeringPrefixApplyConfiguration { + b.PrefixRef = &value + return b +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefixes.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixes.go new file mode 100644 index 000000000..d3c65ae8e --- /dev/null +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixes.go @@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" +) + +// PeeringPrefixesApplyConfiguration represents an declarative configuration of the PeeringPrefixes type for use +// with apply. +type PeeringPrefixesApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Prefix *v1alpha1.IPPrefix `json:"prefix,omitempty"` + PrefixRef *PeeringPrefixRefApplyConfiguration `json:"prefixRef,omitempty"` +} + +// PeeringPrefixesApplyConfiguration constructs an declarative configuration of the PeeringPrefixes type for use with +// apply. +func PeeringPrefixes() *PeeringPrefixesApplyConfiguration { + return &PeeringPrefixesApplyConfiguration{} +} + +// 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 *PeeringPrefixesApplyConfiguration) WithName(value string) *PeeringPrefixesApplyConfiguration { + b.Name = &value + return b +} + +// WithPrefix sets the Prefix 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 Prefix field is set to the value of the last call. +func (b *PeeringPrefixesApplyConfiguration) WithPrefix(value v1alpha1.IPPrefix) *PeeringPrefixesApplyConfiguration { + b.Prefix = &value + return b +} + +// WithPrefixRef sets the PrefixRef 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 PrefixRef field is set to the value of the last call. +func (b *PeeringPrefixesApplyConfiguration) WithPrefixRef(value *PeeringPrefixRefApplyConfiguration) *PeeringPrefixesApplyConfiguration { + b.PrefixRef = value + return b +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefixref.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixref.go new file mode 100644 index 000000000..0abae6c3a --- /dev/null +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixref.go @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// PeeringPrefixRefApplyConfiguration represents an declarative configuration of the PeeringPrefixRef type for use +// with apply. +type PeeringPrefixRefApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// PeeringPrefixRefApplyConfiguration constructs an declarative configuration of the PeeringPrefixRef type for use with +// apply. +func PeeringPrefixRef() *PeeringPrefixRefApplyConfiguration { + return &PeeringPrefixRefApplyConfiguration{} +} + +// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call. +func (b *PeeringPrefixRefApplyConfiguration) WithNamespace(value string) *PeeringPrefixRefApplyConfiguration { + b.Namespace = &value + return b +} + +// 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 *PeeringPrefixRefApplyConfiguration) WithName(value string) *PeeringPrefixRefApplyConfiguration { + b.Name = &value + return b +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go new file mode 100644 index 000000000..0629b942a --- /dev/null +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" +) + +// PeeringPrefixStatusApplyConfiguration represents an declarative configuration of the PeeringPrefixStatus type for use +// with apply. +type PeeringPrefixStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Prefix *v1alpha1.IPPrefix `json:"prefix,omitempty"` +} + +// PeeringPrefixStatusApplyConfiguration constructs an declarative configuration of the PeeringPrefixStatus type for use with +// apply. +func PeeringPrefixStatus() *PeeringPrefixStatusApplyConfiguration { + return &PeeringPrefixStatusApplyConfiguration{} +} + +// 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 *PeeringPrefixStatusApplyConfiguration) WithName(value string) *PeeringPrefixStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithPrefix sets the Prefix 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 Prefix field is set to the value of the last call. +func (b *PeeringPrefixStatusApplyConfiguration) WithPrefix(value v1alpha1.IPPrefix) *PeeringPrefixStatusApplyConfiguration { + b.Prefix = &value + return b +} diff --git a/client-go/applyconfigurations/utils.go b/client-go/applyconfigurations/utils.go index 22cfff1b2..4c775f14d 100644 --- a/client-go/applyconfigurations/utils.go +++ b/client-go/applyconfigurations/utils.go @@ -192,6 +192,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1alpha1.NetworkSpecApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("NetworkStatus"): return &applyconfigurationsnetworkingv1alpha1.NetworkStatusApplyConfiguration{} + case networkingv1alpha1.SchemeGroupVersion.WithKind("PeeringPrefix"): + return &applyconfigurationsnetworkingv1alpha1.PeeringPrefixApplyConfiguration{} + case networkingv1alpha1.SchemeGroupVersion.WithKind("PeeringPrefixStatus"): + return &applyconfigurationsnetworkingv1alpha1.PeeringPrefixStatusApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("PrefixSource"): return &applyconfigurationsnetworkingv1alpha1.PrefixSourceApplyConfiguration{} case networkingv1alpha1.SchemeGroupVersion.WithKind("VirtualIP"): diff --git a/client-go/openapi/api_violations.report b/client-go/openapi/api_violations.report index ae44727b3..e90a1b980 100644 --- a/client-go/openapi/api_violations.report +++ b/client-go/openapi/api_violations.report @@ -24,6 +24,8 @@ API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/netwo API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkInterfaceSpec,Prefixes API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkInterfaceStatus,IPs API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkInterfaceStatus,Prefixes +API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkPeering,Prefixes +API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkPeeringStatus,Prefixes API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkPolicyEgressRule,Ports API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkPolicyEgressRule,To API rule violation: list_type_missing,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkPolicyIngressRule,From diff --git a/client-go/openapi/zz_generated.openapi.go b/client-go/openapi/zz_generated.openapi.go index e8fb61558..14b0a9c52 100644 --- a/client-go/openapi/zz_generated.openapi.go +++ b/client-go/openapi/zz_generated.openapi.go @@ -109,6 +109,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkPolicyStatus": schema_ironcore_api_networking_v1alpha1_NetworkPolicyStatus(ref), "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkSpec": schema_ironcore_api_networking_v1alpha1_NetworkSpec(ref), "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkStatus": schema_ironcore_api_networking_v1alpha1_NetworkStatus(ref), + "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefix": schema_ironcore_api_networking_v1alpha1_PeeringPrefix(ref), + "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefixStatus": schema_ironcore_api_networking_v1alpha1_PeeringPrefixStatus(ref), "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PrefixSource": schema_ironcore_api_networking_v1alpha1_PrefixSource(ref), "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.VirtualIP": schema_ironcore_api_networking_v1alpha1_VirtualIP(ref), "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.VirtualIPList": schema_ironcore_api_networking_v1alpha1_VirtualIPList(ref), @@ -3620,12 +3622,26 @@ func schema_ironcore_api_networking_v1alpha1_NetworkPeering(ref common.Reference Ref: ref("github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkPeeringNetworkRef"), }, }, + "prefixes": { + SchemaProps: spec.SchemaProps{ + Description: "Prefixes is a list of prefixes that we want only to be exposed to the peered network, if no prefixes are specified no filtering will be done.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefix"), + }, + }, + }, + }, + }, }, Required: []string{"name", "networkRef"}, }, }, Dependencies: []string{ - "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkPeeringNetworkRef"}, + "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.NetworkPeeringNetworkRef", "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefix"}, } } @@ -3715,10 +3731,26 @@ func schema_ironcore_api_networking_v1alpha1_NetworkPeeringStatus(ref common.Ref Format: "", }, }, + "prefixes": { + SchemaProps: spec.SchemaProps{ + Description: "Prefixes contains the prefixes exposed to the peered network", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefixStatus"), + }, + }, + }, + }, + }, }, Required: []string{"name"}, }, }, + Dependencies: []string{ + "github.com/ironcore-dev/ironcore/api/networking/v1alpha1.PeeringPrefixStatus"}, } } @@ -4234,6 +4266,73 @@ func schema_ironcore_api_networking_v1alpha1_NetworkStatus(ref common.ReferenceC } } +func schema_ironcore_api_networking_v1alpha1_PeeringPrefix(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PeeringPrefixes defines prefixes to be exposed to the peered network", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the semantical name of the peering prefixes", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "prefix": { + SchemaProps: spec.SchemaProps{ + Description: "CIDR to be exposed to the peered network", + Ref: ref("github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix"), + }, + }, + "prefixRef": { + SchemaProps: spec.SchemaProps{ + Description: "PrefixRef is the reference to the prefix to be exposed to peered network An empty namespace indicates that the prefix resides in the same namespace as the source network.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix", "k8s.io/api/core/v1.LocalObjectReference"}, + } +} + +func schema_ironcore_api_networking_v1alpha1_PeeringPrefixStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PeeringPrefixStatus lists prefixes exposed to peered network", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the peering prefix", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "prefix": { + SchemaProps: spec.SchemaProps{ + Description: "CIDR exposed to the peered network", + Ref: ref("github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix"}, + } +} + func schema_ironcore_api_networking_v1alpha1_PrefixSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/docs/api-reference/networking.md b/docs/api-reference/networking.md index fc147fdc6..9558dfdf1 100644 --- a/docs/api-reference/networking.md +++ b/docs/api-reference/networking.md @@ -1907,6 +1907,20 @@ NetworkPeeringNetworkRef An empty namespace indicates that the target network resides in the same namespace as the source network.

+ + +prefixes
+ + +[]PeeringPrefix + + + + +

Prefixes is a list of prefixes that we want only to be exposed +to the peered network, if no prefixes are specified no filtering will be done.

+ +

NetworkPeeringClaimRef @@ -2069,6 +2083,19 @@ NetworkPeeringState

State represents the network peering state

+ + +prefixes
+ + +[]PeeringPrefixStatus + + + + +

Prefixes contains the prefixes exposed to the peered network

+ +

NetworkPolicyCondition @@ -2610,6 +2637,104 @@ NetworkState +

PeeringPrefix +

+

+(Appears on:NetworkPeering) +

+
+

PeeringPrefixes defines prefixes to be exposed to the peered network

+
+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is the semantical name of the peering prefixes

+
+prefix
+ + +github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix + + +
+

CIDR to be exposed to the peered network

+
+prefixRef
+ + +Kubernetes core/v1.LocalObjectReference + + +
+

PrefixRef is the reference to the prefix to be exposed to peered network +An empty namespace indicates that the prefix resides in the same namespace as the source network.

+
+

PeeringPrefixStatus +

+

+(Appears on:NetworkPeeringStatus) +

+
+

PeeringPrefixStatus lists prefixes exposed to peered network

+
+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

Name is the name of the peering prefix

+
+prefix
+ + +github.com/ironcore-dev/ironcore/api/common/v1alpha1.IPPrefix + + +
+

CIDR exposed to the peered network

+

PolicyType (string alias)

diff --git a/internal/apis/networking/network_type.go b/internal/apis/networking/network_type.go index d6ded9fc1..49202ecaa 100644 --- a/internal/apis/networking/network_type.go +++ b/internal/apis/networking/network_type.go @@ -4,6 +4,8 @@ package networking import ( + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -51,6 +53,20 @@ type NetworkPeering struct { // NetworkRef is the reference to the network to peer with. // An empty namespace indicates that the target network resides in the same namespace as the source network. NetworkRef NetworkPeeringNetworkRef + // Prefixes is a list of prefixes that we want only to be exposed + // to the peered network, if no prefixes are specified no filtering will be done. + Prefixes []PeeringPrefix +} + +// PeeringPrefixes defines prefixes to be exposed to the peered network +type PeeringPrefix struct { + // Name is the semantical name of the peering prefixes + Name string + // CIDR to be exposed to the peered network + Prefix *commonv1alpha1.IPPrefix + // PrefixRef is the reference to the prefix to be exposed to peered network + // An empty namespace indicates that the prefix resides in the same namespace as the source network. + PrefixRef corev1.LocalObjectReference } // NetworkStatus defines the observed state of Network @@ -86,6 +102,16 @@ type NetworkPeeringStatus struct { Name string // State represents the network peering state State NetworkPeeringState + // Prefixes contains the prefixes exposed to the peered network + Prefixes []PeeringPrefixStatus +} + +// PeeringPrefixStatus lists prefixes exposed to peered network +type PeeringPrefixStatus struct { + // Name is the name of the peering prefix + Name string + // CIDR exposed to the peered network + Prefix *commonv1alpha1.IPPrefix } const ( diff --git a/internal/apis/networking/v1alpha1/zz_generated.conversion.go b/internal/apis/networking/v1alpha1/zz_generated.conversion.go index 6231d2651..60bd7b58d 100644 --- a/internal/apis/networking/v1alpha1/zz_generated.conversion.go +++ b/internal/apis/networking/v1alpha1/zz_generated.conversion.go @@ -422,6 +422,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*v1alpha1.PeeringPrefix)(nil), (*networking.PeeringPrefix)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PeeringPrefix_To_networking_PeeringPrefix(a.(*v1alpha1.PeeringPrefix), b.(*networking.PeeringPrefix), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*networking.PeeringPrefix)(nil), (*v1alpha1.PeeringPrefix)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_networking_PeeringPrefix_To_v1alpha1_PeeringPrefix(a.(*networking.PeeringPrefix), b.(*v1alpha1.PeeringPrefix), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha1.PeeringPrefixStatus)(nil), (*networking.PeeringPrefixStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PeeringPrefixStatus_To_networking_PeeringPrefixStatus(a.(*v1alpha1.PeeringPrefixStatus), b.(*networking.PeeringPrefixStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*networking.PeeringPrefixStatus)(nil), (*v1alpha1.PeeringPrefixStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_networking_PeeringPrefixStatus_To_v1alpha1_PeeringPrefixStatus(a.(*networking.PeeringPrefixStatus), b.(*v1alpha1.PeeringPrefixStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*v1alpha1.PrefixSource)(nil), (*networking.PrefixSource)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_PrefixSource_To_networking_PrefixSource(a.(*v1alpha1.PrefixSource), b.(*networking.PrefixSource), scope) }); err != nil { @@ -1100,6 +1120,7 @@ func autoConvert_v1alpha1_NetworkPeering_To_networking_NetworkPeering(in *v1alph if err := Convert_v1alpha1_NetworkPeeringNetworkRef_To_networking_NetworkPeeringNetworkRef(&in.NetworkRef, &out.NetworkRef, s); err != nil { return err } + out.Prefixes = *(*[]networking.PeeringPrefix)(unsafe.Pointer(&in.Prefixes)) return nil } @@ -1113,6 +1134,7 @@ func autoConvert_networking_NetworkPeering_To_v1alpha1_NetworkPeering(in *networ if err := Convert_networking_NetworkPeeringNetworkRef_To_v1alpha1_NetworkPeeringNetworkRef(&in.NetworkRef, &out.NetworkRef, s); err != nil { return err } + out.Prefixes = *(*[]v1alpha1.PeeringPrefix)(unsafe.Pointer(&in.Prefixes)) return nil } @@ -1170,6 +1192,7 @@ func Convert_networking_NetworkPeeringNetworkRef_To_v1alpha1_NetworkPeeringNetwo func autoConvert_v1alpha1_NetworkPeeringStatus_To_networking_NetworkPeeringStatus(in *v1alpha1.NetworkPeeringStatus, out *networking.NetworkPeeringStatus, s conversion.Scope) error { out.Name = in.Name out.State = networking.NetworkPeeringState(in.State) + out.Prefixes = *(*[]networking.PeeringPrefixStatus)(unsafe.Pointer(&in.Prefixes)) return nil } @@ -1181,6 +1204,7 @@ func Convert_v1alpha1_NetworkPeeringStatus_To_networking_NetworkPeeringStatus(in func autoConvert_networking_NetworkPeeringStatus_To_v1alpha1_NetworkPeeringStatus(in *networking.NetworkPeeringStatus, out *v1alpha1.NetworkPeeringStatus, s conversion.Scope) error { out.Name = in.Name out.State = v1alpha1.NetworkPeeringState(in.State) + out.Prefixes = *(*[]v1alpha1.PeeringPrefixStatus)(unsafe.Pointer(&in.Prefixes)) return nil } @@ -1457,6 +1481,52 @@ func Convert_networking_NetworkStatus_To_v1alpha1_NetworkStatus(in *networking.N return autoConvert_networking_NetworkStatus_To_v1alpha1_NetworkStatus(in, out, s) } +func autoConvert_v1alpha1_PeeringPrefix_To_networking_PeeringPrefix(in *v1alpha1.PeeringPrefix, out *networking.PeeringPrefix, s conversion.Scope) error { + out.Name = in.Name + out.Prefix = (*commonv1alpha1.IPPrefix)(unsafe.Pointer(in.Prefix)) + out.PrefixRef = in.PrefixRef + return nil +} + +// Convert_v1alpha1_PeeringPrefix_To_networking_PeeringPrefix is an autogenerated conversion function. +func Convert_v1alpha1_PeeringPrefix_To_networking_PeeringPrefix(in *v1alpha1.PeeringPrefix, out *networking.PeeringPrefix, s conversion.Scope) error { + return autoConvert_v1alpha1_PeeringPrefix_To_networking_PeeringPrefix(in, out, s) +} + +func autoConvert_networking_PeeringPrefix_To_v1alpha1_PeeringPrefix(in *networking.PeeringPrefix, out *v1alpha1.PeeringPrefix, s conversion.Scope) error { + out.Name = in.Name + out.Prefix = (*commonv1alpha1.IPPrefix)(unsafe.Pointer(in.Prefix)) + out.PrefixRef = in.PrefixRef + return nil +} + +// Convert_networking_PeeringPrefix_To_v1alpha1_PeeringPrefix is an autogenerated conversion function. +func Convert_networking_PeeringPrefix_To_v1alpha1_PeeringPrefix(in *networking.PeeringPrefix, out *v1alpha1.PeeringPrefix, s conversion.Scope) error { + return autoConvert_networking_PeeringPrefix_To_v1alpha1_PeeringPrefix(in, out, s) +} + +func autoConvert_v1alpha1_PeeringPrefixStatus_To_networking_PeeringPrefixStatus(in *v1alpha1.PeeringPrefixStatus, out *networking.PeeringPrefixStatus, s conversion.Scope) error { + out.Name = in.Name + out.Prefix = (*commonv1alpha1.IPPrefix)(unsafe.Pointer(in.Prefix)) + return nil +} + +// Convert_v1alpha1_PeeringPrefixStatus_To_networking_PeeringPrefixStatus is an autogenerated conversion function. +func Convert_v1alpha1_PeeringPrefixStatus_To_networking_PeeringPrefixStatus(in *v1alpha1.PeeringPrefixStatus, out *networking.PeeringPrefixStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_PeeringPrefixStatus_To_networking_PeeringPrefixStatus(in, out, s) +} + +func autoConvert_networking_PeeringPrefixStatus_To_v1alpha1_PeeringPrefixStatus(in *networking.PeeringPrefixStatus, out *v1alpha1.PeeringPrefixStatus, s conversion.Scope) error { + out.Name = in.Name + out.Prefix = (*commonv1alpha1.IPPrefix)(unsafe.Pointer(in.Prefix)) + return nil +} + +// Convert_networking_PeeringPrefixStatus_To_v1alpha1_PeeringPrefixStatus is an autogenerated conversion function. +func Convert_networking_PeeringPrefixStatus_To_v1alpha1_PeeringPrefixStatus(in *networking.PeeringPrefixStatus, out *v1alpha1.PeeringPrefixStatus, s conversion.Scope) error { + return autoConvert_networking_PeeringPrefixStatus_To_v1alpha1_PeeringPrefixStatus(in, out, s) +} + func autoConvert_v1alpha1_PrefixSource_To_networking_PrefixSource(in *v1alpha1.PrefixSource, out *networking.PrefixSource, s conversion.Scope) error { out.Value = (*commonv1alpha1.IPPrefix)(unsafe.Pointer(in.Value)) out.Ephemeral = (*networking.EphemeralPrefixSource)(unsafe.Pointer(in.Ephemeral)) diff --git a/internal/apis/networking/validation/network.go b/internal/apis/networking/validation/network.go index 9631d40b7..693266ffe 100644 --- a/internal/apis/networking/validation/network.go +++ b/internal/apis/networking/validation/network.go @@ -28,6 +28,9 @@ func validateNetworkSpec(namespace, name string, spec *networking.NetworkSpec, f seenNames := sets.New[string]() seenPeeringNetworkKeys := sets.New[client.ObjectKey]() + seenPrefixNames := sets.New[string]() + seenPeeringPrefixKeys := sets.New[client.ObjectKey]() + for i, peering := range spec.Peerings { fldPath := fldPath.Child("peerings").Index(i) if seenNames.Has(peering.Name) { @@ -51,6 +54,32 @@ func validateNetworkSpec(namespace, name string, spec *networking.NetworkSpec, f seenPeeringNetworkKeys.Insert(peeringNetworkKey) } + for j, prefix := range peering.Prefixes { + fldPath := fldPath.Child("prefixes").Index(j) + + if seenPrefixNames.Has(prefix.Name) { + allErrs = append(allErrs, field.Duplicate(fldPath.Child("name"), prefix.Name)) + } else { + seenPrefixNames.Insert(prefix.Name) + } + + if peeringPrefix := prefix.Prefix; peeringPrefix != nil { + if !peeringPrefix.IsSingleIP() { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("prefix"), "must be a single IP")) + } + } + + peeringPrefixKey := client.ObjectKey{Namespace: namespace, Name: prefix.PrefixRef.Name} + + if seenPeeringPrefixKeys.Has(peeringPrefixKey) { + allErrs = append(allErrs, field.Duplicate(fldPath.Child("prefixRef"), prefix.PrefixRef)) + } else { + seenPeeringPrefixKeys.Insert(peeringPrefixKey) + } + + allErrs = append(allErrs, validatePeeringPrefix(prefix, fldPath)...) + } + allErrs = append(allErrs, validateNetworkPeering(peering, fldPath)...) } @@ -116,6 +145,20 @@ func validatePeeringClaimRef(peeringClaimRef networking.NetworkPeeringClaimRef, allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), peeringClaimRef.Namespace, msg)) } } + return allErrs +} + +func validatePeeringPrefix(prefix networking.PeeringPrefix, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + for _, msg := range apivalidation.NameIsDNSLabel(prefix.Name, false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), prefix.Name, msg)) + } + + prefixRef := prefix.PrefixRef + for _, msg := range apivalidation.NameIsDNSLabel(prefixRef.Name, false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("prefixRef", "name"), prefixRef.Name, msg)) + } return allErrs } diff --git a/internal/apis/networking/validation/network_test.go b/internal/apis/networking/validation/network_test.go index e9166bcb7..e20926872 100644 --- a/internal/apis/networking/validation/network_test.go +++ b/internal/apis/networking/validation/network_test.go @@ -4,11 +4,13 @@ package validation import ( + commonv1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" "github.com/ironcore-dev/ironcore/internal/apis/networking" . "github.com/ironcore-dev/ironcore/internal/testutils/validation" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/types" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -114,6 +116,44 @@ var _ = Describe("Network", func() { ContainElements(InvalidField("spec.incomingPeerings[0].namespace"), RequiredField("spec.incomingPeerings[0].name")), ), + Entry("duplicate peering prefix name", + &networking.Network{ + Spec: networking.NetworkSpec{ + Peerings: []networking.NetworkPeering{{ + Prefixes: []networking.PeeringPrefix{ + {Name: "peering"}, + {Name: "peering"}, + }}, + }, + }, + }, + ContainElement(DuplicateField("spec.peerings[0].prefixes[1].name")), + ), + Entry("bad peering prefix cidr", + &networking.Network{ + Spec: networking.NetworkSpec{ + Peerings: []networking.NetworkPeering{{ + Prefixes: []networking.PeeringPrefix{ + {Prefix: &commonv1alpha1.IPPrefix{}}, + }}, + }, + }, + }, + ContainElement(ForbiddenField("spec.peerings[0].prefixes[0].prefix")), + ), + Entry("duplicate peering prefix ref", + &networking.Network{ + Spec: networking.NetworkSpec{ + Peerings: []networking.NetworkPeering{{ + Prefixes: []networking.PeeringPrefix{ + {PrefixRef: corev1.LocalObjectReference{Name: "foo"}}, + {PrefixRef: corev1.LocalObjectReference{Name: "foo"}}, + }}, + }, + }, + }, + ContainElement(DuplicateField("spec.peerings[0].prefixes[1].prefixRef")), + ), ) DescribeTable("ValidateNetworkUpdate", diff --git a/internal/apis/networking/zz_generated.deepcopy.go b/internal/apis/networking/zz_generated.deepcopy.go index ba7bee4b3..fd14a5a62 100644 --- a/internal/apis/networking/zz_generated.deepcopy.go +++ b/internal/apis/networking/zz_generated.deepcopy.go @@ -705,6 +705,13 @@ func (in *NetworkList) DeepCopyObject() runtime.Object { func (in *NetworkPeering) DeepCopyInto(out *NetworkPeering) { *out = *in out.NetworkRef = in.NetworkRef + if in.Prefixes != nil { + in, out := &in.Prefixes, &out.Prefixes + *out = make([]PeeringPrefix, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -753,6 +760,13 @@ func (in *NetworkPeeringNetworkRef) DeepCopy() *NetworkPeeringNetworkRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkPeeringStatus) DeepCopyInto(out *NetworkPeeringStatus) { *out = *in + if in.Prefixes != nil { + in, out := &in.Prefixes, &out.Prefixes + *out = make([]PeeringPrefixStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -1022,7 +1036,9 @@ func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { if in.Peerings != nil { in, out := &in.Peerings, &out.Peerings *out = make([]NetworkPeering, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.PeeringClaimRefs != nil { in, out := &in.PeeringClaimRefs, &out.PeeringClaimRefs @@ -1048,7 +1064,9 @@ func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { if in.Peerings != nil { in, out := &in.Peerings, &out.Peerings *out = make([]NetworkPeeringStatus, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } @@ -1063,6 +1081,47 @@ func (in *NetworkStatus) DeepCopy() *NetworkStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeeringPrefix) DeepCopyInto(out *PeeringPrefix) { + *out = *in + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = (*in).DeepCopy() + } + out.PrefixRef = in.PrefixRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeeringPrefix. +func (in *PeeringPrefix) DeepCopy() *PeeringPrefix { + if in == nil { + return nil + } + out := new(PeeringPrefix) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeeringPrefixStatus) DeepCopyInto(out *PeeringPrefixStatus) { + *out = *in + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeeringPrefixStatus. +func (in *PeeringPrefixStatus) DeepCopy() *PeeringPrefixStatus { + if in == nil { + return nil + } + out := new(PeeringPrefixStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PrefixSource) DeepCopyInto(out *PrefixSource) { *out = *in