use of org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl in project kie-wb-common by kiegroup.
the class RuntimeEndpointsTestIT method createProviderConfig.
private OpenShiftProviderConfigImpl createProviderConfig() {
OpenShiftProviderConfigImpl openshiftProviderConfig = new OpenShiftProviderConfigImpl().clear();
openshiftProviderConfig.setName(getClass().getSimpleName());
openshiftProviderConfig.setKubernetesMaster("https://ce-os-rhel-master.usersys.redhat.com:8443");
openshiftProviderConfig.setKubernetesAuthBasicUsername("admin");
openshiftProviderConfig.setKubernetesAuthBasicPassword("admin");
return openshiftProviderConfig;
}
use of org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl in project kie-wb-common by kiegroup.
the class OpenShiftExecutorTest method testProviderConfigReuse.
/**
* Make sure we can reuse the provider for two different runtimes.
* TODO: replace with more lightweight image and non-internal (minishift?) environment.
* @throws Exception
*/
@Test
public void testProviderConfigReuse() throws Exception {
OpenShiftProviderConfigImpl providerConfig = new OpenShiftProviderConfigImpl().clear();
providerConfig.setName(getClass().getSimpleName());
providerConfig.setKubernetesMaster("https://ce-os-rhel-master.usersys.redhat.com:8443");
providerConfig.setKubernetesAuthBasicUsername("admin");
providerConfig.setKubernetesAuthBasicPassword("admin");
OpenShiftClient client = new OpenShiftAccessInterfaceImpl().newOpenShiftClient(providerConfig);
OpenShiftRuntimeConfigImpl runtimeConfigA = createRuntimeConfig("tpcr1");
OpenShiftRuntimeConfigImpl runtimeConfigB = createRuntimeConfig("tpcr2");
client.create(runtimeConfigA);
client.create(runtimeConfigB);
client.destroy(runtimeConfigA.getRuntimeId().toString());
client.destroy(runtimeConfigB.getRuntimeId().toString());
}
use of org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl in project kie-wb-common by kiegroup.
the class OpenShiftProviderConfigConverter method toDomain.
@Override
public OpenShiftProviderConfig toDomain(ProviderConfiguration modelValue) {
if (modelValue == null) {
return null;
}
OpenShiftProviderConfigImpl openShiftProviderConfig = new OpenShiftProviderConfigImpl();
openShiftProviderConfig.clear();
openShiftProviderConfig.setName(modelValue.getId());
openShiftProviderConfig.setKubernetesMaster(getStringValue(modelValue.getValues(), KUBERNETES_MASTER.inputKey()));
openShiftProviderConfig.setKubernetesAuthBasicUsername(getStringValue(modelValue.getValues(), KUBERNETES_AUTH_BASIC_USERNAME.inputKey()));
openShiftProviderConfig.setKubernetesAuthBasicPassword(getStringValue(modelValue.getValues(), KUBERNETES_AUTH_BASIC_PASSWORD.inputKey()));
return openShiftProviderConfig;
}
use of org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl in project kie-wb-common by kiegroup.
the class RuntimeEndpointsTestIT method checkOpenShiftService.
/**
* Can be used if internal to red hat.
* TODO: replace with more lightweight image and non-internal (minishift?) environment
* @throws Exception
*/
@Ignore
public void checkOpenShiftService() throws Exception {
Client client = ClientBuilder.newClient();
WebTarget target = client.target(APP_URL);
ResteasyWebTarget restEasyTarget = (ResteasyWebTarget) target;
RuntimeProvisioningService proxy = restEasyTarget.proxy(RuntimeProvisioningService.class);
ProviderTypeList allProviderTypes = proxy.getProviderTypes(0, 10, "", true);
assertNotNull(allProviderTypes);
assertEquals(3, allProviderTypes.getItems().size());
OpenShiftProviderConfigImpl openshiftProviderConfig = createProviderConfig();
proxy.registerProvider(openshiftProviderConfig);
ProviderList allProviders = proxy.getProviders(0, 10, "", true);
assertEquals(1, allProviders.getItems().size());
assertTrue(allProviders.getItems().get(0) instanceof OpenShiftProvider);
OpenShiftProvider openshiftProvider = (OpenShiftProvider) allProviders.getItems().get(0);
OpenShiftRuntimeConfig runtimeConfig = createRuntimeConfig(openshiftProvider, "coss1");
@SuppressWarnings("unused") OpenShiftRuntime openshiftRuntime = getOpenShiftRuntime(proxy, 0, null);
String runtimeId = proxy.newRuntime(runtimeConfig);
openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.READY);
proxy.startRuntime(runtimeId);
openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.RUNNING);
proxy.stopRuntime(runtimeId);
openshiftRuntime = getOpenShiftRuntime(proxy, 1, OpenShiftRuntimeState.READY);
proxy.destroyRuntime(runtimeId, true);
openshiftRuntime = getOpenShiftRuntime(proxy, 0, null);
}
use of org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl in project kie-wb-common by kiegroup.
the class OpenShiftAccessTest method testProviderConfig.
@Test
public void testProviderConfig() {
OpenShiftProviderConfigImpl providerConfig = new OpenShiftProviderConfigImpl().clear();
providerConfig.setKubernetesMaster("https://localhost:8443");
providerConfig.setKubernetesOapiVersion("v2");
OpenShiftConfig clientConfig = OpenShiftAccessInterfaceImpl.buildOpenShiftConfig(providerConfig);
assertEquals("https://localhost:8443/", clientConfig.getMasterUrl());
assertEquals("https://localhost:8443/oapi/v2/", clientConfig.getOpenShiftUrl());
}
Aggregations