Skip to content

Commit 772b255

Browse files
authored
deployments: Change refID defaults to use 'main-' prefix (#118)
Changes the default refID values to use a "main-" prefix in order to achieve parity with the UI.
1 parent f363be6 commit 772b255

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

cmd/deployment/apm/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func init() {
125125
createApmCmd.Flags().StringP("file", "f", "", "ApmPayload file definition. See help for more information")
126126
createApmCmd.Flags().String("deployment-template", "", "Optional deployment template ID, automatically obtained from the current deployment")
127127
createApmCmd.Flags().String("version", "", "Optional version to use. If not specified, it will default to the deployment's stack version")
128-
createApmCmd.Flags().String("ref-id", "apm", "RefId for the Apm deployment")
128+
createApmCmd.Flags().String("ref-id", "main-apm", "RefId for the Apm deployment")
129129
createApmCmd.Flags().String("id", "", "Deployment ID where to create the Apm deployment")
130130
createApmCmd.MarkFlagRequired("id")
131131
createApmCmd.Flags().String("elasticsearch-ref-id", "", "Optional Elasticsearch ref ID where the Apm deployment will connect to")

cmd/deployment/kibana/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func init() {
124124
createKibanaCmd.Flags().StringP("file", "f", "", "KibanaPayload file definition. See help for more information")
125125
createKibanaCmd.Flags().String("deployment-template", "", "Optional deployment template ID, automatically obtained from the current deployment")
126126
createKibanaCmd.Flags().String("version", "", "Version to use, if not specified, the deployment's stack version will be used")
127-
createKibanaCmd.Flags().String("ref-id", "kibana", "RefId for the Kibana deployment")
127+
createKibanaCmd.Flags().String("ref-id", "main-kibana", "RefId for the Kibana deployment")
128128
createKibanaCmd.Flags().String("id", "", "Deployment ID where to create the Kibana deployment")
129129
createKibanaCmd.MarkFlagRequired("id")
130130
createKibanaCmd.Flags().String("elasticsearch-ref-id", "", "Optional Elasticsearch ref ID where the Kibana deployment will connect to")

docs/ecctl_deployment_apm_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $ cat apm_create_example.json | dev-cli deployment apm create --track --id a57f8
7979
-h, --help help for create
8080
--id string Deployment ID where to create the Apm deployment
8181
--name string Optional name to set for the Apm deployment (Overrides name if present)
82-
--ref-id string RefId for the Apm deployment (default "apm")
82+
--ref-id string RefId for the Apm deployment (default "main-apm")
8383
--size int32 Memory (RAM) in MB that each of the deployment nodes will have (default 512)
8484
-t, --track Tracks the progress of the performed task
8585
--version string Optional version to use. If not specified, it will default to the deployment's stack version

docs/ecctl_deployment_kibana_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $ cat kibana_create_example.json | dev-cli deployment kibana create --track --id
7171
-h, --help help for create
7272
--id string Deployment ID where to create the Kibana deployment
7373
--name string Optional name to set for the Kibana deployment (Overrides name if present)
74-
--ref-id string RefId for the Kibana deployment (default "kibana")
74+
--ref-id string RefId for the Kibana deployment (default "main-kibana")
7575
--size int32 Memory (RAM) in MB that each of the deployment nodes will have (default 1024)
7676
-t, --track Tracks the progress of the performed task
7777
--version string Version to use, if not specified, the deployment's stack version will be used

pkg/deployment/depresource/apm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
const (
2828
// DefaultApmRefID is used when the RefID is not specified.
29-
DefaultApmRefID = "apm"
29+
DefaultApmRefID = "main-apm"
3030
)
3131

3232
// NewApm creates a *models.ApmPayload from the parameters.

pkg/deployment/depresource/apm_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestNewApm(t *testing.T) {
6565
var getResponse = models.DeploymentGetResponse{
6666
Resources: &models.DeploymentResources{
6767
Elasticsearch: []*models.ElasticsearchResourceInfo{{
68-
RefID: ec.String("elasticsearch"),
68+
RefID: ec.String("main-elasticsearch"),
6969
Info: &models.ElasticsearchClusterInfo{
7070
PlanInfo: &models.ElasticsearchClusterPlansInfo{
7171
Current: &models.ElasticsearchClusterPlanInfo{
@@ -150,9 +150,9 @@ func TestNewApm(t *testing.T) {
150150
Region: "ece-region",
151151
}},
152152
want: &models.ApmPayload{
153-
ElasticsearchClusterRefID: ec.String("elasticsearch"),
153+
ElasticsearchClusterRefID: ec.String("main-elasticsearch"),
154154
Region: ec.String("ece-region"),
155-
RefID: ec.String("apm"),
155+
RefID: ec.String("main-apm"),
156156
Plan: &models.ApmPlan{
157157
Apm: &models.ApmConfiguration{},
158158
ClusterTopology: []*models.ApmTopologyElement{
@@ -180,9 +180,9 @@ func TestNewApm(t *testing.T) {
180180
Region: "ece-region",
181181
}},
182182
want: &models.ApmPayload{
183-
ElasticsearchClusterRefID: ec.String("elasticsearch"),
183+
ElasticsearchClusterRefID: ec.String("main-elasticsearch"),
184184
Region: ec.String("ece-region"),
185-
RefID: ec.String("apm"),
185+
RefID: ec.String("main-apm"),
186186
Plan: &models.ApmPlan{
187187
Apm: &models.ApmConfiguration{},
188188
ClusterTopology: []*models.ApmTopologyElement{

pkg/deployment/depresource/elasticsearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const (
4444
DefaultDataZoneCount = 1
4545

4646
// DefaultElasticsearchRefID is used when the RefID is not specified.
47-
DefaultElasticsearchRefID = "elasticsearch"
47+
DefaultElasticsearchRefID = "main-elasticsearch"
4848
)
4949

5050
// NewElasticsearchParams is consumed by NewElasticsearch.

pkg/deployment/depresource/kibana.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ import (
2525
)
2626

2727
const (
28-
// DefaultKibanahRefID is used when the RefID is not specified.
29-
DefaultKibanahRefID = "kibana"
28+
// DefaultKibanaRefID is used when the RefID is not specified.
29+
DefaultKibanaRefID = "main-kibana"
3030
)
3131

3232
// NewKibana creates a *models.KibanaPayload from the parameters.
3333
// It relies on a simplified single dimension memory size and zone count to
3434
// construct the Kibana's topology.
3535
func NewKibana(params NewStateless) (*models.KibanaPayload, error) {
36-
params.fillDefaults(DefaultKibanahRefID)
36+
params.fillDefaults(DefaultKibanaRefID)
3737
if err := params.Validate(); err != nil {
3838
return nil, err
3939
}

pkg/deployment/depresource/kibana_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestNewKibana(t *testing.T) {
6565
var getResponse = models.DeploymentGetResponse{
6666
Resources: &models.DeploymentResources{
6767
Elasticsearch: []*models.ElasticsearchResourceInfo{{
68-
RefID: ec.String("elasticsearch"),
68+
RefID: ec.String("main-elasticsearch"),
6969
Info: &models.ElasticsearchClusterInfo{
7070
PlanInfo: &models.ElasticsearchClusterPlansInfo{
7171
Current: &models.ElasticsearchClusterPlanInfo{
@@ -150,9 +150,9 @@ func TestNewKibana(t *testing.T) {
150150
Region: "ece-region",
151151
}},
152152
want: &models.KibanaPayload{
153-
ElasticsearchClusterRefID: ec.String("elasticsearch"),
153+
ElasticsearchClusterRefID: ec.String("main-elasticsearch"),
154154
Region: ec.String("ece-region"),
155-
RefID: ec.String("kibana"),
155+
RefID: ec.String("main-kibana"),
156156
Plan: &models.KibanaClusterPlan{
157157
Kibana: &models.KibanaConfiguration{},
158158
ClusterTopology: []*models.KibanaClusterTopologyElement{
@@ -180,9 +180,9 @@ func TestNewKibana(t *testing.T) {
180180
Region: "ece-region",
181181
}},
182182
want: &models.KibanaPayload{
183-
ElasticsearchClusterRefID: ec.String("elasticsearch"),
183+
ElasticsearchClusterRefID: ec.String("main-elasticsearch"),
184184
Region: ec.String("ece-region"),
185-
RefID: ec.String("kibana"),
185+
RefID: ec.String("main-kibana"),
186186
Plan: &models.KibanaClusterPlan{
187187
Kibana: &models.KibanaConfiguration{},
188188
ClusterTopology: []*models.KibanaClusterTopologyElement{

0 commit comments

Comments
 (0)