-
Notifications
You must be signed in to change notification settings - Fork 406
🌱 cache: moves common HTTP handlers to a shared pkg #1947
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
🌱 cache: moves common HTTP handlers to a shared pkg #1947
Conversation
pkg/server/config.go
Outdated
apiHandler = WithAcceptHeader(apiHandler) | ||
apiHandler = WithUserAgent(apiHandler) | ||
apiHandler = util.WithAcceptHeader(apiHandler) | ||
apiHandler = util.WithUserAgent(apiHandler) |
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.
am not convinced we want to share any of these with the cache server. Why should we?
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.
WithUserAgent
wasn't required also was able to get rid of WithAcceptHeader
/hold Wrong direction. We should not share the handler chain between kcp and the caching server. Why should we? |
@@ -184,19 +78,6 @@ func WithAuditAnnotation(handler http.Handler) http.HandlerFunc { | |||
}) | |||
} | |||
|
|||
// WithClusterAnnotation adds the cluster name into the annotation of an audit | |||
// event. Needs initialized annotations. | |||
func WithClusterAnnotation(handler http.Handler) http.HandlerFunc { |
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 needs a better name. WithAuditEventClusterAnnotation
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.
updated.
Those handlers are used by the kcp-server and the cache-server. Since we are going to run the cache from the kcp. Importing will cause a cycle. Thus common functionality is moved to a common package.
3da47f1
to
d7ad4b5
Compare
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d7ad4b5
to
9978144
Compare
New changes are detected. LGTM label has been removed. |
added |
Summary
It moves common HTTP handlers to a separate package.
Those handlers are used by the kcp-server and the cache-server.
Since we are going to run the cache from the kcp.
Importing will cause a cycle.
Thus common functionality is moved to a common package.
Related issue(s)
Fixes #