Search in sources :

Example 1 with OpenShiftRuntimeConfigImpl

use of org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl 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.setKubernetesMain("https://ce-os-rhel-main.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());
}
Also used : OpenShiftRuntimeConfigImpl(org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl) OpenShiftAccessInterfaceImpl(org.guvnor.ala.openshift.access.impl.OpenShiftAccessInterfaceImpl) OpenShiftClient(org.guvnor.ala.openshift.access.OpenShiftClient) OpenShiftProviderConfigImpl(org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl) Test(org.junit.Test)

Example 2 with OpenShiftRuntimeConfigImpl

use of org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl in project kie-wb-common by kiegroup.

the class OpenShiftExecutorTest method createRuntimeConfig.

private OpenShiftRuntimeConfigImpl createRuntimeConfig(String testName) throws Exception {
    final String prjName = createProjectName(testName);
    final String appName = "myapp";
    final String svcName = appName + "-execserv";
    OpenShiftRuntimeConfigImpl runtimeConfig = new OpenShiftRuntimeConfigImpl();
    runtimeConfig.setProjectName(prjName);
    runtimeConfig.setServiceName(svcName);
    runtimeConfig.setApplicationName(appName);
    runtimeConfig.setResourceSecretsUri(getUri("bpmsuite-app-secret.json"));
    runtimeConfig.setResourceStreamsUri(getUri("bpmsuite-image-streams.json"));
    runtimeConfig.setResourceTemplateUri(getUri("bpmsuite70-execserv.json"));
    runtimeConfig.setResourceTemplateParamValues(new OpenShiftParameters().param("APPLICATION_NAME", appName).param("IMAGE_STREAM_NAMESPACE", prjName).param("KIE_ADMIN_PWD", "admin1!").param("KIE_SERVER_PWD", "execution1!").toString());
    return runtimeConfig;
}
Also used : OpenShiftRuntimeConfigImpl(org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl) OpenShiftParameters(org.guvnor.ala.openshift.config.OpenShiftParameters)

Example 3 with OpenShiftRuntimeConfigImpl

use of org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl in project kie-wb-common by kiegroup.

the class RuntimeEndpointsTestIT method createRuntimeConfig.

private OpenShiftRuntimeConfigImpl createRuntimeConfig(ProviderId providerId, String testName) throws Exception {
    final String prjName = createProjectName(testName);
    final String appName = "myapp";
    final String svcName = appName + "-execserv";
    OpenShiftRuntimeConfigImpl runtimeConfig = new OpenShiftRuntimeConfigImpl();
    runtimeConfig.setProviderId(providerId);
    runtimeConfig.setProjectName(prjName);
    runtimeConfig.setServiceName(svcName);
    runtimeConfig.setApplicationName(appName);
    runtimeConfig.setResourceSecretsUri(getUri("bpmsuite-app-secret.json"));
    runtimeConfig.setResourceStreamsUri(getUri("bpmsuite-image-streams.json"));
    runtimeConfig.setResourceTemplateUri(getUri("bpmsuite70-execserv.json"));
    runtimeConfig.setResourceTemplateParamValues(new OpenShiftParameters().param("APPLICATION_NAME", appName).param("IMAGE_STREAM_NAMESPACE", prjName).param("KIE_ADMIN_PWD", "admin1!").param("KIE_SERVER_PWD", "execution1!").toString());
    return runtimeConfig;
}
Also used : OpenShiftRuntimeConfigImpl(org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl) OpenShiftParameters(org.guvnor.ala.openshift.config.OpenShiftParameters)

Aggregations

OpenShiftRuntimeConfigImpl (org.guvnor.ala.openshift.config.impl.OpenShiftRuntimeConfigImpl)3 OpenShiftParameters (org.guvnor.ala.openshift.config.OpenShiftParameters)2 OpenShiftClient (org.guvnor.ala.openshift.access.OpenShiftClient)1 OpenShiftAccessInterfaceImpl (org.guvnor.ala.openshift.access.impl.OpenShiftAccessInterfaceImpl)1 OpenShiftProviderConfigImpl (org.guvnor.ala.openshift.config.impl.OpenShiftProviderConfigImpl)1 Test (org.junit.Test)1