Skip to content

Commit

Permalink
No addressfamilies in response
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Jan 24, 2025
1 parent 26a9b5e commit d3610e8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion cmd/metal-api/internal/metal/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ type Network struct {
Underlay bool `rethinkdb:"underlay" json:"underlay"`
Shared bool `rethinkdb:"shared" json:"shared"`
Labels map[string]string `rethinkdb:"labels" json:"labels"`
AddressFamilies AddressFamilies `rethinkdb:"addressfamily" json:"addressfamily"`
AddressFamilies AddressFamilies `rethinkdb:"addressfamilies" json:"addressfamilies"`
AdditionalAnnouncableCIDRs []string `rethinkdb:"additionalannouncablecidrs" json:"additionalannouncablecidrs" description:"list of cidrs which are added to the route maps per tenant private network, these are typically pod- and service cidrs, can only be set in a supernetwork"`
}

Expand Down
1 change: 0 additions & 1 deletion cmd/metal-api/internal/service/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ func createTestEnvironment(t *testing.T, log *slog.Logger, ds *datastore.Rethink
Prefixes: []string{testPrivateSuperCidr},
PrivateSuper: true,
DefaultChildPrefixLength: map[metal.AddressFamily]uint8{metal.IPv4AddressFamily: 22},
AddressFamilies: metal.AddressFamilies{metal.IPv4AddressFamily},
},
}
log.Info("try to create a network", "request", ncr)
Expand Down
7 changes: 0 additions & 7 deletions cmd/metal-api/internal/service/v1/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type NetworkImmutable struct {
Vrf *uint `json:"vrf" description:"the vrf this network is associated with" optional:"true"`
VrfShared *bool `json:"vrfshared" description:"if set to true, given vrf can be used by multiple networks, which is sometimes useful for network partitioning (default: false)" optional:"true"`
ParentNetworkID *string `json:"parentnetworkid" description:"the id of the parent network" optional:"true"`
AddressFamilies metal.AddressFamilies `json:"addressfamilies" description:"the addressfamilies in this network, either IPv4 or IPv6 or both"`
AdditionalAnnouncableCIDRs []string `json:"additionalAnnouncableCIDRs,omitempty" description:"list of cidrs which are added to the route maps per tenant private network, these are typically pod- and service cidrs, can only be set for private super networks"`
}

Expand Down Expand Up @@ -107,11 +106,6 @@ func NewNetworkResponse(network *metal.Network, usage *metal.NetworkUsage) *Netw
labels = make(map[string]string)
}

// Existing tenant networks where not migrated and get AF created here
if len(network.AddressFamilies) == 0 {
network.AddressFamilies = metal.AddressFamilies{metal.IPv4AddressFamily}
}

for _, af := range network.AddressFamilies {
if af == metal.IPv4AddressFamily {
usagev4 = &NetworkUsage{
Expand Down Expand Up @@ -156,7 +150,6 @@ func NewNetworkResponse(network *metal.Network, usage *metal.NetworkUsage) *Netw
Underlay: network.Underlay,
Vrf: &network.Vrf,
ParentNetworkID: parentNetworkID,
AddressFamilies: network.AddressFamilies,
AdditionalAnnouncableCIDRs: network.AdditionalAnnouncableCIDRs,
},
Consumption: NetworkConsumption{},
Expand Down
24 changes: 0 additions & 24 deletions spec/metal-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3801,13 +3801,6 @@
},
"type": "array"
},
"addressfamilies": {
"description": "the addressfamilies in this network, either IPv4 or IPv6 or both",
"items": {
"type": "string"
},
"type": "array"
},
"defaultchildprefixlength": {
"additionalProperties": {
"type": "integer"
Expand Down Expand Up @@ -3887,7 +3880,6 @@
}
},
"required": [
"addressfamilies",
"destinationprefixes",
"id",
"nat",
Expand Down Expand Up @@ -3963,13 +3955,6 @@
},
"type": "array"
},
"addressfamilies": {
"description": "the addressfamilies in this network, either IPv4 or IPv6 or both",
"items": {
"type": "string"
},
"type": "array"
},
"defaultchildprefixlength": {
"additionalProperties": {
"type": "integer"
Expand Down Expand Up @@ -4018,7 +4003,6 @@
}
},
"required": [
"addressfamilies",
"destinationprefixes",
"nat",
"prefixes",
Expand All @@ -4035,13 +4019,6 @@
},
"type": "array"
},
"addressfamilies": {
"description": "the addressfamilies in this network, either IPv4 or IPv6 or both",
"items": {
"type": "string"
},
"type": "array"
},
"changed": {
"description": "the last changed timestamp of this entity",
"format": "date-time",
Expand Down Expand Up @@ -4141,7 +4118,6 @@
}
},
"required": [
"addressfamilies",
"consumption",
"destinationprefixes",
"id",
Expand Down

0 comments on commit d3610e8

Please sign in to comment.