mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-19 04:26:45 +00:00
refactor: meaningful error for complete block of Service external IPs
This commit is contained in:
@@ -25,6 +25,10 @@ func NewExternalServiceIPForbidden(allowedIps []v1alpha1.AllowedIP) error {
|
||||
}
|
||||
|
||||
func (e externalServiceIPForbidden) Error() string {
|
||||
if len(e.cidr) == 0 {
|
||||
return "The current Tenant does not allow the use of Service with external IPs"
|
||||
}
|
||||
|
||||
return fmt.Sprintf("The selected external IPs for the current Service are violating the following enforced CIDRs: %s", strings.Join(e.cidr, ", "))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user