Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Network Map in Firewall list #328

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/firewall/firewall_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ Example: civo firewall ls -o custom -f "ID: Name"`,
os.Exit(1)
}

var networkMap map[string]string
networkMap := make(map[string]string, 0)
var network civogo.Network
for _, network = range networks {
networkMap = map[string]string{network.ID: network.Label}
networkMap[network.ID] = network.Label
}
ow := utility.NewOutputWriter()
for _, firewall := range firewalls {
Expand All @@ -62,7 +62,7 @@ Example: civo firewall ls -o custom -f "ID: Name"`,

ow.AppendDataWithLabel("id", firewall.ID, "ID")
ow.AppendDataWithLabel("name", firewall.Name, "Name")
ow.AppendDataWithLabel("network", networkMap[network.Label], "Network")
ow.AppendDataWithLabel("network", networkMap[network.ID], "Network")
ow.AppendDataWithLabel("rules_count", strconv.Itoa(firewall.RulesCount), "Total rules")
ow.AppendDataWithLabel("instances_count", strconv.Itoa(firewall.InstanceCount), "Total Instances")
ow.AppendDataWithLabel("clusters_count", strconv.Itoa(firewall.ClusterCount), "Total Clusters")
Expand Down