From c07074a5201bcdc9cbf593d58fcb4dc1787834db Mon Sep 17 00:00:00 2001 From: kunming Date: Fri, 14 Sep 2018 14:26:02 -0700 Subject: [PATCH] edit server address for app config on each request --- bootstrap/cmd/bootstrap/app/ksServer.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstrap/cmd/bootstrap/app/ksServer.go b/bootstrap/cmd/bootstrap/app/ksServer.go index 68794267e1d..96184265a0d 100644 --- a/bootstrap/cmd/bootstrap/app/ksServer.go +++ b/bootstrap/cmd/bootstrap/app/ksServer.go @@ -213,13 +213,21 @@ func (s *ksServer) CreateApp(ctx context.Context, request CreateRequest) error { return fmt.Errorf("Name must be a non empty string.") } a, err := s.GetApp(request.Project, request.Name, request.Token) - + envName := "default" if err == nil { log.Infof("App %v exists in project %v", request.Name, request.Project) + options := map[string]interface{}{ + actions.OptionApp: a.App, + actions.OptionEnvName: envName, + actions.OptionServer: config.Host, + } + err := actions.RunEnvSet(options) + if err != nil { + return fmt.Errorf("There was a problem setting app env: %v", err) + } } else { log.Infof("Creating app %v", request.Name) log.Infof("Using K8s host %v", config.Host) - envName := "default" appDir := path.Join(s.appsDir, GetRepoName(request.Project), request.Name) _, err = s.fs.Stat(appDir)