Skip to content
Merged
Changes from all commits
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
Add detection of source.mode synthetics for 8.17.2 onwards
  • Loading branch information
mrodm committed Feb 12, 2025
commit e35f7e390826b03f32462d32357a4f8ad33c9aa0
10 changes: 8 additions & 2 deletions internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,12 @@ func isSyntheticSourceModeEnabled(ctx context.Context, api *elasticsearch.API, d
} `json:"mappings"`
Settings struct {
Index struct {
Mode string `json:"mode"`
Mode string `json:"mode"`
Mapping struct {
Source struct {
Mode string `json:"mode"`
} `json:"source"`
} `json:"mapping"`
} `json:"index"`
} `json:"settings"`
} `json:"template"`
Expand All @@ -691,7 +696,8 @@ func isSyntheticSourceModeEnabled(ctx context.Context, api *elasticsearch.API, d
return false, fmt.Errorf("could not decode index template simulation response: %w", err)
}

if results.Template.Mappings.Source.Mode == "synthetic" {
// in 8.17.2 source mode definition is now under settings object
if results.Template.Mappings.Source.Mode == "synthetic" || results.Template.Settings.Index.Mapping.Source.Mode == "synthetic" {
return true, nil
}

Expand Down