Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add network peering prefixes types and its validation #1078

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/networking/v1alpha1/network_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 (
Expand Down
63 changes: 61 additions & 2 deletions api/networking/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions client-go/applyconfigurations/internal/internal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading