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

Rename migration.enabled to migration.6_to_7.enabled #11286

Merged
merged 5 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `cleanup_timeout` option to docker autodiscover, to wait some time before removing configurations after a container is stopped. {issue]10374[10374] {pull}10905[10905]
- On Google Cloud Engine (GCE) the add_cloud_metadata will now trim the project
info from the cloud.machine.type and cloud.availability_zone. {issue}10968[10968]
- Rename `migration.enabled` config to `migration.6_to_7.enabled`. {pull}11284[11284]

*Auditbeat*

Expand Down
4 changes: 2 additions & 2 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1266,5 +1266,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions auditbeat/auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1977,5 +1977,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
2 changes: 1 addition & 1 deletion filebeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_template_migration(self):
elasticsearch={"host": self.get_elasticsearch_url()},
)
exit_code = self.run_beat(extra_args=["setup", "--template",
"-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"])
"-E", "setup.template.overwrite=true", "-E", "migration.6_to_7.enabled=true"])

assert exit_code == 0
assert self.log_contains('Loaded index template')
Expand Down
2 changes: 1 addition & 1 deletion filebeat/tests/system/test_index_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_export_index_pattern_migration(self):
self.render_config_template()
exit_code = self.run_beat(
logging_args=[],
extra_args=["export", "index-pattern", "-E", "migration.enabled:true"])
extra_args=["export", "index-pattern", "-E", "migration.6_to_7.enabled:true"])

assert exit_code == 0
assert self.log_contains('"objects": [')
Expand Down
4 changes: 2 additions & 2 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1410,5 +1410,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions heartbeat/heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ output.elasticsearch:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions journalbeat/journalbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,5 +1206,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions journalbeat/journalbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions libbeat/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1154,5 +1154,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions libbeat/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
11 changes: 1 addition & 10 deletions libbeat/cmd/export/index_pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,12 @@ func GenIndexPatternConfigCmd(settings instance.Settings) *cobra.Command {
version = b.Info.Version
}

var withMigration bool
if b.RawConfig.HasField("migration") {
sub, err := b.RawConfig.Child("migration", -1)
if err != nil {
fatalf("Failed to read migration setting: %+v", err)
}
withMigration = sub.Enabled()
}

// Index pattern generation
v, err := common.NewVersion(version)
if err != nil {
fatalf("Error creating version: %+v", err)
}
indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, settings.Version, *v, withMigration)
indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, settings.Version, *v, b.Config.Migration.Enabled())
if err != nil {
log.Fatal(err)
}
Expand Down
11 changes: 1 addition & 10 deletions libbeat/cmd/export/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,7 @@ func GenTemplateConfigCmd(settings instance.Settings) *cobra.Command {
tmplCfg = template.DefaultConfig()
}

var withMigration bool
if b.RawConfig.HasField("migration") {
sub, err := b.RawConfig.Child("migration", -1)
if err != nil {
fatalf("Failed to read migration setting: %+v", err)
}
withMigration = sub.Enabled()
}

tmpl, err := template.New(b.Info.Version, index, *esVersion, tmplCfg, withMigration)
tmpl, err := template.New(b.Info.Version, index, *esVersion, tmplCfg, b.Config.Migration.Enabled())
if err != nil {
fatalf("Error generating template: %+v", err)
}
Expand Down
13 changes: 4 additions & 9 deletions libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ type beatConfig struct {
// elastic stack 'setup' configurations
Dashboards *common.Config `config:"setup.dashboards"`
Kibana *common.Config `config:"setup.kibana"`

// Migration config to migration from 6 to 7
Migration *common.Config `config:"migration.6_to_7"`
}

var debugf = logp.MakeDebug("beat")
Expand Down Expand Up @@ -694,14 +697,6 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error {
}

if b.Config.Dashboards.Enabled() {
var withMigration bool
if b.RawConfig.HasField("migration") {
sub, err := b.RawConfig.Child("migration", -1)
if err != nil {
return fmt.Errorf("Failed to read migration setting: %+v", err)
}
withMigration = sub.Enabled()
}

// Initialize kibana config. If username and password is set in elasticsearch output config but not in kibana,
// initKibanaConfig will attach the ussername and password into kibana config as a part of the initialization.
Expand All @@ -718,7 +713,7 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error {
// but it's assumed that KB and ES have the same minor version.
v := client.GetVersion()

indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, b.Info.Version, v, withMigration)
indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, b.Info.Version, v, b.Config.Migration.Enabled())
if err != nil {
return fmt.Errorf("error creating index pattern generator: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion libbeat/idxmgmt/idxmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func MakeDefaultSupport(ilmSupport ilm.SupportFactory) SupportFactory {
ILM *common.Config `config:"setup.ilm"`
Template *common.Config `config:"setup.template"`
Output common.ConfigNamespace `config:"output"`
Migration *common.Config `config:"migration"`
Migration *common.Config `config:"migration.6_to_7"`
}{}
if configRoot != nil {
if err := configRoot.Unpack(&cfg); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions libbeat/tests/system/test_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_migration_false(self):
extra_args=[
"export", "template",
"-E", "setup.template.fields=" + self.fields_path,
"-E", "migration.enabled=false",
"-E", "migration.6_to_7.enabled=false",
],
config="libbeat.yml")

Expand All @@ -64,7 +64,7 @@ def test_migration_true(self):
extra_args=[
"export", "template",
"-E", "setup.template.fields=" + self.fields_path,
"-E", "migration.enabled=true",
"-E", "migration.6_to_7.enabled=true",
],
config="libbeat.yml")

Expand Down
4 changes: 2 additions & 2 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1874,5 +1874,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions metricbeat/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
2 changes: 1 addition & 1 deletion metricbeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_migration(self):
elasticsearch={"host": self.get_elasticsearch_url()},
)
exit_code = self.run_beat(extra_args=["setup", "--template",
"-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"])
"-E", "setup.template.overwrite=true", "-E", "migration.6_to_7.enabled=true"])

assert exit_code == 0
assert self.log_contains('Loaded index template')
Expand Down
4 changes: 2 additions & 2 deletions packetbeat/packetbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1634,5 +1634,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions packetbeat/packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions winlogbeat/winlogbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,5 +1183,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions winlogbeat/winlogbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1301,5 +1301,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/auditbeat/auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2056,5 +2056,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/functionbeat/functionbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1299,5 +1299,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/functionbeat/functionbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1903,5 +1903,5 @@ logging.files:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false
4 changes: 2 additions & 2 deletions x-pack/metricbeat/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ processors:

#================================= Migration ==================================

# This allows to enable migration aliases
#migration.enabled: false
# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: false