From c176c3e7c1bc2d052a3a93a4c4955d5295e0afb4 Mon Sep 17 00:00:00 2001 From: Ketan Umare Date: Tue, 31 Oct 2023 16:03:17 -0700 Subject: [PATCH] Updated Sandbox config, with automated data configuration Signed-off-by: Ketan Umare --- pkg/configutil/configutil.go | 25 ++++++++++++++++++------- pkg/sandbox/start.go | 6 +++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/pkg/configutil/configutil.go b/pkg/configutil/configutil.go index 5dcde9bd..268c8b4f 100644 --- a/pkg/configutil/configutil.go +++ b/pkg/configutil/configutil.go @@ -11,21 +11,32 @@ const ( AdminConfigTemplate = `admin: # For GRPC endpoints you might want to use dns:///flyte.myexample.com endpoint: {{.Host}} - authType: Pkce insecure: {{.Insecure}} {{- if .Console}} console: endpoint: {{.Console}} {{- end}} -logger: - show-source: true - level: 0` +{{- if .DataConfig}} +storage: + connection: + endpoint: {{.DataConfig.Endpoint}} + access-key: {{.DataConfig.AccessKey}} + secret-key: {{.DataConfig.SecretKey}} +{{- end}} +` ) +type DataConfig struct { + Endpoint string + AccessKey string + SecretKey string +} + type ConfigTemplateSpec struct { - Host string - Insecure bool - Console string + Host string + Insecure bool + Console string + DataConfig *DataConfig } var ( diff --git a/pkg/sandbox/start.go b/pkg/sandbox/start.go index c8e6b7a5..c6f41859 100644 --- a/pkg/sandbox/start.go +++ b/pkg/sandbox/start.go @@ -172,7 +172,11 @@ func startSandbox(ctx context.Context, cli docker.Docker, g github.GHRepoService templateValues := configutil.ConfigTemplateSpec{ Host: "localhost:30080", Insecure: true, - Console: fmt.Sprintf("http://localhost:%d", consolePort), + DataConfig: &configutil.DataConfig{ + Endpoint: "http://localhost:30002", + AccessKey: "miniostorage", + SecretKey: "minio", + }, } if err := configutil.SetupConfig(configutil.FlytectlConfig, configutil.GetTemplate(), templateValues); err != nil { return nil, err