Skip to content

Commit 6fa460f

Browse files
authored
Patch PR followup fixes (#1666)
1 parent 4020817 commit 6fa460f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

cli/cmd/patch.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ var _patchCmd = &cobra.Command{
6464
configPath := getConfigPath(args)
6565

6666
var deployResults []schema.DeployResult
67-
if env.Provider == types.AWSProviderType {
68-
deployResults, err = cluster.Patch(MustGetOperatorConfig(env.Name), configPath, _flagPatchForce)
67+
if env.Provider == types.LocalProviderType {
68+
deployResults, err = local.Patch(env, configPath)
6969
if err != nil {
7070
exit.Error(err)
7171
}
7272
} else {
73-
deployResults, err = local.Patch(env, configPath)
73+
deployResults, err = cluster.Patch(MustGetOperatorConfig(env.Name), configPath, _flagPatchForce)
7474
if err != nil {
7575
exit.Error(err)
7676
}

cli/local/deploy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/cortexlabs/cortex/pkg/types/userconfig"
3434
)
3535

36-
func Deploy(env cliconfig.Environment, configPath string, projectFileList []string, deployDisallowPrompt bool) ([]schema.DeployResult, error) {
36+
func Deploy(env cliconfig.Environment, configPath string, projectFileList []string, disallowPrompt bool) ([]schema.DeployResult, error) {
3737
configFileName := filepath.Base(configPath)
3838

3939
_, err := docker.GetDockerClient()
@@ -61,10 +61,10 @@ func Deploy(env cliconfig.Environment, configPath string, projectFileList []stri
6161
return nil, err
6262
}
6363

64-
return deploy(env, apiConfigs, projectFiles, deployDisallowPrompt)
64+
return deploy(env, apiConfigs, projectFiles, disallowPrompt)
6565
}
6666

67-
func deploy(env cliconfig.Environment, apiConfigs []userconfig.API, projectFiles ProjectFiles, deployDisallowPrompt bool) ([]schema.DeployResult, error) {
67+
func deploy(env cliconfig.Environment, apiConfigs []userconfig.API, projectFiles ProjectFiles, disallowPrompt bool) ([]schema.DeployResult, error) {
6868
var err error
6969
var awsClient *aws.Client
7070
var gcpClient *gcp.Client
@@ -104,7 +104,7 @@ func deploy(env cliconfig.Environment, apiConfigs []userconfig.API, projectFiles
104104
results := make([]schema.DeployResult, len(apiConfigs))
105105
for i := range apiConfigs {
106106
apiConfig := apiConfigs[i]
107-
api, msg, err := UpdateAPI(&apiConfig, models, projectFiles.projectRoot, projectID, deployDisallowPrompt, awsClient)
107+
api, msg, err := UpdateAPI(&apiConfig, models, projectFiles.projectRoot, projectID, disallowPrompt, awsClient)
108108
results[i].Message = msg
109109
if err != nil {
110110
results[i].Error = errors.Message(err)

pkg/lib/cast/interface.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,15 +715,15 @@ func JSONMarshallable(in interface{}) (interface{}, bool) {
715715
}
716716
return out, true
717717
} else if inSlice, ok := InterfaceToInterfaceSlice(in); ok {
718-
result := make([]interface{}, 0, len(inSlice))
718+
out := make([]interface{}, 0, len(inSlice))
719719
for _, inValue := range inSlice {
720720
castedInValue, ok := JSONMarshallable(inValue)
721721
if !ok {
722722
return nil, false
723723
}
724-
result = append(result, castedInValue)
724+
out = append(out, castedInValue)
725725
}
726-
return result, true
726+
return out, true
727727
}
728728
return in, true
729729
}

0 commit comments

Comments
 (0)