Skip to content

Commit 1bb3611

Browse files
committed
Handles empty firewall rule description - BR-2812
1 parent c829232 commit 1bb3611

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Added
99
- `cb config-param list-supported` now returns `min_value`, `max_value`, and
1010
`enum` constraints for each parameters, if applicable.
11+
### Fixed
12+
- `cb info` now correctly handles firewall rules with an empty description.
1113

1214
## [3.6.0] - 2024-07-26
1315
### Added

spec/cb/firewall_rule_spec.cr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ Spectator.describe FirewallRuleList do
9696
}
9797

9898
it "outputs table with header" do
99+
expect(client).to receive(:get_firewall_rules).and_return [Factory.firewall_rule(description: nil)]
100+
99101
action.call
100102

101103
expected = <<-EXPECTED
102104
ID Rule Description
103-
shofthj3fzaipie44lt6a5i3de 1.2.3.0/24 Example Description
105+
shofthj3fzaipie44lt6a5i3de 1.2.3.0/24
104106
EXPECTED
105107

106108
expect(&.output.to_s).to look_like expected

src/models/firewall_rule.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module CB::Model
22
jrecord FirewallRule,
33
id : String,
4-
description : String,
4+
description : String?,
55
rule : String
66
end

0 commit comments

Comments
 (0)