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

Introduce xdscache package to handle xds cache resources #2949

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

stevesloka
Copy link
Member

Fixes #2939

Signed-off-by: Steve Sloka slokas@vmware.com

@stevesloka stevesloka added this to the 1.9.0 milestone Sep 29, 2020
@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #2949 into main will decrease coverage by 1.30%.
The diff coverage is 83.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2949      +/-   ##
==========================================
- Coverage   76.45%   75.14%   -1.31%     
==========================================
  Files          74       87      +13     
  Lines        5806     5678     -128     
==========================================
- Hits         4439     4267     -172     
- Misses       1272     1317      +45     
+ Partials       95       94       -1     
Impacted Files Coverage Δ
cmd/contour/certgen.go 29.72% <0.00%> (-2.22%) ⬇️
cmd/contour/cli.go 0.00% <0.00%> (ø)
cmd/contour/contour.go 0.00% <0.00%> (-4.23%) ⬇️
cmd/contour/leadership.go 0.00% <0.00%> (ø)
internal/annotation/annotations.go 100.00% <ø> (ø)
internal/build/version.go 0.00% <ø> (ø)
internal/contour/observer.go 0.00% <0.00%> (ø)
internal/envoy/route.go 86.36% <ø> (-12.03%) ⬇️
internal/envoy/v2/endpoint.go 100.00% <ø> (ø)
internal/envoy/v2/socket.go 100.00% <ø> (ø)
... and 129 more

Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looking at this again, mostly LGTM, but there are a few types that I don't think really belong under an internal/xdscache package - I think it'd make sense to leave them in internal/contour for now and we can decide if they should move somewhere else separately.


dnsLookupFamily, err := ParseDNSLookupFamily(ctx.DNSLookupFamily)
if err != nil {
return fmt.Errorf("failed to configure configuration file parameter cluster.dns-lookup-family: %w", err)
}

// Build the core Kubernetes event handler.
eventHandler := &contour.EventHandler{
eventHandler := &xdscache.EventHandler{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably leave the EventHandler type in the internal/contour package, not sure it makes sense under xdscache.

@@ -339,7 +339,7 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
// Wrap eventHandler in a converter for objects from the dynamic client.
// and an EventRecorder which tracks API server events.
dynamicHandler := &k8s.DynamicClientHandler{
Next: &contour.EventRecorder{
Next: &xdscache.EventRecorder{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EventRecorder seems like another one that should probably stay where it is.

@@ -444,7 +444,7 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {

// Once we have the leadership detection channel, we can
// push DAG rebuild metrics onto the observer stack.
eventHandler.Observer = &contour.RebuildMetricsObserver{
eventHandler.Observer = &xdscache.RebuildMetricsObserver{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RebuildMetricsObserver - keep in internal/contour?

Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skriss
Copy link
Member

skriss commented Sep 29, 2020

Probably should update the commit msg/PR title since the whole package isn't being renamed.

…rnal/contour package into.

Fixes projectcontour#2939

Signed-off-by: Steve Sloka <slokas@vmware.com>
@stevesloka stevesloka changed the title Renames the internal/contour package to internal/xdscache. Introduce xdscache package to handle xds cache resources Sep 29, 2020
@stevesloka stevesloka merged commit 53ddcc6 into projectcontour:main Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

internal: consider renaming internal/contour/v2 to something more descriptive
2 participants