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

Make stack.templates.enabled a dynamic setting #63764

Merged
merged 4 commits into from
Oct 16, 2020

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Oct 15, 2020

This change allows the setting for disabling the automatically installed stack templates (the
logs-*-*, metrics-*-*, and synthetics-*-* templates) to be changed dynamically.

As a byproduct, it also moves thes IndexTemplateRegistry to use an initialize() method so that
constructors are not tempted to use a this reference in the constructor (see #37861 and #38560
for more information about why we want to avoid that).

Resolves #62835

This change allows the setting for disabling the automatically installed stack templates (the
`logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically.

As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that
constructors are not tempted to use a `this` reference in the constructor (see elastic#37861 for more
information about why to avoid that).

Resolves elastic#62835
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Features)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 15, 2020
Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for working on this Lee

this.stackTemplateEnabled = true;
} else {
logger.info(
"stack composable templates [{}] and component templates [{}] will not be installed or reinstalled",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bit confusing as to why this happened. Should we also mention that the setting was updated and as a result, the templates will not be installed/reinstalled anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the settings infrastructure already logs a message to that effect, so this looks like:

[2020-10-16T09:16:27,285][INFO ][o.e.c.s.ClusterSettings  ] [runTask-0] updating [stack.templates.enabled] from [true] to [false]
[2020-10-16T09:16:27,286][INFO ][o.e.x.s.StackTemplateRegistry] [runTask-0] stack composable templates [logs,metrics,synthetics] and component templates [logs-mappings,logs-settings,metrics-mappings,metrics-settings,synthetics-mappings,synthetics-settings] will not be installed or reinstalled

That's why I left out any mention that the setting was updated (it happens regardless)

@dakrone dakrone merged commit 1872e97 into elastic:master Oct 16, 2020
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Oct 16, 2020
* Make stack.templates.enabled a dynamic setting

This change allows the setting for disabling the automatically installed stack templates (the
`logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically.

As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that
constructors are not tempted to use a `this` reference in the constructor (see elastic#37861 for more
information about why to avoid that).

Resolves elastic#62835
dakrone added a commit that referenced this pull request Oct 16, 2020
* Make stack.templates.enabled a dynamic setting

This change allows the setting for disabling the automatically installed stack templates (the
`logs-*-*`, `metrics-*-*`, and `synthetics-*-*` templates) to be changed dynamically.

As a byproduct, it also moves thes `IndexTemplateRegistry` to use an `initialize()` method so that
constructors are not tempted to use a `this` reference in the constructor (see #37861 for more
information about why to avoid that).

Resolves #62835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a setting to disable stack installed templates
5 participants