From 18f05d08eefb125a1acb24535d93746848f96cc1 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Fri, 5 May 2023 16:17:12 -0300 Subject: [PATCH] Kool Cloud Tweak --- commands/cloud_deploy.go | 2 +- services/cloud/deploy_validator.go | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/commands/cloud_deploy.go b/commands/cloud_deploy.go index 7438d10f..12ece22c 100644 --- a/commands/cloud_deploy.go +++ b/commands/cloud_deploy.go @@ -18,7 +18,7 @@ import ( const ( koolDeployEnv = "kool.deploy.env" - koolDeployFile = "kool.deploy.yml" + koolDeployFile = "kool.cloud.yml" ) // KoolDeploy holds handlers and functions for using Deploy API diff --git a/services/cloud/deploy_validator.go b/services/cloud/deploy_validator.go index dbeaa250..2672d774 100644 --- a/services/cloud/deploy_validator.go +++ b/services/cloud/deploy_validator.go @@ -38,7 +38,15 @@ func ValidateKoolDeployFile(workingDir string, koolDeployFile string) (err error path = filepath.Join(workingDir, koolDeployFile) if _, err = os.Stat(path); os.IsNotExist(err) { - err = fmt.Errorf("could not find required file (%s) on current working directory", koolDeployFile) + // temporary failback to old file name + path = filepath.Join(workingDir, "kool.deploy.yml") + + if _, err = os.Stat(path); os.IsNotExist(err) { + err = fmt.Errorf("could not find required file (%s) on current working directory", "kool.cloud.yml") + return + } else if err != nil { + return + } return } else if err != nil { return @@ -52,7 +60,6 @@ func ValidateKoolDeployFile(workingDir string, koolDeployFile string) (err error return } - var gotPublicService = false for service, config := range deployConfig.Services { // validates build file exists if defined if config.Build != nil { @@ -67,15 +74,6 @@ func ValidateKoolDeployFile(workingDir string, koolDeployFile string) (err error // validates only one service can be public, and it must define a port if config.Public != nil { - // this is a public service - if gotPublicService { - // we can have only the one! - err = fmt.Errorf("service (%s) is public, but another service is already public", service) - return - } - - gotPublicService = true - // being public, it must define the `port` entry as well if config.Port == nil { err = fmt.Errorf("service (%s) is public, but it does not define the `port` entry", service)