use of io.syndesis.qe.marketplace.openshift.OpenShiftService in project syndesis-qe by syndesisio.
the class TestConfiguration method getOpenShiftService.
public static OpenShiftService getOpenShiftService(String quayProject) {
OpenShiftUser defaultUser = new OpenShiftUser(syndesisUsername(), syndesisPassword(), openShiftUrl());
OpenShiftUser adminUser = new OpenShiftUser(adminUsername(), adminPassword(), openShiftUrl());
OpenShiftConfiguration openShiftConfiguration = OpenShiftConfiguration.builder().namespace(openShiftNamespace()).pullSecretName(syndesisPullSecretName()).pullSecret(syndesisPullSecret()).quayOpsrcToken(quayOpsrcToken()).icspConfigURL(operatorhubIcspScriptURL()).build();
return new OpenShiftService(quayNamespace(), quayProject, openShiftConfiguration, adminUser, defaultUser);
}
use of io.syndesis.qe.marketplace.openshift.OpenShiftService in project syndesis-qe by syndesisio.
the class Syndesis method deployViaBundle.
private void deployViaBundle() {
if (subscriptionExists()) {
return;
}
Index index;
Bundle foBundle = null;
OpenShiftService ocpSvc;
if (TestConfiguration.getBundleImage() != null) {
ocpSvc = TestConfiguration.getOpenShiftService("fuse-online-index");
} else {
String[] parts = TestConfiguration.getIndexImage().split("/");
String quayProject = parts[parts.length - 1].split(":")[0];
ocpSvc = TestConfiguration.getOpenShiftService(quayProject);
}
Opm opm = new Opm(ocpSvc);
QuayUser quayUser = TestConfiguration.getQuayUser();
if (TestConfiguration.getBundleImage() != null) {
// Deploy from bundle
index = opm.createIndex("quay.io/marketplace/fuse-online-index:" + TestConfiguration.syndesisVersion());
foBundle = index.addBundle(TestConfiguration.getBundleImage());
} else {
// deploy from existing index image
index = opm.pullIndex(TestConfiguration.getIndexImage(), quayUser);
}
index.push(quayUser);
try {
// OCP stuff - add index
ocpSvc.patchGlobalSecrets(TestConfiguration.getQuayPullSecret());
index.addIndexToCluster(ocpSvc, "fuse-online-test-catalog");
if (foBundle != null) {
foBundle.createSubscription(ocpSvc);
} else {
Bundle.createSubscription(ocpSvc, "fuse-online", "fuse-online-7.9.x", "''", "fuse-online-test-catalog");
}
OpenShiftWaitUtils.waitFor(OpenShiftWaitUtils.areExactlyNPodsRunning("name", "syndesis-operator", 1));
} catch (IOException | TimeoutException | InterruptedException e) {
e.printStackTrace();
}
createPullSecret();
if (TestConfiguration.enableTestSupport()) {
TestUtils.withRetry(this::enableTestSupport, 5, 10, "Failed to patch CSV");
}
deployCrAndRoutes();
CommonSteps.waitForSyndesis();
}
use of io.syndesis.qe.marketplace.openshift.OpenShiftService in project syndesis-qe by syndesisio.
the class CommonSteps method deployOperatorHub.
public static void deployOperatorHub() {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
QuayUser quayUser = TestConfiguration.getQuayUser();
QuayService quayService = new QuayService(quayUser, TestConfiguration.syndesisOperatorImage(), syndesis.generateImageEnvVars());
String quayProject;
try {
quayProject = quayService.createQuayProject();
} catch (Exception e) {
InfraFail.fail("Creating project on quay failed", e);
return;
}
OpenShiftService openShiftService = TestConfiguration.getOpenShiftService(quayProject);
try {
openShiftService.deployOperator();
} catch (IOException e) {
InfraFail.fail("Deploying operator with marketplace failed", e);
}
// at this point we don't really need operator source anymore
// and we doon't need project on quay either, because all the necessary stuff
// has already been deployed, we can delete those
log.info("Cleaning all unnecessary resorces");
openShiftService.deleteOpsrcToken();
try {
openShiftService.deleteOperatorSource();
quayService.deleteQuayProject();
} catch (IOException e) {
InfraFail.fail("Fail during cleanup of quay project", e);
}
syndesis.deployCrAndRoutes();
CommonSteps.waitForSyndesis();
}
Aggregations