Skip to content

Commit cbf843f

Browse files
authored
deployment create: Remove region value on non-ESS (#326)
Removes the default "ece-region" assignment on the deployment create cmd layer when the region is empty and the endpoint is not targetting ESS. It only affects a flag-based creation and not the payload. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 8c635e1 commit cbf843f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

cmd/deployment/create.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ var createCmd = &cobra.Command{
6565
var appsearchSize, _ = cmd.Flags().GetInt32("appsearch-size")
6666
var appsearchRefID, _ = cmd.Flags().GetString("appsearch-ref-id")
6767

68-
region := ecctl.Get().Config.Region
69-
if region == "" {
70-
region = cmdutil.DefaultECERegion
71-
}
72-
7368
var payload *models.DeploymentCreateRequest
7469
if err := sdkcmdutil.FileOrStdin(cmd, "file"); err == nil {
7570
err := sdkcmdutil.DecodeDefinition(cmd, "file", &payload)
@@ -85,7 +80,7 @@ var createCmd = &cobra.Command{
8580
Name: name,
8681
DeploymentTemplateID: dt,
8782
Version: version,
88-
Region: region,
83+
Region: ecctl.Get().Config.Region,
8984
Writer: ecctl.Get().Config.ErrorDevice,
9085
Plugins: plugin,
9186
TopologyElements: te,

cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ func initApp(cmd *cobra.Command, client *http.Client, v *viper.Viper) error {
184184
return err
185185
}
186186

187+
// Set the default region to `ece-region` when the endpoint is not the ESS endpoint.
187188
if c.Region == "" && c.Host != api.ESSEndpoint {
188189
c.Region = cmdutil.DefaultECERegion
189190
}

0 commit comments

Comments
 (0)