Skip to content

Commit

Permalink
Rename migration.enabled to migration.6_to_7.enabled (elastic#11286)
Browse files Browse the repository at this point in the history
This is to make it more clear this is for the migration from 6.7 to 7.0.

(cherry picked from commit 38c81eb)
  • Loading branch information
ruflin committed Mar 19, 2019
1 parent 5bdf992 commit bb9ffbf
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 83 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ https://github.com/elastic/beats/compare/v7.0.0-beta1...master[Check the HEAD di
- 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]
- 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]
- 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 @@ -1967,5 +1967,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 @@ -162,5 +162,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 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 @@ -695,14 +698,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 @@ -719,7 +714,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 @@ -1864,5 +1864,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 @@ -2038,5 +2038,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 @@ -1883,5 +1883,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

0 comments on commit bb9ffbf

Please sign in to comment.