Upgrade API should work with TRIAL license as well (elastic/x-pack-elasticsearch#1567)
Relates to elastic/x-pack-elasticsearch#1214 Original commit: elastic/x-pack-elasticsearch@2ad7e389fb
This commit is contained in:
parent
568802bbcd
commit
b564e6e102
|
@ -464,7 +464,7 @@ public class XPackLicenseState {
|
|||
/**
|
||||
* Determine if Upgrade API should be enabled.
|
||||
* <p>
|
||||
* Upgrade API is not available in for all license types except {@link OperationMode#TRIAL}
|
||||
* Upgrade API is not available in for all license types except {@link OperationMode#MISSING}
|
||||
*
|
||||
* @return {@code true} as long as the license is valid. Otherwise
|
||||
* {@code false}.
|
||||
|
@ -472,13 +472,7 @@ public class XPackLicenseState {
|
|||
public boolean isUpgradeAllowed() {
|
||||
// status is volatile
|
||||
Status localStatus = status;
|
||||
OperationMode operationMode = localStatus.mode;
|
||||
|
||||
boolean licensed = operationMode == OperationMode.BASIC || operationMode == OperationMode.STANDARD ||
|
||||
operationMode == OperationMode.GOLD || operationMode == OperationMode.PLATINUM;
|
||||
|
||||
return licensed && localStatus.active;
|
||||
|
||||
// Should work on all active licenses
|
||||
return localStatus.active;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.function.Supplier;
|
|||
|
||||
public class Upgrade implements ActionPlugin {
|
||||
|
||||
public static final Version UPGRADE_INTRODUCED = Version.V_5_5_0_UNRELEASED; // TODO: Probably will need to change this to 5.6.0
|
||||
public static final Version UPGRADE_INTRODUCED = Version.V_5_5_0; // TODO: Probably will need to change this to 5.6.0
|
||||
|
||||
private final Settings settings;
|
||||
private final List<BiFunction<InternalClient, ClusterService, IndexUpgradeCheck>> upgradeCheckFactories;
|
||||
|
|
|
@ -60,11 +60,11 @@ public abstract class IndexUpgradeIntegTestCase extends AbstractLicensesIntegrat
|
|||
return nodePlugins();
|
||||
}
|
||||
private static String randomValidLicenseType() {
|
||||
return randomFrom("platinum", "gold", "standard", "basic");
|
||||
return randomFrom("trial", "platinum", "gold", "standard", "basic");
|
||||
}
|
||||
|
||||
private static String randomInvalidLicenseType() {
|
||||
return randomFrom("missing", "trial");
|
||||
return "missing";
|
||||
}
|
||||
|
||||
public void disableLicensing() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue