Skip to content

Commit

Permalink
Merge pull request #504 from kool-dev/fix-lint-fallback
Browse files Browse the repository at this point in the history
fix lint + fix regression on cloud config legacy file
  • Loading branch information
fabriciojs authored Feb 16, 2024
2 parents 99eb85e + cfee540 commit b4f5ef7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
4 changes: 0 additions & 4 deletions commands/cloud_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import (
"github.com/spf13/cobra"
)

const (
koolDeployEnv = "kool.deploy.env"
)

// KoolCloudDeployFlags holds the flags for the kool cloud deploy command
type KoolCloudDeployFlags struct {
// Token string // env: KOOL_API_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion services/cloud/api/deploy_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewDeployCreate() (c *DeployCreate) {
}

c.SetPath("deploy/create")
c.PostField("is_local", "1")
_ = c.PostField("is_local", "1")

return
}
Expand Down
2 changes: 1 addition & 1 deletion services/cloud/api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (e *DefaultEndpoint) DoCall() (err error) {
err = e.mockErr
if e.mockResp != nil {
raw, _ := json.Marshal(e.mockResp)
json.Unmarshal(raw, e.response)
_ = json.Unmarshal(raw, e.response)
}
return
}
Expand Down
3 changes: 0 additions & 3 deletions services/cloud/deploy_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ func ParseCloudConfig(workingDir string, koolDeployFile string) (deployConfig *D
err = fmt.Errorf("could not find required file '%s' on current working directory: %v", koolDeployFile, err)
return
}

koolDeployFile = "kool.deploy.yml"
return
}

if content, err = os.ReadFile(path); err != nil {
Expand Down
12 changes: 7 additions & 5 deletions services/cloud/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ func NewDeployer() *Deployer {
func (d *Deployer) CreateDeploy(tarballPath string) (resp *api.DeployCreateResponse, err error) {
var create = api.NewDeployCreate()

create.PostFile("deploy", tarballPath, "deploy.tgz")
if err = create.PostFile("deploy", tarballPath, "deploy.tgz"); err != nil {
return
}

create.PostField("cluster", d.env.Get("KOOL_CLOUD_CLUSTER"))
create.PostField("domain", d.env.Get("KOOL_DEPLOY_DOMAIN"))
create.PostField("domain_extras", d.env.Get("KOOL_DEPLOY_DOMAIN_EXTRAS"))
create.PostField("www_redirect", d.env.Get("KOOL_DEPLOY_WWW_REDIRECT"))
_ = create.PostField("cluster", d.env.Get("KOOL_CLOUD_CLUSTER"))
_ = create.PostField("domain", d.env.Get("KOOL_DEPLOY_DOMAIN"))
_ = create.PostField("domain_extras", d.env.Get("KOOL_DEPLOY_DOMAIN_EXTRAS"))
_ = create.PostField("www_redirect", d.env.Get("KOOL_DEPLOY_WWW_REDIRECT"))

resp, err = create.Run()

Expand Down

0 comments on commit b4f5ef7

Please sign in to comment.