Elasticsearch: Rename plugin from 'xpack' to 'x-pack'

This is just to be consistent with out naming, which is
supposed to be `x-pack`.

Closes elastic/elasticsearch#1759

Original commit: elastic/x-pack-elasticsearch@0697f70855
This commit is contained in:
Alexander Reelsen 2016-03-30 09:07:57 +02:00
parent d4e3282666
commit e0fcbcbb51
40 changed files with 69 additions and 65 deletions

View File

@ -10,7 +10,7 @@ integTest {
setting 'shield.audit.enabled', 'true' setting 'shield.audit.enabled', 'true'
setting 'shield.audit.outputs', 'index' setting 'shield.audit.outputs', 'index'
setupCommand 'setupDummyUser', setupCommand 'setupDummyUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -8,9 +8,9 @@ integTest {
cluster { cluster {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
setupCommand 'setupDummyUser', setupCommand 'setupDummyUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
setupCommand 'setupTransportClientUser', setupCommand 'setupTransportClientUser',
'bin/xpack/users', 'useradd', 'transport', '-p', 'changeme', '-r', 'transport_client' 'bin/x-pack/users', 'useradd', 'transport', '-p', 'changeme', '-r', 'transport_client'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -37,7 +37,7 @@ integTest {
setting 'xpack.watcher.enabled', 'false' setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false' setting 'xpack.monitoring.enabled', 'false'
setupCommand 'setupDummyUser', setupCommand 'setupDummyUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -28,7 +28,7 @@ processResources {
} }
task buildZip(type:Zip, dependsOn: [jar]) { task buildZip(type:Zip, dependsOn: [jar]) {
from 'build/resources/main/xpack-extension-descriptor.properties' from 'build/resources/main/x-pack-extension-descriptor.properties'
from project.jar from project.jar
} }
@ -42,9 +42,9 @@ task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn:
setting 'shield.authc.realms.esusers.type', 'file' setting 'shield.authc.realms.esusers.type', 'file'
setupCommand 'setupDummyUser', setupCommand 'setupDummyUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
setupCommand 'installExtension', setupCommand 'installExtension',
'bin/xpack/extension', 'install', 'file:' + buildZip.archivePath 'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -8,7 +8,7 @@ integTest {
cluster { cluster {
setting 'script.inline', 'true' setting 'script.inline', 'true'
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
extraConfigFile 'xpack/roles.yml', 'roles.yml' extraConfigFile 'x-pack/roles.yml', 'roles.yml'
[ [
test_admin: 'admin', test_admin: 'admin',
powerful_user: 'admin', powerful_user: 'admin',
@ -19,7 +19,7 @@ integTest {
can_not_see_hidden_fields_user: 'can_not_see_hidden_fields', can_not_see_hidden_fields_user: 'can_not_see_hidden_fields',
].each { String user, String role -> ].each { String user, String role ->
setupCommand 'setupUser#' + user, setupCommand 'setupUser#' + user,
'bin/xpack/users', 'useradd', user, '-p', 'changeme', '-r', role 'bin/x-pack/users', 'useradd', user, '-p', 'changeme', '-r', role
} }
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')

View File

@ -75,10 +75,10 @@
<property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/> <property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
<echo>Adding roles.yml</echo> <echo>Adding roles.yml</echo>
<copy file="shield-roles.yml" tofile="${home}/config/xpack/roles.yml" overwrite="true"/> <copy file="shield-roles.yml" tofile="${home}/config/x-pack/roles.yml" overwrite="true"/>
<echo>Adding shield users...</echo> <echo>Adding shield users...</echo>
<run-script script="${home}/bin/xpack/esusers"> <run-script script="${home}/bin/x-pack/esusers">
<nested> <nested>
<arg value="useradd"/> <arg value="useradd"/>
<arg value="test_admin"/> <arg value="test_admin"/>

View File

@ -63,10 +63,10 @@
<property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/> <property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
<echo>Adding roles.yml with watcher roles</echo> <echo>Adding roles.yml with watcher roles</echo>
<copy file="watcher-with-shield-roles.yml" tofile="${home}/config/xpack/roles.yml" overwrite="true"/> <copy file="watcher-with-shield-roles.yml" tofile="${home}/config/x-pack/roles.yml" overwrite="true"/>
<echo>Adding shield users...</echo> <echo>Adding shield users...</echo>
<run-script script="${home}/bin/xpack/esusers"> <run-script script="${home}/bin/x-pack/esusers">
<nested> <nested>
<arg value="useradd"/> <arg value="useradd"/>
<arg value="test_admin"/> <arg value="test_admin"/>
@ -76,7 +76,7 @@
<arg value="admin"/> <arg value="admin"/>
</nested> </nested>
</run-script> </run-script>
<run-script script="${home}/bin/xpack/esusers"> <run-script script="${home}/bin/x-pack/esusers">
<nested> <nested>
<arg value="useradd"/> <arg value="useradd"/>
<arg value="watcher_manager"/> <arg value="watcher_manager"/>
@ -86,7 +86,7 @@
<arg value="watcher_manager"/> <arg value="watcher_manager"/>
</nested> </nested>
</run-script> </run-script>
<run-script script="${home}/bin/xpack/esusers"> <run-script script="${home}/bin/x-pack/esusers">
<nested> <nested>
<arg value="useradd"/> <arg value="useradd"/>
<arg value="powerless_user"/> <arg value="powerless_user"/>

View File

@ -16,13 +16,13 @@ integTest {
cluster { cluster {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
extraConfigFile 'xpack/roles.yml', 'roles.yml' extraConfigFile 'x-pack/roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser', setupCommand 'setupTestAdminUser',
'bin/xpack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin'
setupCommand 'setupGraphExplorerUser', setupCommand 'setupGraphExplorerUser',
'bin/xpack/users', 'useradd', 'graph_explorer', '-p', 'changeme', '-r', 'graph_explorer' 'bin/x-pack/users', 'useradd', 'graph_explorer', '-p', 'changeme', '-r', 'graph_explorer'
setupCommand 'setupPowerlessUser', setupCommand 'setupPowerlessUser',
'bin/xpack/users', 'useradd', 'no_graph_explorer', '-p', 'changeme', '-r', 'no_graph_explorer' 'bin/x-pack/users', 'useradd', 'no_graph_explorer', '-p', 'changeme', '-r', 'no_graph_explorer'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -165,9 +165,9 @@ integTest {
extraConfigFile clientKeyStore.name, clientKeyStore extraConfigFile clientKeyStore.name, clientKeyStore
setupCommand 'setupTestUser', setupCommand 'setupTestUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
setupCommand 'setupMarvelUser', setupCommand 'setupMarvelUser',
'bin/xpack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent' 'bin/x-pack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent'
waitCondition = { node, ant -> waitCondition = { node, ant ->
// HTTPS check is tricky to do, so we wait for the log file to indicate that the node is started // HTTPS check is tricky to do, so we wait for the log file to indicate that the node is started

View File

@ -18,7 +18,7 @@ integTest {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
setupCommand 'setupDummyUser', setupCommand 'setupDummyUser',
'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -20,13 +20,13 @@ integTest {
cluster { cluster {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack') plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
extraConfigFile 'xpack/roles.yml', 'roles.yml' extraConfigFile 'x-pack/roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser', setupCommand 'setupTestAdminUser',
'bin/xpack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin' 'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'admin'
setupCommand 'setupWatcherManagerUser', setupCommand 'setupWatcherManagerUser',
'bin/xpack/users', 'useradd', 'watcher_manager', '-p', 'changeme', '-r', 'watcher_manager' 'bin/x-pack/users', 'useradd', 'watcher_manager', '-p', 'changeme', '-r', 'watcher_manager'
setupCommand 'setupPowerlessUser', setupCommand 'setupPowerlessUser',
'bin/xpack/users', 'useradd', 'powerless_user', '-p', 'changeme', '-r', 'crappy_role' 'bin/x-pack/users', 'useradd', 'powerless_user', '-p', 'changeme', '-r', 'crappy_role'
waitCondition = { node, ant -> waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",

View File

@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then
case "$properties" in case "$properties" in
*-Des.default.path.conf=*) ;; *-Des.default.path.conf=*) ;;
*) *)
if [ ! -d "$CONF_DIR/xpack" ]; then if [ ! -d "$CONF_DIR/x-pack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The extension tool expects security configuration files in that location." echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The extension tool expects security configuration files in that location."
echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1 exit 1
fi fi
properties="$properties -Des.default.path.conf=$CONF_DIR" properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -107,7 +107,7 @@ fi
export HOSTNAME=`hostname -s` export HOSTNAME=`hostname -s`
# include x-pack jars in classpath # include x-pack jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*"
cd "$ES_HOME" > /dev/null cd "$ES_HOME" > /dev/null
"$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.xpack.extensions.XPackExtensionCli "$@" "$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.xpack.extensions.XPackExtensionCli "$@"

View File

@ -5,7 +5,7 @@ group 'org.elasticsearch.plugin'
apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.esplugin'
esplugin { esplugin {
name 'xpack' name 'x-pack'
description 'Elasticsearch Expanded Pack Plugin' description 'Elasticsearch Expanded Pack Plugin'
classname 'org.elasticsearch.xpack.XPackPlugin' classname 'org.elasticsearch.xpack.XPackPlugin'
} }
@ -112,16 +112,16 @@ bundlePlugin {
include 'LICENSE.txt' include 'LICENSE.txt'
include 'NOTICE.txt' include 'NOTICE.txt'
} }
from('bin/xpack') { from('bin/x-pack') {
into 'bin' into 'bin'
} }
from('shield/bin/xpack') { from('shield/bin/x-pack') {
into 'bin' into 'bin'
} }
from('shield/config/xpack') { from('shield/config/x-pack') {
into 'config' into 'config'
} }
from('watcher/bin/xpack') { from('watcher/bin/x-pack') {
into 'bin' into 'bin'
} }
} }
@ -130,7 +130,7 @@ integTest {
// TODO: fix this rest test to not depend on a hardcoded port! // TODO: fix this rest test to not depend on a hardcoded port!
systemProperty 'tests.rest.blacklist', 'getting_started/10_monitor_cluster_health/*' systemProperty 'tests.rest.blacklist', 'getting_started/10_monitor_cluster_health/*'
cluster { cluster {
setupCommand 'setupDummyUser', 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' setupCommand 'setupDummyUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
waitCondition = { NodeInfo node, AntBuilder ant -> waitCondition = { NodeInfo node, AntBuilder ant ->
File tmpFile = new File(node.cwd, 'wait.success') File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}", ant.get(src: "http://${node.httpUri()}",
@ -158,7 +158,7 @@ artifacts {
} }
run { run {
setupCommand 'setupDummyUser', 'bin/xpack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' setupCommand 'setupDummyUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
} }
// classes are missing, e.g. com.ibm.icu.lang.UCharacter // classes are missing, e.g. com.ibm.icu.lang.UCharacter

View File

@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then
case "$properties" in case "$properties" in
*-Des.default.path.conf=*) ;; *-Des.default.path.conf=*) ;;
*) *)
if [ ! -d "$CONF_DIR/xpack" ]; then if [ ! -d "$CONF_DIR/x-pack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The syskeygen tool expects security configuration files in that location." echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The syskeygen tool expects security configuration files in that location."
echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1 exit 1
fi fi
properties="$properties -Des.default.path.conf=$CONF_DIR" properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -115,7 +115,7 @@ fi
export HOSTNAME=`hostname -s` export HOSTNAME=`hostname -s`
# include shield jars in classpath # include shield jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*"
# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu)
# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487

View File

@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then
case "$properties" in case "$properties" in
*-Des.default.path.conf=*) ;; *-Des.default.path.conf=*) ;;
*) *)
if [ ! -d "$CONF_DIR/xpack" ]; then if [ ! -d "$CONF_DIR/x-pack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] does not exist. The users tool expects security configuration files in that location." echo "ERROR: The configuration directory [$CONF_DIR/x-pack] does not exist. The users tool expects security configuration files in that location."
echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/xpack] exists, please copy the 'xpack' directory to [$CONF_DIR]" echo "The plugin may not have been installed with the correct configuration path. If [$ES_HOME/config/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1 exit 1
fi fi
properties="$properties -Des.default.path.conf=$CONF_DIR" properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -115,7 +115,7 @@ fi
export HOSTNAME=`hostname -s` export HOSTNAME=`hostname -s`
# include shield jars in classpath # include shield jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*"
# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu)
# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487

View File

@ -167,7 +167,7 @@ public class FileUserPasswdStore {
} }
if (users.isEmpty()) { if (users.isEmpty()) {
logger.warn("no users found in users file [{}]. use bin/xpack/file to add users and role mappings", path.toAbsolutePath()); logger.warn("no users found in users file [{}]. use bin/x-pack/users to add users and role mappings", path.toAbsolutePath());
} }
return unmodifiableMap(users); return unmodifiableMap(users);
} }

View File

@ -181,7 +181,7 @@ public class FileUserRolesStore {
} }
if (usersRoles.isEmpty()) { if (usersRoles.isEmpty()) {
logger.warn("no entries found in users_roles file [{}]. use bin/xpack/file to add users and role mappings", path logger.warn("no entries found in users_roles file [{}]. use bin/xpack/users to add users and role mappings", path
.toAbsolutePath()); .toAbsolutePath());
} }

View File

@ -9,7 +9,7 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
Generates the system key and stores in the system_key file. By default Generates the system key and stores in the system_key file. By default
it will be stored in 'config/xpack/system_key' file. If the file location it will be stored in 'config/x-pack/system_key' file. If the file location
is customized in the elasticsearch.yml (under the 'shield.system_key.file' is customized in the elasticsearch.yml (under the 'shield.system_key.file'
setting), the generated key will be stored in that custom location. setting), the generated key will be stored in that custom location.

View File

@ -28,6 +28,7 @@ import org.elasticsearch.env.Environment;
import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests; import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.xpack.XPackPlugin;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@ -56,7 +57,7 @@ public class UsersToolTests extends CommandTestCase {
public void setupHome() throws IOException { public void setupHome() throws IOException {
Path homeDir = jimfs.getPath("eshome"); Path homeDir = jimfs.getPath("eshome");
IOUtils.rm(homeDir); IOUtils.rm(homeDir);
confDir = homeDir.resolve("config").resolve("xpack"); confDir = homeDir.resolve("config").resolve(XPackPlugin.NAME);
Files.createDirectories(confDir); Files.createDirectories(confDir);
Files.write(confDir.resolve("users"), Arrays.asList( Files.write(confDir.resolve("users"), Arrays.asList(
"existing_user:" + new String(Hasher.BCRYPT.hash(new SecuredString("changeme".toCharArray()))), "existing_user:" + new String(Hasher.BCRYPT.hash(new SecuredString("changeme".toCharArray()))),

View File

@ -64,7 +64,7 @@ public class SystemKeyToolTests extends CommandTestCase {
public void testGenerateDefaultPath() throws Exception { public void testGenerateDefaultPath() throws Exception {
assumeTrue("test cannot run with security manager enabled", System.getSecurityManager() == null); assumeTrue("test cannot run with security manager enabled", System.getSecurityManager() == null);
Path keyPath = homeDir.resolve("config/xpack/system_key"); Path keyPath = homeDir.resolve("config/x-pack/system_key");
Files.createDirectories(keyPath.getParent()); Files.createDirectories(keyPath.getParent());
execute(); execute();
byte[] bytes = Files.readAllBytes(keyPath); byte[] bytes = Files.readAllBytes(keyPath);

View File

@ -39,7 +39,10 @@ import java.util.Collections;
public class XPackPlugin extends Plugin { public class XPackPlugin extends Plugin {
public static final String NAME = "xpack"; public static final String NAME = "x-pack";
// inside of YAML settings we still use xpack do not having handle issues with dashes
public static final String SETTINGS_NAME = "xpack";
// TODO: clean up this library to not ask for write access to all system properties! // TODO: clean up this library to not ask for write access to all system properties!
static { static {
@ -228,7 +231,7 @@ public class XPackPlugin extends Plugin {
} }
public static String featureSettingPrefix(String featureName) { public static String featureSettingPrefix(String featureName) {
return NAME + "." + featureName; return SETTINGS_NAME + "." + featureName;
} }
public static String legacyFeatureEnabledSetting(String featureName) { public static String legacyFeatureEnabledSetting(String featureName) {
@ -251,6 +254,6 @@ public class XPackPlugin extends Plugin {
} }
public static Path resolveXPackExtensionsFile(Environment env) { public static Path resolveXPackExtensionsFile(Environment env) {
return env.pluginsFile().resolve("xpack").resolve("extensions"); return env.pluginsFile().resolve(XPackPlugin.NAME).resolve("extensions");
} }
} }

View File

@ -46,7 +46,7 @@ import static org.elasticsearch.cli.Terminal.Verbosity.VERBOSE;
* directory in order to verify the extension satisfies the following requirements: * directory in order to verify the extension satisfies the following requirements:
* <ul> * <ul>
* <li>The property file exists and contains valid metadata. See {@link XPackExtensionInfo#readFromProperties(Path)}</li> * <li>The property file exists and contains valid metadata. See {@link XPackExtensionInfo#readFromProperties(Path)}</li>
* <li>Jar hell does not exist, either between the extension's own jars or with the parent classloader (elasticsearch + xpack)</li> * <li>Jar hell does not exist, either between the extension's own jars or with the parent classloader (elasticsearch + x-pack)</li>
* </ul> * </ul>
*/ */
class InstallXPackExtensionCommand extends Command { class InstallXPackExtensionCommand extends Command {

View File

@ -55,7 +55,7 @@ class RemoveXPackExtensionCommand extends Command {
Path extensionDir = resolveXPackExtensionsFile(env).resolve(extensionName); Path extensionDir = resolveXPackExtensionsFile(env).resolve(extensionName);
if (Files.exists(extensionDir) == false) { if (Files.exists(extensionDir) == false) {
throw new UserError(ExitCodes.USAGE, throw new UserError(ExitCodes.USAGE,
"Extension " + extensionName + " not found. Run 'bin/xpack/extension list' to get list of installed extensions."); "Extension " + extensionName + " not found. Run 'bin/x-pack/extension list' to get list of installed extensions.");
} }
List<Path> extensionPaths = new ArrayList<>(); List<Path> extensionPaths = new ArrayList<>();

View File

@ -15,7 +15,7 @@ import java.nio.file.Path;
import java.util.Properties; import java.util.Properties;
public class XPackExtensionInfo { public class XPackExtensionInfo {
public static final String XPACK_EXTENSION_PROPERTIES = "xpack-extension-descriptor.properties"; public static final String XPACK_EXTENSION_PROPERTIES = "x-pack-extension-descriptor.properties";
private String name; private String name;
private String description; private String description;

View File

@ -91,14 +91,14 @@ public class InstallXPackExtensionCommandTests extends ESTestCase {
} }
void assertExtension(String name, Path original, Environment env) throws IOException { void assertExtension(String name, Path original, Environment env) throws IOException {
Path got = env.pluginsFile().resolve("xpack").resolve("extensions").resolve(name); Path got = env.pluginsFile().resolve("x-pack").resolve("extensions").resolve(name);
assertTrue("dir " + name + " exists", Files.exists(got)); assertTrue("dir " + name + " exists", Files.exists(got));
assertTrue("jar was copied", Files.exists(got.resolve("extension.jar"))); assertTrue("jar was copied", Files.exists(got.resolve("extension.jar")));
assertInstallCleaned(env); assertInstallCleaned(env);
} }
void assertInstallCleaned(Environment env) throws IOException { void assertInstallCleaned(Environment env) throws IOException {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(env.pluginsFile().resolve("xpack").resolve("extensions"))) { try (DirectoryStream<Path> stream = Files.newDirectoryStream(env.pluginsFile().resolve("x-pack").resolve("extensions"))) {
for (Path file : stream) { for (Path file : stream) {
if (file.getFileName().toString().startsWith(".installing")) { if (file.getFileName().toString().startsWith(".installing")) {
fail("Installation dir still exists, " + file); fail("Installation dir still exists, " + file);
@ -179,7 +179,7 @@ public class InstallXPackExtensionCommandTests extends ESTestCase {
NoSuchFileException e = expectThrows(NoSuchFileException.class, () -> { NoSuchFileException e = expectThrows(NoSuchFileException.class, () -> {
installExtension(extZip, env); installExtension(extZip, env);
}); });
assertTrue(e.getMessage(), e.getMessage().contains("xpack-extension-descriptor.properties")); assertTrue(e.getMessage(), e.getMessage().contains("x-pack-extension-descriptor.properties"));
assertInstallCleaned(env); assertInstallCleaned(env);
} }
} }

View File

@ -28,7 +28,7 @@ public class ListXPackExtensionCommandTests extends ESTestCase {
} }
Path createExtensionDir(Environment env) throws IOException { Path createExtensionDir(Environment env) throws IOException {
Path path = env.pluginsFile().resolve("xpack").resolve("extensions"); Path path = env.pluginsFile().resolve("x-pack").resolve("extensions");
return Files.createDirectories(path); return Files.createDirectories(path);
} }

View File

@ -30,7 +30,7 @@ public class RemoveXPackExtensionCommandTests extends ESTestCase {
} }
Path createExtensionDir(Environment env) throws IOException { Path createExtensionDir(Environment env) throws IOException {
Path path = env.pluginsFile().resolve("xpack").resolve("extensions"); Path path = env.pluginsFile().resolve("x-pack").resolve("extensions");
return Files.createDirectories(path); return Files.createDirectories(path);
} }

View File

@ -10,4 +10,4 @@
- do: - do:
nodes.info: {} nodes.info: {}
- match: { nodes.$master.plugins.0.name: xpack } - match: { nodes.$master.plugins.0.name: x-pack }

View File

@ -106,7 +106,7 @@ fi
export HOSTNAME=`hostname -s` export HOSTNAME=`hostname -s`
# include watcher jars in classpath # include watcher jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/xpack/*" ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/x-pack/*"
# don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu) # don't let JAVA_TOOL_OPTIONS slip in (e.g. crazy agents in ubuntu)
# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487 # works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487