Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for Elasticsearch v5/v6 #5448

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions plugin/storage/es/mappings/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ type MappingBuilder struct {
func (mb *MappingBuilder) GetMapping(mapping string) (string, error) {
if mb.EsVersion == 8 {
return mb.fixMapping(mapping + "-8.json")
} else if mb.EsVersion == 7 {
return mb.fixMapping(mapping + "-7.json")
}
return mb.fixMapping(mapping + ".json")
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
return mb.fixMapping(mapping + "-7.json")
}

// GetSpanServiceMappings returns span and service mappings
Expand Down
67 changes: 1 addition & 66 deletions plugin/storage/es/mappings/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ func TestMappingBuilder_GetMapping(t *testing.T) {
}{
{mapping: "jaeger-span", esVersion: 8},
{mapping: "jaeger-span", esVersion: 7},
{mapping: "jaeger-span", esVersion: 6},
{mapping: "jaeger-service", esVersion: 8},
{mapping: "jaeger-service", esVersion: 7},
{mapping: "jaeger-service", esVersion: 6},
{mapping: "jaeger-dependencies", esVersion: 8},
{mapping: "jaeger-dependencies", esVersion: 7},
{mapping: "jaeger-dependencies", esVersion: 6},
}
for _, tt := range tests {
t.Run(tt.mapping, func(t *testing.T) {
Expand All @@ -67,10 +64,7 @@ func TestMappingBuilder_GetMapping(t *testing.T) {
got, err := mb.GetMapping(tt.mapping)
require.NoError(t, err)
var wantbytes []byte
fileSuffix := ""
if tt.esVersion >= 7 {
fileSuffix = fmt.Sprintf("-%d", tt.esVersion)
}
fileSuffix := fmt.Sprintf("-%d", tt.esVersion)
wantbytes, err = FIXTURES.ReadFile("fixtures/" + tt.mapping + fileSuffix + ".json")
require.NoError(t, err)
want := string(wantbytes)
Expand Down Expand Up @@ -219,65 +213,6 @@ func TestMappingBuilder_GetSpanServiceMappings(t *testing.T) {
},
err: "template load error",
},

{
name: "ES Version < 7",
args: args{
shards: 3,
replicas: 3,
esVersion: 6,
indexPrefix: "test",
useILM: true,
ilmPolicyName: "jaeger-test-policy",
},
mockNewTextTemplateBuilder: func() es.TemplateBuilder {
tb := mocks.TemplateBuilder{}
ta := mocks.TemplateApplier{}
ta.On("Execute", mock.Anything, mock.Anything).Return(nil)
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "",
},
{
name: "ES Version < 7 Service Error",
args: args{
shards: 3,
replicas: 3,
esVersion: 6,
indexPrefix: "test",
useILM: true,
ilmPolicyName: "jaeger-test-policy",
},
mockNewTextTemplateBuilder: func() es.TemplateBuilder {
tb := mocks.TemplateBuilder{}
ta := mocks.TemplateApplier{}
ta.On("Execute", mock.Anything, mock.Anything).Return(nil).Once()
ta.On("Execute", mock.Anything, mock.Anything).Return(errors.New("template load error")).Once()
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "template load error",
},
{
name: "ES Version < 7 Span Error",
args: args{
shards: 3,
replicas: 3,
esVersion: 6,
indexPrefix: "test",
useILM: true,
ilmPolicyName: "jaeger-test-policy",
},
mockNewTextTemplateBuilder: func() es.TemplateBuilder {
tb := mocks.TemplateBuilder{}
ta := mocks.TemplateApplier{}
ta.On("Execute", mock.Anything, mock.Anything).Return(errors.New("template load error"))
tb.On("Parse", mock.Anything).Return(&ta, nil)
return &tb
},
err: "template load error",
},
{
name: "ES Version 7 Span Error",
args: args{
Expand Down
Loading