-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ignore setSelfLink errors #1049
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
ignore setSelfLink errors #1049
Conversation
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.
SetSelfLink should return a specific error we can test against - this approach breaks the runtime.SelfLinker abstraction.
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.
More like this?
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.
I mean runtime.HasSelfLink is not something that should exist. namer.SetSelfLink calls the appropriate accessor - the source methods that implement that should return an appropriate ErrNoSelfLink
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, so before setting the SelfLink, the name is built. Building that name requires retrieving name and namespace. ResourceAccessReview has neither of those fields. Right now, that get attempt calls Accessor() which produces an error. That causes a failure before any attempt to SetSelfLink.
The godoc for Accessor() (https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/meta/meta.go#L33) suggests that the failures I see about missing fields are intended and intentional.
That means that unless we change Accessor's contract to not fail like that, we aren't going to be guaranteed to ever see the error we want because we'll fail when doing thinks like getting names and namespaces.
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.
----- Original Message -----
@@ -328,6 +328,11 @@ func finishRequest(timeout time.Duration, fn
resultFunc) (result runtime.Object,
// setSelfLink sets the self link of an object (or the child items in a
list) to the base URL of the request
// plus the path and query generated by the provided linkFunc
func setSelfLink(obj runtime.Object, req *restful.Request, namer
ScopeNamer) error {
- // if the object doesn't have a selfLink, no-op
- if !runtime.HasSelfLink(obj) {
Ok, so before setting the SelfLink, the name is built. Building that name
requires retrieving name and namespace. ResourceAccessReview has neither of
those fields. Right now, that get attempt callsAccessor()which
produces an error. That causes a failure before any attempt to SetSelfLink.The godoc for
Accessor()
(https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/meta/meta.go#L33)
suggests that the failures I see about missing fields are intended and
intentional.That means that unless we change
Accessor's contract to not fail like that,
we aren't going to be guaranteed to ever see the error we want because we'll
fail when doing thinks like getting names and namespaces.
Accessor should return a typed known error that clients can choose to ignore.
Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/1049/files#r24848688
6973c9f to
51ed527
Compare
|
changed to ignore the failures and log |
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.
... inside setSelfLink
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.
... inside setSelfLink
"And I must have blue window treatments with purple polkadots on my condemned house...."
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.
I meant mutilate in the loosest possible sense :)
----- Original Message -----
@@ -69,8 +70,7 @@ func GetResource(r RESTGetter, ctxFn ContextFunc, namer
ScopeNamer, codec runtim
return
}
if err := setSelfLink(result, req, namer); err != nil {
errorJSON(err, codec, w)returnglog.Errorf("failure while setting SelfLink: %v", err)... inside setSelfLink
"And I must have blue window treatments with purple polkadots on my condemned
house...."
Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/1049/files#r24853961
51ed527 to
e7f867e
Compare
|
I'm now at the point where having tea party with a stuffed cow is preferable to touching this again... |
|
Don't hate on stuffed cows. |
|
LGTM [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/946/) (Image: devenv-fedora_818) |
|
Evaluated for origin up to e7f867e |
Merged by openshift-bot
|
This spams the logs horribly. And makes you think the system is not stable. We should not be logging at such a high level if its normal allowed behavior. |
|
But we must not mutilate throw away code. Our throw away patches must be perfect snowflakes. I know, let's detect if we can set a self link before we attempt it and avoid trying. That way, we can avoid spamming the log, but still see all the expected message when we get actual failures. |
|
To put another way, if its not an actual error for us right now in OpenShift, since we swallow it, then we should not log an error to the log. |
|
Oh, missed that in the review. This should be logged at V(4) / V(5). |
…service-catalog/' changes from 568a7b9..8f07b7b 8f07b7b origin: add required patches ee57bfb Cleanup of ups broker example + making controller follow the OSB API (openshift#807) 45a11ed Revert "Rename our resources to have ServiceCatalog prefix (openshift#1054)" (openshift#1061) 4e47ec1 Rename our resources to have ServiceCatalog prefix (openshift#1054) 2bb334a Rebase on 1.7 API machinery (openshift#944) 5780b59 Run broker reconciler when spec is changed. (openshift#1026) 9c22d04 Merge branch 'pr/1006' d077915 check number of expected events before dereferencing to avoid panic (openshift#1052) 90d615f Merge branch 'pr/1055' bb6d6d8 fix log output to use formatted output (openshift#1056) c7abc81 Adding examples to the README ccc93c9 Remove different-org rule for LGTM (openshift#1050) be04cd5 Allow for a period in the GUID of the External ID (openshift#1034) 8c246df Make it so that binding.spec.secretName defaults to binding name (openshift#851) 6745418 Bump OSB Client (openshift#1049) 8346a0d apiserver etcd healthcheck as suggested to address k/k#48215 (openshift#1039) 11d0d4a use GKE's latest 1.6.X cluster version for Jenkins (openshift#1036) 7d71b5b Cross-build all the things! 8ec0874 RBAC setup behind the aggregator. (openshift#936) 0864a2e Upsert retry loop for Secret, set/check ownerReference for Secret owned by Binding (openshift#979) 6be9886 add info about weekly calls (openshift#1027) a242b26 add OSB API Header version flag (openshift#1014) 66e2ce6 Update REVIEWING doc with changes to LGTM process (openshift#1016) 699e016 Writing the returned progress description from the broker (openshift#998) 02642f4 Adding target to test on the host (openshift#1020) 78ca572 v0.0.13 (openshift#1024) 9e79ec2 use GKE's default K8S version for Jenkins (openshift#1023) d3c915a Fix curl on API server start error (openshift#1015) b50be75 Merge branch 'pr/1013' 2c98ba1 Using tag URLs 687f091 Parameterizing the priority fields 34ed5cd update apiregistration yaml to v1.7 final (openshift#1011) 91fa1ad make e2e look for pods' existence before checking status (openshift#1012) 0f90705 explicitly disable leader election if it is not enabled (openshift#965) f5761e7 controller-manager health checks (openshift#694) da260f2 Add logging for normal Unbind errors (openshift#992) 4c916a5 make the apiserver test use tls (openshift#991) 1a62ecc refactor reconcileBroker (openshift#986) cc179bc Add logging for normal Bind errors (openshift#993) a1458dd add parameterization for user-broker image to e2e tests (openshift#995) fb15891 Bump OSB client (openshift#1000) 79d5206 v0.0.12 (openshift#996) 39c7407 Merge branch 'pr/975' a553b2d Merge branch 'pr/974' d573339 reconcileBinding error checking (openshift#973) 39a1061 Making events and actions checks generic (openshift#960) 73136a4 Bump osb client (openshift#971) 878a987 reconcileInstance error checking in unit-tests 4991d57 reconcileBroker error checking in unit-tests 9ed6812 Extract methods for binding test setup (openshift#961) b69a1ee Make ups-broker return valid unbind response (openshift#964) 8b37d2f Releasing 0.0.11 (openshift#962) 52fec8b Merge branch 'pr/954' d49cdeb Swap client 445fa71 Add dependency on pmorie/go-open-service-broker-client 9f743b2 Instructions for enabling API Aggregation (openshift#895) 512508d Use correct infof calls in controller_manager (openshift#950) 77943ba fix regex that determines if a tag is deployable (openshift#947) 8a226b8 Updates for v0.0.10 release (openshift#943) REVERT: 568a7b9 origin build: add origin tooling git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog git-subtree-split: 8f07b7bbf3acb2b557f23596a92b5e775ae9321c
* Bump OSB Client (version: 8811635fed0170d82bfc1c3d4d7fbd5a01ae45ed) This update includes a modified IsHTTPError function that returns the error code. * Make changes required for new OSB Client Basically, correctly use the modified IsHTTPError function.
We think this is fixed in upstream, but it doesn't patch in cleanly, so we'll ignore the setSelfLink errors for now so that we can continue with other features.
The failure breaks *AccessReview and blocks list projects.
@smarterclayton ptal
/cc @derekwaynecarr