Skip to content

Commit d0ba552

Browse files
authored
enterprise_search: Support and refactor (#342)
Support for Enterprise Search in various places. In addition, Some files which were not being used have now been removed.
1 parent 1f8bd04 commit d0ba552

File tree

7 files changed

+40
-54
lines changed

7 files changed

+40
-54
lines changed

pkg/formatter/templates/bindata.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func textAllocatorShowmetadataGotmpl() (*asset, error) {
217217
return a, nil
218218
}
219219

220-
var _textDeploymentListGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x91\x51\x6e\x82\x40\x10\x86\xdf\x3d\xc5\x64\xe3\xab\x7b\x80\x26\x3e\x6c\x85\xa4\xc4\x4a\x8c\x7a\x81\x81\x1d\x5a\x52\x58\x28\x2c\x4d\x1b\xc2\xdd\x1b\xd8\x1d\x2b\x6a\x13\x9f\x18\xbe\x99\x7f\xfe\x7f\xa0\xef\x57\xa0\x29\xcb\x0d\x81\xa8\xbe\xa8\x69\x72\x4d\x02\x86\xa1\xef\xa1\x41\xf3\x46\x20\x03\xaa\x8b\xea\xa7\x24\x63\x5b\xc7\xe9\x9b\xd2\xce\xd2\x89\xca\xba\x40\x4b\x20\x87\x61\x31\x62\xa3\x7d\x9f\x0b\xde\xab\x29\xc3\xae\xb0\xe3\xda\xc5\xe8\x27\xa2\xc0\x59\x58\x4c\xa6\x41\x11\xab\x5d\x28\x2e\x88\x08\x5f\xd5\xf1\x14\x6d\x8e\xa1\x3a\x6c\x5e\x66\x9d\x6d\xf4\xac\x62\x35\x43\x6a\xbf\xbb\x7a\xdf\x9f\x85\x93\xe1\xdd\x4b\xa6\xce\xf2\x23\x4f\xd0\x20\x3c\xad\x41\xac\x78\x7c\x89\x75\x79\x43\xea\x96\xb0\x49\xdf\xe7\xdc\x2f\x3e\x50\x5b\x75\x4d\x4a\xad\xc7\x79\x06\xf4\xd9\x61\x01\x72\x9b\x1b\x0d\xc2\x99\xf8\xcf\xca\x96\x6b\x90\x51\x30\x21\x32\xfa\x1f\x21\xd6\x25\xab\xc6\x4c\x8f\x49\x7c\xd2\x3f\x21\x47\xbf\x27\xe7\xea\xdc\xe2\x7f\x22\x63\x2c\xc9\xad\xb0\x98\x4c\x85\x8c\x82\xcb\x09\x3e\x64\x36\xe3\x82\xde\x20\x8e\x70\xe5\xea\x9e\xbf\x01\x00\x00\xff\xff\x78\x70\x0c\xba\x84\x02\x00\x00")
220+
var _textDeploymentListGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x52\xc1\x6e\xab\x30\x10\xbc\xe7\x2b\x56\x56\xae\xe1\x03\x9e\x94\x83\x5f\x40\x2a\x4a\x83\x10\xc9\x3d\xda\x84\x4d\x6b\x15\x1c\xd7\x98\xaa\x15\xe2\xdf\x2b\x30\x26\x71\xa0\x52\x4e\x59\xcd\xec\xcc\xce\x38\x34\xcd\x0a\x72\xba\x08\x49\xc0\xae\x5f\xa4\xb5\xc8\x89\x41\xdb\x36\x0d\x68\x94\x6f\x04\x41\x48\xaa\xb8\xfe\x94\x24\x4d\x65\x71\xfa\xa6\x73\x6d\xe8\x40\xa5\x2a\xd0\x10\x04\x6d\xbb\xe8\x60\x99\x0f\xbc\x1b\x9c\x6f\x4e\x17\xac\x0b\xd3\xd9\x2e\xba\x7b\x2c\x0e\xed\x09\x83\xa7\x7e\x91\x25\x7c\x17\xb1\x3b\x84\x45\xaf\x7c\x7f\x88\x37\xfb\x88\x67\x9b\x17\x8f\xd9\xc6\xff\x79\xc2\x3d\x88\xa7\x3b\x5f\x9c\x1c\xa2\x2c\xcd\xe2\x7d\x74\x9c\x31\xe0\x69\x3a\xa2\x7d\x9c\xd9\x9e\x3d\xb3\xfc\x10\x27\x94\x08\xff\xd6\xc0\x56\x6e\x7d\x89\xaa\x9c\x20\xaa\x22\xd4\xe7\xf7\x07\x9c\xa4\x21\xad\xb4\xa8\x68\x8e\x1e\xee\x66\x54\x5d\x6b\x7d\xa6\x6a\x80\xc5\x05\xe8\xb3\xc6\x02\x82\xad\x90\x39\x30\x9b\x61\xf8\x4f\x5c\xa2\x35\x04\x71\xd8\x43\x24\xf3\x3f\x84\xa8\x4a\xa7\xea\x22\x3f\x27\x19\x8a\xdc\x84\xae\xd9\x33\xf2\x5b\xdf\xa3\x6f\x33\x79\x88\x39\x37\x37\x8d\x94\xfb\x3c\x82\x04\x4b\xb2\x4e\x06\x4f\xfd\x10\xc4\xe1\xfd\x86\x7b\x16\x6f\xc7\xd6\x7e\x80\x26\x49\x26\x12\x35\x12\x5e\x2a\xfb\xfb\x1b\x00\x00\xff\xff\x48\xa6\x73\x49\x2f\x03\x00\x00")
221221

222222
func textDeploymentListGotmplBytes() ([]byte, error) {
223223
return bindataRead(
@@ -257,7 +257,7 @@ func textDeploymentNotelistGotmpl() (*asset, error) {
257257
return a, nil
258258
}
259259

260-
var _textDeploymentSearchGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x52\xdd\x6a\x83\x30\x14\xbe\xef\x53\x84\xd0\xdb\xfa\x00\x83\x5e\x64\x55\x98\x74\x95\xd2\xf6\x05\x8e\x7a\xba\xc9\x4c\x0c\x49\x1c\x1b\xe2\xbb\x0f\xf3\x53\x4c\xed\xa0\x57\xc6\xef\x9c\xef\x27\x9f\x0e\xc3\x86\xd4\x78\x6d\x04\x12\xda\x7d\xa3\x52\x4d\x8d\x94\x8c\xe3\x30\x10\x05\xe2\x03\x49\x92\xa2\x6c\xbb\x5f\x8e\xc2\x68\x87\xe3\x0f\x56\xbd\xc1\x0b\x72\xd9\x82\x41\x92\x8c\xe3\x6a\x82\x45\xed\xe7\xe1\x10\x74\x6b\xbc\x42\xdf\x9a\x49\x76\x35\xf9\xd1\x3c\x75\x16\x06\x4a\xbb\x48\x0b\x76\xc8\xe8\x0c\xa1\xd9\x3b\x3b\x5f\xf2\xdd\x39\x63\xa7\xdd\x5b\x34\xd9\xe7\xaf\xac\x60\x11\xc4\x8e\x87\xbb\xf7\xe3\x8d\x68\x0d\x1f\xde\xc4\x4e\xd6\x5f\x4d\x09\x02\xc8\xcb\x96\xd0\x4d\x58\x5f\x83\xe4\x0b\x44\x6a\x04\x55\x7d\xde\xe1\xd8\x82\x36\x4d\xf5\x68\xe6\x4d\x4f\xa8\xbb\x5e\x55\xa8\x13\x26\xb9\xbd\xad\x95\xdf\x92\x24\x4f\x6d\x09\x28\xea\xff\x19\xde\x35\xf0\x42\x88\xa7\xd8\xd9\x3c\x9b\x53\x88\xe3\x3e\xa5\xb2\xb7\x05\x39\xba\x2f\x6b\xc9\xbb\x01\xe1\x8b\x26\x05\x70\x74\x7f\x81\x81\xd2\x1e\x62\xf3\xf9\x72\xd0\x8d\xd6\x5d\x4d\x0b\x28\x34\xe0\xe3\x86\x00\xee\xf9\x17\x00\x00\xff\xff\x34\xd0\x98\x15\xcd\x02\x00\x00")
260+
var _textDeploymentSearchGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x52\xc1\x6a\xb4\x30\x18\xbc\xef\x53\x84\xb0\xd7\xf5\x01\x7e\xd8\x43\xfe\xdd\x40\x65\xbb\x22\xea\xbd\x44\xfd\xb6\x95\x6a\x0c\x49\x2c\x2d\xe2\xbb\x17\x13\x23\x66\xb5\xe0\x49\x99\xf9\x66\xbe\xc9\x24\x7d\x7f\x42\x25\x3c\x2a\x0e\x08\xb7\x5f\x20\x65\x55\x02\x46\xc3\xd0\xf7\x48\x32\xfe\x0e\x28\xb8\x82\xa8\xdb\x9f\x06\xb8\x56\x16\x87\x6f\x28\x3a\x0d\x19\x34\xa2\x66\x1a\x50\x30\x0c\x87\x11\xe6\xe5\xc4\xbb\x1f\xe7\x5b\xc2\x83\x75\xb5\x1e\x6d\x0f\xe3\x3e\x1c\x5e\xed\x0a\xcd\x72\x33\x88\x23\x72\xa7\x78\x81\x60\xfa\x4a\xd2\x2c\xbc\xa4\x94\x24\x97\x17\x8f\xb9\x85\xff\x49\x44\x3c\x88\xc4\x77\x5f\x1c\x65\x34\x89\x93\x30\xa5\x6f\x1b\x06\x24\x8e\x67\xd4\xc4\xd9\x3c\xa7\x61\x8e\x9f\x55\xce\x38\x43\xff\xce\x08\x9f\xdc\xf8\x91\x89\x66\x85\x08\x05\x4c\x16\x1f\x4f\x38\xd4\x4c\xe9\xaa\xd8\xe6\xb8\x06\x29\x64\xa5\x60\x8b\x9e\x32\x25\xa0\xda\x4e\x16\xa0\x02\x22\x1a\x53\x95\xd9\x7e\x46\x41\x78\x35\x0d\x02\x2f\xff\x56\x4c\xa1\x9c\xce\x65\xdc\xa5\xa6\x73\xbc\x74\x61\xb2\x0a\xbd\xcf\x6b\x59\xc3\x64\xe4\x35\xb3\xcb\xe5\x66\xee\xc2\xca\xa7\x7b\x59\xeb\x66\xc0\x3d\xad\x20\x62\x0d\xd8\xe7\xa8\x59\x6e\x7e\xfc\xe5\xcb\x61\xe7\xeb\x8d\xdb\xca\x9f\xa0\x55\x11\x2b\x89\x98\x09\x73\x1c\x17\xd0\x7e\x7f\x03\x00\x00\xff\xff\x00\x13\x98\x29\x76\x03\x00\x00")
261261

262262
func textDeploymentSearchGotmplBytes() ([]byte, error) {
263263
return bindataRead(
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{{- define "override" }}{{ range .Deployments }}{{ executeTemplate .}}
22
{{ end }}{{ end }}{{ define "default" }}
3-
{{- "ID" }}{{tab}}{{ "NAME"}}{{tab}}{{"ELASTICSEARCH"}}{{tab}}{{"KIBANA"}}{{tab}}{{"APM"}}{{tab}}{{"APPSEARCH"}}
3+
{{- "ID" }}{{tab}}{{ "NAME"}}{{tab}}{{"ELASTICSEARCH"}}{{tab}}{{"KIBANA"}}{{tab}}{{"APM"}}{{tab}}{{"ENTERPRISE_SEARCH"}}{{tab}}{{"APPSEARCH"}}
44
{{- range .Deployments }}
55
{{- $kibana := "-"}}
66
{{- $apm := "-"}}
77
{{- $appsearch := "-"}}
8+
{{- $enterprisesearch := "-"}}
89
{{- range .Resources}}
910
{{- if equal .Kind "kibana" }}{{ $kibana = .ID }}{{end}}
1011
{{- if equal .Kind "apm" }}{{ $apm = .ID }}{{end}}
1112
{{- if equal .Kind "appsearch" }}{{ $appsearch = .ID }}{{end}}
13+
{{- if equal .Kind "enterprise_search" }}{{ $enterprisesearch = .ID }}{{end}}
1214
{{- end}}
13-
{{ .ID }}{{tab}}{{ .Name }}{{ tab }}{{.ID}}{{tab}}{{ $kibana }}{{ tab }}{{ $apm }}{{ tab }}{{ $appsearch }}
15+
{{ .ID }}{{tab}}{{ .Name }}{{ tab }}{{.ID}}{{tab}}{{ $kibana }}{{ tab }}{{ $apm }}{{ tab }}{{ $enterprisesearch }}{{ tab }}{{ $appsearch }}
1416
{{- end}}
1517
{{end}}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{{- define "override" }}{{ range .Deployments }}{{ executeTemplate .}}
22
{{ end }}{{ end }}{{ define "default" }}
3-
{{- "ID" }}{{tab}}{{ "NAME"}}{{tab}}{{"ELASTICSEARCH"}}{{tab}}{{"KIBANA"}}{{tab}}{{"APM"}}{{tab}}{{"APPSEARCH"}}
3+
{{- "ID" }}{{tab}}{{ "NAME"}}{{tab}}{{"ELASTICSEARCH"}}{{tab}}{{"KIBANA"}}{{tab}}{{"APM"}}{{tab}}{{"ENTERPRISE_SEARCH"}}{{tab}}{{"APPSEARCH"}}
44
{{- range .Deployments }}
55
{{- $kibana := "-"}}
66
{{- $apm := "-"}}
77
{{- $appsearch := "-"}}
88
{{- $elasticsearch := "-"}}
9+
{{- $enterprisesearch := "-"}}
910
{{- range .Resources.Apm}}{{ $apm = .ID }}{{end}}
1011
{{- range .Resources.Appsearch}}{{ $appsearch = .ID }}{{end}}
12+
{{- range .Resources.EnterpriseSearch}}{{ $enterprisesearch = .ID }}{{end}}
1113
{{- range .Resources.Elasticsearch}}{{ $elasticsearch = .ID }}{{end}}
1214
{{- range .Resources.Kibana}}{{ $kibana = .ID }}{{end}}
13-
{{ .ID }}{{tab}}{{ .Name }}{{ tab }}{{$elasticsearch}}{{tab}}{{ $kibana }}{{ tab }}{{ $apm }}{{ tab }}{{ $appsearch }}
15+
{{ .ID }}{{tab}}{{ .Name }}{{ tab }}{{$elasticsearch}}{{tab}}{{ $kibana }}{{ tab }}{{ $apm }}{{ tab }}{{ $enterprisesearch }}{{ tab }}{{ $appsearch }}
1416
{{- end}}
1517
{{end}}

pkg/util/kinds.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

pkg/util/testing.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ func NewSuccessfulCurrentPlan(currentTime ...time.Time) mock.Response {
7373
}},
7474
}}},
7575
},
76+
EnterpriseSearch: []*models.EnterpriseSearchResourceInfo{
77+
{ID: ec.String(ValidClusterID), RefID: ec.String("main-appsearch"), Info: &models.EnterpriseSearchInfo{PlanInfo: &models.EnterpriseSearchPlansInfo{
78+
Current: &models.EnterpriseSearchPlanInfo{PlanAttemptLog: []*models.ClusterPlanStepInfo{
79+
{Status: ec.String("success"), StepID: ec.String("plan-completed"), Started: &now},
80+
}},
81+
}}},
82+
},
7683
Kibana: []*models.KibanaResourceInfo{
7784
{ID: ec.String(ValidClusterID), RefID: ec.String("main-kibana"), Info: &models.KibanaClusterInfo{PlanInfo: &models.KibanaClusterPlansInfo{
7885
Current: &models.KibanaClusterPlanInfo{PlanAttemptLog: []*models.ClusterPlanStepInfo{

pkg/util/track_test.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
"github.com/elastic/cloud-sdk-go/pkg/plan"
2525
"github.com/elastic/cloud-sdk-go/pkg/plan/planutil"
26+
"github.com/elastic/cloud-sdk-go/pkg/util"
2627
)
2728

2829
func TestSetClusterTracking(t *testing.T) {
@@ -37,26 +38,42 @@ func TestSetClusterTracking(t *testing.T) {
3738
want planutil.TrackChangeParams
3839
}{
3940
{
40-
args: args{id: "123", kind: Elasticsearch},
41+
args: args{id: "123", kind: util.Elasticsearch},
4142
want: planutil.TrackChangeParams{TrackChangeParams: plan.TrackChangeParams{
4243
ResourceID: "123",
43-
Kind: Elasticsearch,
44+
Kind: util.Elasticsearch,
4445
IgnoreDownstream: true,
4546
}},
4647
},
4748
{
48-
args: args{id: "123", kind: Kibana},
49+
args: args{id: "123", kind: util.Kibana},
4950
want: planutil.TrackChangeParams{TrackChangeParams: plan.TrackChangeParams{
5051
ResourceID: "123",
51-
Kind: Kibana,
52+
Kind: util.Kibana,
5253
IgnoreDownstream: true,
5354
}},
5455
},
5556
{
56-
args: args{id: "123", kind: Apm},
57+
args: args{id: "123", kind: util.Apm},
5758
want: planutil.TrackChangeParams{TrackChangeParams: plan.TrackChangeParams{
5859
ResourceID: "123",
59-
Kind: Apm,
60+
Kind: util.Apm,
61+
IgnoreDownstream: true,
62+
}},
63+
},
64+
{
65+
args: args{id: "123", kind: util.EnterpriseSearch},
66+
want: planutil.TrackChangeParams{TrackChangeParams: plan.TrackChangeParams{
67+
ResourceID: "123",
68+
Kind: util.EnterpriseSearch,
69+
IgnoreDownstream: true,
70+
}},
71+
},
72+
{
73+
args: args{id: "123", kind: util.Appsearch},
74+
want: planutil.TrackChangeParams{TrackChangeParams: plan.TrackChangeParams{
75+
ResourceID: "123",
76+
Kind: util.Appsearch,
6077
IgnoreDownstream: true,
6178
}},
6279
},

pkg/util/type.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717

1818
package util
1919

20-
var (
21-
// ValidTypes exposes a list of the valid Elastic Cloud workload Types.
22-
ValidTypes = []string{
23-
Elasticsearch,
24-
Kibana,
25-
Apm,
26-
Appsearch,
27-
}
28-
)
29-
3020
// Validator interface is mostly used for parameter structures that
3121
// need to check a set of conditions and act as a gate before running
3222
// expensive external calls

0 commit comments

Comments
 (0)