diff --git a/backend/provisioner/service.go b/backend/provisioner/service.go index 02d3bb1749..f8789a94a8 100644 --- a/backend/provisioner/service.go +++ b/backend/provisioner/service.go @@ -41,7 +41,6 @@ func (c *Config) SetDefaults() { type Service struct { controllerClient ftlv1connect.ControllerServiceClient - schemaClient ftlv1connect.SchemaServiceClient currentResources *xsync.MapOf[string, *ResourceGraph] registry *ProvisionerRegistry } @@ -52,13 +51,11 @@ func New( ctx context.Context, config Config, controllerClient ftlv1connect.ControllerServiceClient, - schemaClient ftlv1connect.SchemaServiceClient, registry *ProvisionerRegistry, ) (*Service, error) { resourceMap := xsync.NewMapOf[string, *ResourceGraph]() return &Service{ controllerClient: controllerClient, - schemaClient: schemaClient, currentResources: resourceMap, registry: registry, }, nil @@ -165,14 +162,13 @@ func Start( config Config, registry *ProvisionerRegistry, controllerClient ftlv1connect.ControllerServiceClient, - schemaClient ftlv1connect.SchemaServiceClient, ) error { config.SetDefaults() logger := log.FromContext(ctx) logger.Debugf("Starting FTL provisioner") - svc, err := New(ctx, config, controllerClient, schemaClient, registry) + svc, err := New(ctx, config, controllerClient, registry) if err != nil { return err } @@ -252,32 +248,3 @@ func (s *Service) UploadArtefact(ctx context.Context, req *connect.Request[ftlv1 } return connect.NewResponse(resp.Msg), nil } - -func (s *Service) GetSchema(ctx context.Context, req *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error) { - resp, err := s.schemaClient.GetSchema(ctx, req) - if err != nil { - logger := log.FromContext(ctx) - logger.Errorf(err, "get schema failed") - return nil, fmt.Errorf("call to ftl-controller failed: %w", err) - } - return connect.NewResponse(resp.Msg), nil -} - -func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], to *connect.ServerStream[ftlv1.PullSchemaResponse]) error { - logger := log.FromContext(ctx) - stream, err := s.schemaClient.PullSchema(ctx, req) - if err != nil { - logger.Errorf(err, "pull schema failed") - return fmt.Errorf("call to ftl-controller failed: %w", err) - } - defer stream.Close() - for stream.Receive() { - if err := stream.Err(); err != nil { - return fmt.Errorf("call to ftl-controller failed: %w", err) - } - if err := to.Send(stream.Msg()); err != nil { - return fmt.Errorf("call to ftl-controller failed: %w", err) - } - } - return nil -} diff --git a/cmd/ftl-provisioner/main.go b/cmd/ftl-provisioner/main.go index 55b65c56e9..ec470515d5 100644 --- a/cmd/ftl-provisioner/main.go +++ b/cmd/ftl-provisioner/main.go @@ -43,11 +43,10 @@ func main() { kctx.FatalIfErrorf(err, "failed to initialize observability") controllerClient := rpc.Dial(ftlv1connect.NewControllerServiceClient, cli.ProvisionerConfig.ControllerEndpoint.String(), log.Error) - schemaClient := rpc.Dial(ftlv1connect.NewSchemaServiceClient, cli.ProvisionerConfig.ControllerEndpoint.String(), log.Error) registry, err := provisioner.RegistryFromConfigFile(ctx, cli.ProvisionerConfig.PluginConfigFile, controllerClient) kctx.FatalIfErrorf(err, "failed to create provisioner registry") - err = provisioner.Start(ctx, cli.ProvisionerConfig, registry, controllerClient, schemaClient) + err = provisioner.Start(ctx, cli.ProvisionerConfig, registry, controllerClient) kctx.FatalIfErrorf(err, "failed to start provisioner") } diff --git a/frontend/cli/cmd_dev.go b/frontend/cli/cmd_dev.go index 3e62b8484a..efcbc49920 100644 --- a/frontend/cli/cmd_dev.go +++ b/frontend/cli/cmd_dev.go @@ -45,7 +45,6 @@ func (d *devCmd) Run( sm *manager.Manager[configuration.Secrets], projConfig projectconfig.Config, bindContext terminal.KongContextBinder, - schemaClient ftlv1connect.SchemaServiceClient, schemaEventSourceFactory func() schemaeventsource.EventSource, controllerClient ftlv1connect.ControllerServiceClient, provisionerClient provisionerconnect.ProvisionerServiceClient, @@ -97,7 +96,7 @@ func (d *devCmd) Run( controllerReady := make(chan bool, 1) if !d.NoServe { if d.ServeCmd.Stop { - err := d.ServeCmd.run(ctx, projConfig, cm, sm, optional.Some(controllerReady), true, bindAllocator, controllerClient, schemaClient, provisionerClient, schemaEventSourceFactory, verbClient, true, nil) + err := d.ServeCmd.run(ctx, projConfig, cm, sm, optional.Some(controllerReady), true, bindAllocator, controllerClient, provisionerClient, schemaEventSourceFactory, verbClient, true, nil) if err != nil { return fmt.Errorf("failed to stop server: %w", err) } @@ -105,7 +104,7 @@ func (d *devCmd) Run( } g.Go(func() error { - return d.ServeCmd.run(ctx, projConfig, cm, sm, optional.Some(controllerReady), true, bindAllocator, controllerClient, schemaClient, provisionerClient, schemaEventSourceFactory, verbClient, true, devModeEndpointUpdates) + return d.ServeCmd.run(ctx, projConfig, cm, sm, optional.Some(controllerReady), true, bindAllocator, controllerClient, provisionerClient, schemaEventSourceFactory, verbClient, true, devModeEndpointUpdates) }) } diff --git a/frontend/cli/cmd_serve.go b/frontend/cli/cmd_serve.go index c170753ecf..c0a0bb0ba5 100644 --- a/frontend/cli/cmd_serve.go +++ b/frontend/cli/cmd_serve.go @@ -84,7 +84,7 @@ func (s *serveCmd) Run( if err != nil { return fmt.Errorf("could not create bind allocator: %w", err) } - return s.run(ctx, projConfig, cm, sm, optional.None[chan bool](), false, bindAllocator, controllerClient, schemaClient, provisionerClient, schemaEventSourceFactory, verbClient, s.Recreate, nil) + return s.run(ctx, projConfig, cm, sm, optional.None[chan bool](), false, bindAllocator, controllerClient, provisionerClient, schemaEventSourceFactory, verbClient, s.Recreate, nil) } //nolint:maintidx @@ -97,7 +97,6 @@ func (s *serveCommonConfig) run( devMode bool, bindAllocator *bind.BindAllocator, controllerClient ftlv1connect.ControllerServiceClient, - schemaServiceClient ftlv1connect.SchemaServiceClient, provisionerClient provisionerconnect.ProvisionerServiceClient, schemaEventSourceFactory func() schemaeventsource.EventSource, verbClient ftlv1connect.VerbServiceClient, @@ -285,7 +284,7 @@ func (s *serveCommonConfig) run( } wg.Go(func() error { - if err := provisioner.Start(provisionerCtx, config, provisionerRegistry, controllerClient, schemaServiceClient); err != nil { + if err := provisioner.Start(provisionerCtx, config, provisionerRegistry, controllerClient); err != nil { logger.Errorf(err, "provisioner%d failed: %v", i, err) return fmt.Errorf("provisioner%d failed: %w", i, err) }