-
Notifications
You must be signed in to change notification settings - Fork 776
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
refactor: generated instrumented client code part 2 #5398
Conversation
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Codecov Report
@@ Coverage Diff @@
## main #5398 +/- ##
=======================================
Coverage 36.30% 36.30%
=======================================
Files 170 170
Lines 19072 19072
=======================================
Hits 6924 6924
Misses 11356 11356
Partials 792 792 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
When do we need to update this instrumented code? And how?
{{- $metricsPkg := Pkg "github.com/kyverno/kyverno/pkg/metrics" }} | ||
{{- $discoveryPkg := Pkg "k8s.io/client-go/discovery" }} | ||
{{- $restPkg := Pkg "k8s.io/client-go/rest" }} |
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.
Do we have restricted dependency on these folders? What do we need to keep in mind if we restructure the repo layout?
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.
What do you mean by restricted dependency ?
I wanted to avoid magic names so I added a func to resolve the import alias from a package path.
If the package path changes we will need to update them here.
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.
Let's say I update the client code on my fork repo, will it look for github.com/kyverno/kyverno/pkg/..
or github.com/<forked-repo>/kyverno/pkg/..
?
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 think so, this is a local package as per your go.mod
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.
So it will look for the forked path?
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.
Yes, why not ?
The go.mod
file in the forked repo says:
module github.com/kyverno/kyverno
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.
Thanks, wanted to confirm this.
|
Explanation
This PR refactors generated instrumented client code.
It adds a tracing aware wrapper.