Skip to content

Commit 3a2dbec

Browse files
committed
Update Comment & more descriptive func name
1 parent b7ff8a5 commit 3a2dbec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api/v1beta3/cloudstackisolatednetwork_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type CloudStackIsolatedNetworkStatus struct {
7373
// Empty value means the network mode is NATTED, not ROUTED.
7474
RoutingMode string `json:"routingMode,omitempty"`
7575

76-
// Firewall rules open status.
76+
// Indicates whether the necessary firewall egress and routing rules for the isolated network have been applied successfully.
7777
FirewallRulesOpened bool `json:"firewallRulesOpened,omitempty"`
7878

7979
// Ready indicates the readiness of this provider resource.

pkg/cloud/isolated_network.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (c *client) createFirewallRule(isoNet *infrav1.CloudStackIsolatedNetwork, p
265265
p.SetIcmpcode(-1)
266266
}
267267
_, err := c.cs.Firewall.CreateRoutingFirewallRule(p)
268-
if err != nil && !c.isIgnorableError(err) {
268+
if err != nil && !c.isIgnorableFirewallRuleError(err) {
269269
return errors.Wrapf(err, "failed creating routing firewall rule for network ID %s protocol %s", isoNet.Spec.ID, proto)
270270
}
271271
return nil
@@ -278,7 +278,7 @@ func (c *client) createFirewallRule(isoNet *infrav1.CloudStackIsolatedNetwork, p
278278
p.SetIcmpcode(-1)
279279
}
280280
_, err := c.cs.Firewall.CreateEgressFirewallRule(p)
281-
if err != nil && !c.isIgnorableError(err) {
281+
if err != nil && !c.isIgnorableFirewallRuleError(err) {
282282
return errors.Wrapf(err, "failed creating egress firewall rule for network ID %s protocol %s", isoNet.Spec.ID, proto)
283283
}
284284
return nil
@@ -292,7 +292,7 @@ const (
292292
)
293293

294294
// Helper function to check if an error is ignorable
295-
func (c *client) isIgnorableError(err error) bool {
295+
func (c *client) isIgnorableFirewallRuleError(err error) bool {
296296
errorMsg := strings.ToLower(err.Error())
297297
return strings.Contains(errorMsg, ErrAlreadyExists) ||
298298
strings.Contains(errorMsg, ErrRuleConflict) ||

0 commit comments

Comments
 (0)