Add Interface property in the API

This is needed in order to uniquely identify allocations
for pods with multiple interfaces. These allocations have
the same podRef.

Signed-off-by: Marcelo Guerrero <marguerr@redhat.com>
This commit is contained in:
Marcelo Guerrero 2024-05-10 16:05:39 +02:00
parent c06227d4a2
commit 420dc524d6
4 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,8 @@ spec:
properties:
id:
type: string
ifname:
type: string
podref:
type: string
required:

View File

@ -43,10 +43,11 @@ spec:
properties:
containerid:
type: string
ifname:
type: string
podref:
type: string
required:
- containerid
- podref
type: object
required:

View File

@ -24,6 +24,7 @@ func (i IPPool) ParseCIDR() (net.IP, *net.IPNet, error) {
type IPAllocation struct {
ContainerID string `json:"id"`
PodRef string `json:"podref"`
IfName string `json:"ifname,omitempty"`
}
// +genclient

View File

@ -4,8 +4,9 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// OverlappingRangeIPReservationSpec defines the desired state of OverlappingRangeIPReservation
type OverlappingRangeIPReservationSpec struct {
ContainerID string `json:"containerid"`
ContainerID string `json:"containerid,omitempty"`
PodRef string `json:"podref"`
IfName string `json:"ifname,omitempty"`
}
// +genclient