From 3676232df1626ac3d923465c23bcc2a19edf725c Mon Sep 17 00:00:00 2001 From: asim Date: Sun, 7 Jul 2024 18:30:48 +0100 Subject: [PATCH] strip runtime --- options.go | 1 - util/cmd/cmd.go | 31 ------------------------------- util/cmd/options.go | 1 - 3 files changed, 33 deletions(-) diff --git a/options.go b/options.go index 60c6cc1483..20e701e687 100644 --- a/options.go +++ b/options.go @@ -14,7 +14,6 @@ import ( "go-micro.dev/v5/debug/trace" "go-micro.dev/v5/logger" "go-micro.dev/v5/registry" - "go-micro.dev/v5/runtime" "go-micro.dev/v5/selector" "go-micro.dev/v5/server" "go-micro.dev/v5/store" diff --git a/util/cmd/cmd.go b/util/cmd/cmd.go index 670506c14a..6fa3914858 100644 --- a/util/cmd/cmd.go +++ b/util/cmd/cmd.go @@ -19,7 +19,6 @@ import ( "go-micro.dev/v5/debug/trace" "go-micro.dev/v5/logger" "go-micro.dev/v5/registry" - "go-micro.dev/v5/runtime" "go-micro.dev/v5/selector" "go-micro.dev/v5/server" "go-micro.dev/v5/store" @@ -146,17 +145,6 @@ var ( EnvVars: []string{"MICRO_REGISTRY_ADDRESS"}, Usage: "Comma-separated list of registry addresses", }, - &cli.StringFlag{ - Name: "runtime", - Usage: "Runtime for building and running services e.g local, kubernetes", - EnvVars: []string{"MICRO_RUNTIME"}, - }, - &cli.StringFlag{ - Name: "runtime_source", - Usage: "Runtime source for building and running services e.g github.com/micro/service", - EnvVars: []string{"MICRO_RUNTIME_SOURCE"}, - Value: "github.com/micro/services", - }, &cli.StringFlag{ Name: "selector", EnvVars: []string{"MICRO_SELECTOR"}, @@ -252,8 +240,6 @@ var ( DefaultTransports = map[string]func(...transport.Option) transport.Transport{} - DefaultRuntimes = map[string]func(...runtime.Option) runtime.Runtime{} - DefaultStores = map[string]func(...store.Option) store.Store{} DefaultTracers = map[string]func(...trace.Option) trace.Tracer{} @@ -283,7 +269,6 @@ func newCmd(opts ...Option) Cmd { Server: &server.DefaultServer, Selector: &selector.DefaultSelector, Transport: &transport.DefaultTransport, - Runtime: &runtime.DefaultRuntime, Store: &store.DefaultStore, Tracer: &trace.DefaultTracer, Profile: &profile.DefaultProfile, @@ -371,16 +356,6 @@ func (c *cmd) Before(ctx *cli.Context) error { *c.opts.Store = s(store.WithClient(*c.opts.Client)) } - // Set the runtime - if name := ctx.String("runtime"); len(name) > 0 { - r, ok := c.opts.Runtimes[name] - if !ok { - return fmt.Errorf("Unsupported runtime: %s", name) - } - - *c.opts.Runtime = r(runtime.WithClient(*c.opts.Client)) - } - // Set the tracer if name := ctx.String("tracer"); len(name) > 0 { r, ok := c.opts.Tracers[name] @@ -566,12 +541,6 @@ func (c *cmd) Before(ctx *cli.Context) error { serverOpts = append(serverOpts, server.RegisterInterval(val*time.Second)) } - if len(ctx.String("runtime_source")) > 0 { - if err := (*c.opts.Runtime).Init(runtime.WithSource(ctx.String("runtime_source"))); err != nil { - logger.Fatalf("Error configuring runtime: %v", err) - } - } - // client opts if r := ctx.Int("client_retries"); r >= 0 { clientOpts = append(clientOpts, client.Retries(r)) diff --git a/util/cmd/options.go b/util/cmd/options.go index ba2fb6c0fb..6860cceb61 100644 --- a/util/cmd/options.go +++ b/util/cmd/options.go @@ -11,7 +11,6 @@ import ( "go-micro.dev/v5/debug/profile" "go-micro.dev/v5/debug/trace" "go-micro.dev/v5/registry" - "go-micro.dev/v5/runtime" "go-micro.dev/v5/selector" "go-micro.dev/v5/server" "go-micro.dev/v5/store"