Skip to content

Conversation

@jasontedor
Copy link
Member

By default, the remove plugin CLI command preserves configuration files. This is so that if a user is upgrading the plugin (which is done by first removing the old version and then installing the new version) they do not lose their configuration file. Yet, there are circumstances where preserving the configuration file is not desired. This commit adds a purge option to the remove plugin CLI command.

By default, the remove plugin CLI command preserves configuration
files. This is so that if a user is upgrading the plugin (which is done
by first removing the old version and then installing the new version)
they do not lose their configuration file. Yet, there are circumstances
where preserving the configuration file is not desired. This commit adds
a purge option to the remove plugin CLI command.
env = new Environment(settings);
}

static MockTerminal removePlugin(String name, Path home) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to add the argument and pass false all the places that call this unless there are far more callers that I can see.

Copy link
Member

Choose a reason for hiding this comment

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

In fact, I bet a few places should have randomBoolean() instead of false.

@jasontedor
Copy link
Member Author

@nik9000 I addressed your suggestion. I pushed a bigger change though which is to allow purge to be used after a plugin is removed to cleanup lingering config files. This necessitated removing the marker file that we drop in the specific plugin directory into the root plugin directory. Since this is a bigger change, can you take another look?

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

Makes sense to me. I think this breaks backwards compatibility with previous failure markers but that that is probably ok. I hope folks don't leave half removed plugins laying around for too long.

@jasontedor jasontedor merged commit 9b4a189 into elastic:master Jun 1, 2017
jasontedor added a commit that referenced this pull request Jun 1, 2017
By default, the remove plugin CLI command preserves configuration
files. This is so that if a user is upgrading the plugin (which is done
by first removing the old version and then installing the new version)
they do not lose their configuration file. Yet, there are circumstances
where preserving the configuration file is not desired. This commit adds
a purge option to the remove plugin CLI command.

Relates #24981
@jasontedor
Copy link
Member Author

Thanks @nik9000.

@jasontedor jasontedor deleted the remove-plugin-purge branch June 1, 2017 13:00
@jasontedor
Copy link
Member Author

jasontedor commented Jun 1, 2017

I think this breaks backwards compatibility with previous failure markers but that that is probably ok. I hope folks don't leave half removed plugins laying around for too long.

Indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants