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 error messages not shown properly in reconcile. #131

Merged
merged 2 commits into from
Nov 27, 2020
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions pkg/controller/infrastructure/actuator_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func createFirewall(ctx context.Context, r *firewallReconciler) error {

fcr, err := r.mclient.FirewallCreate(createRequest)
if err != nil {
r.logger.Error(err, "firewalls create")
r.logger.Error(err, "firewall create error")
return &controllererrors.RequeueAfterError{
Cause: errors.Wrap(err, "failed to create firewall"),
RequeueAfter: 30 * time.Second,
Expand Down Expand Up @@ -454,22 +454,22 @@ func reconcileEgressIPs(ctx context.Context, r *egressIPReconciler) error {

if len(resp.IPs) == 0 || len(resp.IPs) > 1 {
return &controllererrors.RequeueAfterError{
Cause: errors.Wrap(err, fmt.Sprintf("ip %s for egress rule is ambiguous", ip)),
Cause: fmt.Errorf("ip %s for egress rule is ambiguous", ip),
RequeueAfter: 30 * time.Second,
}
}

dbIP := resp.IPs[0]
if dbIP.Type != nil && *dbIP.Type != metalgo.IPTypeStatic {
return &controllererrors.RequeueAfterError{
Cause: errors.Wrap(err, fmt.Sprintf("ips for egress rule must be static, but %s is not static", ip)),
Cause: fmt.Errorf("ips for egress rule must be static, but %s is not static", ip),
RequeueAfter: 30 * time.Second,
}
}

if len(dbIP.Tags) > 0 {
return &controllererrors.RequeueAfterError{
Cause: errors.Wrap(err, fmt.Sprintf("won't use ip %s for egress rules because it does not have an egress tag but it has other tags", *dbIP.Ipaddress)),
Cause: fmt.Errorf("won't use ip %s for egress rules because it does not have an egress tag but it has other tags", *dbIP.Ipaddress),
RequeueAfter: 30 * time.Second,
}
}
Expand Down