Skip to content

Commit

Permalink
Enhance LoadBalancerRouting destinations (#792)
Browse files Browse the repository at this point in the history
The destinations will now only carry the target IP and optionally, if
available, a reference to the target presenting that information
(only network interface for now).

Adapt tests, documentation and openapi.
  • Loading branch information
adracus authored Jul 20, 2023
1 parent ec71666 commit 0fff442
Show file tree
Hide file tree
Showing 26 changed files with 1,132 additions and 133 deletions.
21 changes: 20 additions & 1 deletion api/networking/v1alpha1/loadbalancerrouting_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
commonv1alpha1 "github.com/onmetal/onmetal-api/api/common/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)

// +genclient
Expand All @@ -33,7 +34,25 @@ type LoadBalancerRouting struct {
NetworkRef commonv1alpha1.LocalUIDReference `json:"networkRef"`

// Destinations are the destinations for an LoadBalancer.
Destinations []commonv1alpha1.LocalUIDReference `json:"destinations"`
Destinations []LoadBalancerDestination `json:"destinations"`
}

// LoadBalancerDestination is the destination of the load balancer.
type LoadBalancerDestination struct {
// IP is the target IP.
IP commonv1alpha1.IP `json:"ip"`
// TargetRef is the target providing the destination.
TargetRef *LoadBalancerTargetRef `json:"targetRef,omitempty"`
}

// LoadBalancerTargetRef is a load balancer target.
type LoadBalancerTargetRef struct {
// UID is the UID of the target.
UID types.UID `json:"uid"`
// Name is the name of the target.
Name string `json:"name"`
// ProviderID is the provider internal id of the target.
ProviderID string `json:"providerID"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
44 changes: 42 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.

27 changes: 26 additions & 1 deletion 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.

4 changes: 4 additions & 0 deletions client-go/applyconfigurations/utils.go

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

Loading

0 comments on commit 0fff442

Please sign in to comment.