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.outputs', 'index'
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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",

View File

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

View File

@ -37,7 +37,7 @@ integTest {
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",

View File

@ -28,7 +28,7 @@ processResources {
}
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
}
@ -42,9 +42,9 @@ task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn:
setting 'shield.authc.realms.esusers.type', 'file'
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',
'bin/xpack/extension', 'install', 'file:' + buildZip.archivePath
'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath
waitCondition = { node, ant ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",
@ -58,4 +58,4 @@ task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn:
}
}
check.dependsOn integTest
integTest.mustRunAfter precommit
integTest.mustRunAfter precommit

View File

@ -8,7 +8,7 @@ integTest {
cluster {
setting 'script.inline', 'true'
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',
powerful_user: 'admin',
@ -19,7 +19,7 @@ integTest {
can_not_see_hidden_fields_user: 'can_not_see_hidden_fields',
].each { String user, String role ->
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 ->
File tmpFile = new File(node.cwd, 'wait.success')

View File

@ -75,10 +75,10 @@
<property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
<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>
<run-script script="${home}/bin/xpack/esusers">
<run-script script="${home}/bin/x-pack/esusers">
<nested>
<arg value="useradd"/>
<arg value="test_admin"/>

View File

@ -63,10 +63,10 @@
<property name="home" location="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
<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>
<run-script script="${home}/bin/xpack/esusers">
<run-script script="${home}/bin/x-pack/esusers">
<nested>
<arg value="useradd"/>
<arg value="test_admin"/>
@ -76,7 +76,7 @@
<arg value="admin"/>
</nested>
</run-script>
<run-script script="${home}/bin/xpack/esusers">
<run-script script="${home}/bin/x-pack/esusers">
<nested>
<arg value="useradd"/>
<arg value="watcher_manager"/>
@ -86,7 +86,7 @@
<arg value="watcher_manager"/>
</nested>
</run-script>
<run-script script="${home}/bin/xpack/esusers">
<run-script script="${home}/bin/x-pack/esusers">
<nested>
<arg value="useradd"/>
<arg value="powerless_user"/>

View File

@ -16,13 +16,13 @@ integTest {
cluster {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
extraConfigFile 'xpack/roles.yml', 'roles.yml'
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
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',
'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',
'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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",

View File

@ -165,9 +165,9 @@ integTest {
extraConfigFile clientKeyStore.name, clientKeyStore
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',
'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 ->
// 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')
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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",

View File

@ -20,13 +20,13 @@ integTest {
cluster {
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
extraConfigFile 'xpack/roles.yml', 'roles.yml'
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
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',
'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',
'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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",

View File

@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then
case "$properties" in
*-Des.default.path.conf=*) ;;
*)
if [ ! -d "$CONF_DIR/xpack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] 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]"
if [ ! -d "$CONF_DIR/x-pack" ]; then
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/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1
fi
properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -107,10 +107,10 @@ fi
export HOSTNAME=`hostname -s`
# 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
"$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.xpack.extensions.XPackExtensionCli "$@"
status=$?
cd - > /dev/null
exit $status
exit $status

View File

@ -5,7 +5,7 @@ group 'org.elasticsearch.plugin'
apply plugin: 'elasticsearch.esplugin'
esplugin {
name 'xpack'
name 'x-pack'
description 'Elasticsearch Expanded Pack Plugin'
classname 'org.elasticsearch.xpack.XPackPlugin'
}
@ -112,16 +112,16 @@ bundlePlugin {
include 'LICENSE.txt'
include 'NOTICE.txt'
}
from('bin/xpack') {
from('bin/x-pack') {
into 'bin'
}
from('shield/bin/xpack') {
from('shield/bin/x-pack') {
into 'bin'
}
from('shield/config/xpack') {
from('shield/config/x-pack') {
into 'config'
}
from('watcher/bin/xpack') {
from('watcher/bin/x-pack') {
into 'bin'
}
}
@ -130,7 +130,7 @@ integTest {
// TODO: fix this rest test to not depend on a hardcoded port!
systemProperty 'tests.rest.blacklist', 'getting_started/10_monitor_cluster_health/*'
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 ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.get(src: "http://${node.httpUri()}",
@ -158,7 +158,7 @@ artifacts {
}
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

View File

@ -94,9 +94,9 @@ if [ -e "$CONF_DIR" ]; then
case "$properties" in
*-Des.default.path.conf=*) ;;
*)
if [ ! -d "$CONF_DIR/xpack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] 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]"
if [ ! -d "$CONF_DIR/x-pack" ]; then
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/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1
fi
properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -115,7 +115,7 @@ fi
export HOSTNAME=`hostname -s`
# 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)
# 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
*-Des.default.path.conf=*) ;;
*)
if [ ! -d "$CONF_DIR/xpack" ]; then
echo "ERROR: The configuration directory [$CONF_DIR/xpack] 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]"
if [ ! -d "$CONF_DIR/x-pack" ]; then
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/x-pack] exists, please copy the 'x-pack' directory to [$CONF_DIR]"
exit 1
fi
properties="$properties -Des.default.path.conf=$CONF_DIR"
@ -115,7 +115,7 @@ fi
export HOSTNAME=`hostname -s`
# 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)
# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487

View File

@ -167,7 +167,7 @@ public class FileUserPasswdStore {
}
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);
}

View File

@ -181,7 +181,7 @@ public class FileUserRolesStore {
}
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());
}

View File

@ -9,7 +9,7 @@ SYNOPSIS
DESCRIPTION
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'
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.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.xpack.XPackPlugin;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@ -56,7 +57,7 @@ public class UsersToolTests extends CommandTestCase {
public void setupHome() throws IOException {
Path homeDir = jimfs.getPath("eshome");
IOUtils.rm(homeDir);
confDir = homeDir.resolve("config").resolve("xpack");
confDir = homeDir.resolve("config").resolve(XPackPlugin.NAME);
Files.createDirectories(confDir);
Files.write(confDir.resolve("users"), Arrays.asList(
"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 {
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());
execute();
byte[] bytes = Files.readAllBytes(keyPath);

View File

@ -39,7 +39,10 @@ import java.util.Collections;
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!
static {
@ -228,7 +231,7 @@ public class XPackPlugin extends Plugin {
}
public static String featureSettingPrefix(String featureName) {
return NAME + "." + featureName;
return SETTINGS_NAME + "." + featureName;
}
public static String legacyFeatureEnabledSetting(String featureName) {
@ -251,6 +254,6 @@ public class XPackPlugin extends Plugin {
}
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:
* <ul>
* <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>
*/
class InstallXPackExtensionCommand extends Command {

View File

@ -55,7 +55,7 @@ class RemoveXPackExtensionCommand extends Command {
Path extensionDir = resolveXPackExtensionsFile(env).resolve(extensionName);
if (Files.exists(extensionDir) == false) {
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<>();

View File

@ -15,7 +15,7 @@ import java.nio.file.Path;
import java.util.Properties;
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 description;

View File

@ -91,14 +91,14 @@ public class InstallXPackExtensionCommandTests extends ESTestCase {
}
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("jar was copied", Files.exists(got.resolve("extension.jar")));
assertInstallCleaned(env);
}
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) {
if (file.getFileName().toString().startsWith(".installing")) {
fail("Installation dir still exists, " + file);
@ -179,7 +179,7 @@ public class InstallXPackExtensionCommandTests extends ESTestCase {
NoSuchFileException e = expectThrows(NoSuchFileException.class, () -> {
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);
}
}

View File

@ -28,7 +28,7 @@ public class ListXPackExtensionCommandTests extends ESTestCase {
}
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);
}

View File

@ -30,7 +30,7 @@ public class RemoveXPackExtensionCommandTests extends ESTestCase {
}
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);
}

View File

@ -10,4 +10,4 @@
- do:
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`
# 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)
# works around https://bugs.launchpad.net/ubuntu/+source/jayatana/+bug/1441487