Skip to content

Commit

Permalink
Fix firewall rule description
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Huber authored and fhofherr committed Aug 5, 2021
1 parent e3eca12 commit e951e99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions hcloud/schema.go
Expand Up @@ -759,6 +759,7 @@ func FirewallFromSchema(s schema.Firewall) *Firewall {
DestinationIPs: destinationIPs,
Protocol: FirewallRuleProtocol(rule.Protocol),
Port: rule.Port,
Description: rule.Description,
})
}
return f
Expand Down
6 changes: 5 additions & 1 deletion hcloud/schema_test.go
Expand Up @@ -2722,7 +2722,8 @@ func TestFirewallFromSchema(t *testing.T) {
"ff21:1eac:9a3b:ee58:5ca:990c:8bc9:c03b/128"
],
"protocol": "tcp",
"port": "80"
"port": "80",
"description": "allow http in"
}
],
"applied_to": [
Expand Down Expand Up @@ -2777,6 +2778,9 @@ func TestFirewallFromSchema(t *testing.T) {
if *firewall.Rules[0].Port != "80" {
t.Errorf("unexpected Rule Port: %s", *firewall.Rules[0].Port)
}
if *firewall.Rules[0].Description != "allow http in" {
t.Errorf("unexpected Rule Description: %s", *firewall.Rules[0].Description)
}
if len(firewall.AppliedTo) != 2 {
t.Errorf("unexpected UsedBy count: %d", len(firewall.AppliedTo))
}
Expand Down

0 comments on commit e951e99

Please sign in to comment.