Skip to content

Commit 27c531d

Browse files
fix(firewall): update SetDataType references to maintain consistency
1 parent 2dea974 commit 27c531d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

apis/networking/v1beta1/firewall/set_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type SetDataType string
2020

2121
// Possible SetDataType values.
2222
const (
23-
SetTypeIPAddr SetDataType = "ipv4_addr"
23+
SetDataTypeIPAddr SetDataType = "ipv4_addr"
2424
)
2525

2626
// Set represents a nftables set

pkg/firewall/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func getSetDataType(dataType *firewallapi.SetDataType) (nftables.SetDatatype, er
230230
}
231231

232232
switch *dataType {
233-
case firewallapi.SetTypeIPAddr:
233+
case firewallapi.SetDataTypeIPAddr:
234234
return nftables.TypeIPAddr, nil
235235
default:
236236
return nftables.SetDatatype{}, fmt.Errorf("unsupported set data type: %s", *dataType)

pkg/firewall/utils/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func ConvertSetData(data *string, dataType *firewallapi.SetDataType) ([]byte, er
3434
}
3535

3636
switch *dataType {
37-
case firewallapi.SetTypeIPAddr:
37+
case firewallapi.SetDataTypeIPAddr:
3838
ip := net.ParseIP(*data)
3939
if ip == nil {
4040
return nil, fmt.Errorf("set element has invalid IP value %s", *data)

pkg/webhooks/firewallconfiguration/match.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func checkMatchIPValue(mIP *firewallapi.MatchIP, sets []firewallapi.Set) error {
5757
return fmt.Errorf("named set %s does not exist", mIP.Value)
5858
}
5959

60-
if matchedSet.KeyType != firewallapi.SetTypeIPAddr {
60+
if matchedSet.KeyType != firewallapi.SetDataTypeIPAddr {
6161
return fmt.Errorf("named set %s is not of type IP", mIP.Value)
6262
}
6363
default:

0 commit comments

Comments
 (0)