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

Replace node sync service with stream delegates #1658

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/core_monitoring_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ var _ = Describe("Monitoring Controller", Ordered, Label("controller", "slow"),
HaveReplicaCount(1),
HaveMatchingContainer(And(
HaveName("grafana"),
HaveImage("grafana/grafana:latest"),
HaveImage("grafana/grafana:10.1.1"),
)),
))
})
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ require (
github.com/kralicky/gpkg v0.0.0-20220311205216-0d8ea9557555
github.com/kralicky/kmatch v0.0.0-20230301203314-20f658a0e56c
github.com/kralicky/ragu v1.0.11-0.20230627162951-2dd00e0cbbf3
github.com/kralicky/totem v1.2.0
github.com/kralicky/totem v1.2.1
github.com/kralicky/yaml/v3 v3.0.0-20220520012407-b0e7050bd81d
github.com/lestrrat-go/backoff/v2 v2.0.8
github.com/lestrrat-go/jwx v1.2.26
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1644,8 +1644,8 @@ github.com/kralicky/kmatch v0.0.0-20230301203314-20f658a0e56c h1:1kKbyl5GtGk/D+6
github.com/kralicky/kmatch v0.0.0-20230301203314-20f658a0e56c/go.mod h1:GXnSgs1TGXa8aX1hO9SUE1o3pLfggl5hkBMXdVWD8dc=
github.com/kralicky/ragu v1.0.11-0.20230627162951-2dd00e0cbbf3 h1:UB8Fk6c8Ait8DLtemgT/ItRdUpxJQHMDntqFopFt6/Q=
github.com/kralicky/ragu v1.0.11-0.20230627162951-2dd00e0cbbf3/go.mod h1:njQGnwU5IHm4Qx6/oOY0ll7Z6WA0apfP0ClpVA0M27Q=
github.com/kralicky/totem v1.2.0 h1:3pZuqhLrCYVbaxskkvubEm65AC/mquDLRTUZYGUxEEY=
github.com/kralicky/totem v1.2.0/go.mod h1:DFlQM6o5n1AWrU/+wd3hjLKoKZ+a0TPRUQxnCQvGKyY=
github.com/kralicky/totem v1.2.1 h1:ayd+IHbmmWhgFXJfzTHg0mJ2mr/IYHCh/nDqYyd6yCk=
github.com/kralicky/totem v1.2.1/go.mod h1:DFlQM6o5n1AWrU/+wd3hjLKoKZ+a0TPRUQxnCQvGKyY=
github.com/kralicky/yaml/v3 v3.0.0-20220520012407-b0e7050bd81d h1:kLfaaFdmCHKZCvL4DzQ7T9YsAVSBqZez34zaegldkls=
github.com/kralicky/yaml/v3 v3.0.0-20220520012407-b0e7050bd81d/go.mod h1:z4cKsjE0B5RlhFSbWcZNh70UEjtwrj8fpG1QXyU2KuI=
github.com/kralicky/zap v1.24.1-0.20230718165024-a2256218e4cc h1:FhngWZAuozJDezZPFebEy8QPbf7tw3MRv07RN8RLcg0=
Expand Down
46 changes: 18 additions & 28 deletions pkg/apis/capability/v1/capability.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions pkg/apis/capability/v1/capability.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package capability;

import "github.com/kralicky/totem/extensions.proto";
import "github.com/rancher/opni/pkg/apis/core/v1/core.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
Expand Down Expand Up @@ -55,10 +54,6 @@ service Node {
}
}

service NodeManager {
rpc RequestSync(SyncRequest) returns (google.protobuf.Empty);
}

message Details {
string name = 1;
string source = 2;
Expand Down
90 changes: 0 additions & 90 deletions pkg/apis/capability/v1/capability_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions pkg/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (

bootstrapv1 "github.com/rancher/opni/pkg/apis/bootstrap/v1"
bootstrapv2 "github.com/rancher/opni/pkg/apis/bootstrap/v2"
capabilityv1 "github.com/rancher/opni/pkg/apis/capability/v1"
controlv1 "github.com/rancher/opni/pkg/apis/control/v1"
corev1 "github.com/rancher/opni/pkg/apis/core/v1"
streamv1 "github.com/rancher/opni/pkg/apis/stream/v1"
Expand Down Expand Up @@ -66,7 +65,6 @@ type Gateway struct {

storageBackend storage.Backend
capBackendStore capabilities.BackendStore
syncRequester *SyncRequester
}

type GatewayOptions struct {
Expand Down Expand Up @@ -270,10 +268,9 @@ func NewGateway(ctx context.Context, conf *config.GatewayConfig, pl plugins.Load
// set up stream server
listener := health.NewListener()
monitor := health.NewMonitor(health.WithLogger(lg.Named("monitor")))
sync := NewSyncRequester(lg)
delegate := NewDelegateServer(storageBackend, lg)
// set up agent connection handlers
agentHandler := MultiConnectionHandler(listener, sync, delegate)
agentHandler := MultiConnectionHandler(listener, delegate)

go monitor.Run(ctx, listener)
streamSvc := NewStreamServer(agentHandler, storageBackend, httpServer.metricsRegisterer, lg)
Expand Down Expand Up @@ -302,7 +299,6 @@ func NewGateway(ctx context.Context, conf *config.GatewayConfig, pl plugins.Load
httpServer: httpServer,
grpcServer: grpcServer,
statusQuerier: monitor,
syncRequester: sync,
}

waitctx.Go(ctx, func() {
Expand Down Expand Up @@ -367,11 +363,6 @@ func (g *Gateway) CapabilitiesStore() capabilities.BackendStore {
return g.capBackendStore
}

// Implements management.CapabilitiesDataSource
func (g *Gateway) NodeManagerServer() capabilityv1.NodeManagerServer {
return g.syncRequester
}

// Implements management.HealthStatusDataSource
func (g *Gateway) GetClusterHealthStatus(ref *corev1.Reference) (*corev1.HealthStatus, error) {
hs := g.statusQuerier.GetHealthStatus(ref.Id)
Expand Down
119 changes: 0 additions & 119 deletions pkg/gateway/sync.go

This file was deleted.

Loading