-
Notifications
You must be signed in to change notification settings - Fork 79
Add support for ES index-template configs #552
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,11 +36,12 @@ type Dataset struct { | |
| Type string `config:"type" json:"type" validate:"required"` | ||
| Name string `config:"name" json:"name,omitempty" yaml:"name,omitempty"` | ||
|
|
||
| Title string `config:"title" json:"title" validate:"required"` | ||
| Release string `config:"release" json:"release"` | ||
| IngestPipeline string `config:"ingest_pipeline,omitempty" config:"ingest_pipeline" json:"ingest_pipeline,omitempty" yaml:"ingest_pipeline,omitempty"` | ||
| Streams []Stream `config:"streams" json:"streams,omitempty" yaml:"streams,omitempty" ` | ||
| Package string `json:"package,omitempty" yaml:"package,omitempty"` | ||
| Title string `config:"title" json:"title" validate:"required"` | ||
| Release string `config:"release" json:"release"` | ||
| IngestPipeline string `config:"ingest_pipeline,omitempty" config:"ingest_pipeline" json:"ingest_pipeline,omitempty" yaml:"ingest_pipeline,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we have an
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I would say yes!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will such a change pose a problem in terms of BWC for existing manifests?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and no. After 7.9 we must stop doing these changes but until then we can still update old ones. The way I plan such changes are:
@ycombinator Any help getting this changes in is appreciated ;-)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm missing something about the plan but shouldn't there be an
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see, the plan is to introduce it in #564. |
||
| Streams []Stream `config:"streams" json:"streams,omitempty" yaml:"streams,omitempty" ` | ||
| Package string `json:"package,omitempty" yaml:"package,omitempty"` | ||
| Elasticsearch *Elasticsearch `config:"elasticsearch,omitempty" json:"elasticsearch,omitempty" yaml:"elasticsearch,omitempty"` | ||
|
|
||
| // Generated fields | ||
| Path string `json:"path,omitempty" yaml:"path,omitempty"` | ||
|
|
@@ -79,6 +80,11 @@ type Variable struct { | |
| Default interface{} `config:"default" json:"default,omitempty" yaml:"default,omitempty"` | ||
| } | ||
|
|
||
| type Elasticsearch struct { | ||
| IndexTemplateSettings map[string]interface{} `config:"index_template.settings" json:"index_template.settings,omitempty" yaml:"index_template.settings,omitempty"` | ||
| IndexTemplateMappings map[string]interface{} `config:"index_template.mappings" json:"index_template.mappings,omitempty" yaml:"index_template.mappings,omitempty"` | ||
| } | ||
|
|
||
| type fieldEntry struct { | ||
| name string | ||
| aType string | ||
|
|
@@ -106,7 +112,7 @@ func NewDataset(basePath string, p *Package) (*Dataset, error) { | |
| } | ||
|
|
||
| // go-ucfg automatically calls the `Validate` method on the Dataset object here | ||
| err = manifest.Unpack(d) | ||
| err = manifest.Unpack(d, ucfg.PathSep(".")) | ||
| if err != nil { | ||
| return nil, errors.Wrapf(err, "error building dataset (path: %s) in package: %s", datasetPath, p.Name) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you could break out the
index_templatekey into it's own level and nestmappingsandsettingsunder it, like you did intestdata/package/yamlpipeline/1.0.0/dataset/log/manifest.yml.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually didn't do it on purpose to make sure I test that both options work.