-
Notifications
You must be signed in to change notification settings - Fork 351
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 wrapping errors #2492
Fix wrapping errors #2492
Conversation
Signed-off-by: Mustafa Abdelrahman <[email protected]>
Signed-off-by: Mustafa Abdelrahman <[email protected]>
@@ -101,15 +101,10 @@ func ValidateIngressesV1(ingressList IngressV1List) error { | |||
name := i.Metadata.Name | |||
namespace := i.Metadata.Namespace | |||
nerr = fmt.Errorf("%s/%s: %w", name, namespace, nerr) | |||
err = errors.Wrap(err, nerr.Error()) | |||
err = errorsJoin(err, nerr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets update // ValidateIngresses is a no-op
comment as its definitely not a no-op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually no-op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ValidateIngressV1
always return nil
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but this ValidateIngressesV1
does not have to assume it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also should collect errors in a slice first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the comment to // ValidateIngressesV1 validates an IngressV1List
or simply remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be resolved
Changed |
Also created sarslanhan/cronmask#2 |
Created sarslanhan/cronmask#3 |
Signed-off-by: Mustafa Abdelrahman <[email protected]>
dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.json
Show resolved
Hide resolved
Signed-off-by: Mustafa Abdelrahman <[email protected]>
dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Mustafa Abdelrahman <[email protected]>
b9558a3
to
e7342ee
Compare
Signed-off-by: Alexander Yastrebov <[email protected]>
Signed-off-by: Mustafa Abdelrahman <[email protected]>
@@ -99,6 +98,7 @@ require ( | |||
github.com/opencontainers/go-digest v1.0.0 // indirect | |||
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect | |||
github.com/opencontainers/runc v1.1.5 // indirect | |||
github.com/pkg/errors v0.9.1 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 |
👍 |
check https://pkg.go.dev/errors#Join follow up on #2492 Signed-off-by: Mustafa Abdelrahman <[email protected]>
check https://pkg.go.dev/errors#Join follow up on #2492 Signed-off-by: Mustafa Abdelrahman <[email protected]>
Updates #2488
For #2484
err = errors.Wrap(err, nerr.Error())
also seems wrong as if error isnil
it returnsnil
Running
go mod tidy
won't removegithub.com/pkg/errors
ascron
predicate uses https://pkg.go.dev/github.com/sarslanhan/cronmask which uses it (fixed with sarslanhan/cronmask#3) and nowgithub.com/uber/jaeger-client-go/config
, maybe will create a PR there to remove it.