use of io.syndesis.qe.marketplace.manifests.Opm 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();
}
Aggregations