Skip to content

Commit

Permalink
Return firewall rules protocol as lower case as defined in swagger en…
Browse files Browse the repository at this point in the history
…um. (#513)
  • Loading branch information
Gerrit91 authored Mar 21, 2024
1 parent 144941a commit 8c61ecf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/metal-api/internal/service/v1/machine.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package v1

import (
"strings"
"time"

"github.com/metal-stack/metal-api/cmd/metal-api/internal/datastore"
Expand Down Expand Up @@ -528,7 +529,7 @@ func NewMachineResponse(m *metal.Machine, s *metal.Size, p *metal.Partition, i *
for _, r := range m.Allocation.FirewallRules.Egress {
r := r
egressRules = append(egressRules, FirewallEgressRule{
Protocol: string(r.Protocol),
Protocol: strings.ToLower(string(r.Protocol)),
Ports: r.Ports,
To: r.To,
Comment: r.Comment,
Expand All @@ -537,7 +538,7 @@ func NewMachineResponse(m *metal.Machine, s *metal.Size, p *metal.Partition, i *
for _, r := range m.Allocation.FirewallRules.Ingress {
r := r
ingressRules = append(ingressRules, FirewallIngressRule{
Protocol: string(r.Protocol),
Protocol: strings.ToLower(string(r.Protocol)),
Ports: r.Ports,
To: r.To,
From: r.From,
Expand Down

0 comments on commit 8c61ecf

Please sign in to comment.