use of io.fabric8.openshift.client.DefaultOpenShiftClient in project kie-wb-common by kiegroup.
the class OpenShiftAccessInterfaceImpl method newOpenShiftClient.
@Override
public OpenShiftClient newOpenShiftClient(final ProviderConfig providerConfig) {
checkInstanceOf("providerConfig", providerConfig, OpenShiftProviderConfig.class);
OpenShiftConfig clientConfig = buildOpenShiftConfig((OpenShiftProviderConfig) providerConfig);
return new OpenShiftClient(new DefaultOpenShiftClient(clientConfig));
}
use of io.fabric8.openshift.client.DefaultOpenShiftClient in project fabric8 by jboss-fuse.
the class KubernetesHelper method createJenkinshiftOpenShiftClient.
public static OpenShiftClient createJenkinshiftOpenShiftClient(String jenkinshiftUrl) {
Config config = createJenkinshiftConfig(jenkinshiftUrl);
// TODO until jenkinshift supports HTTPS lets disable HTTPS by default
// openShiftClient = new DefaultOpenShiftClient(jenkinshiftUrl);
JenkinShiftClient jenkinShiftClient = new JenkinShiftClient(config);
jenkinShiftClient.updateHttpClient(config);
return jenkinShiftClient;
}
use of io.fabric8.openshift.client.DefaultOpenShiftClient in project fabric8 by jboss-fuse.
the class TriggerBuild method main.
public static void main(String... args) {
if (args.length < 1) {
System.out.println("Usage: buildConfigName namespace secret type");
return;
}
String name = args[0];
String namespace = "default";
if (args.length > 1) {
namespace = args[1];
}
OpenShiftClient client = new DefaultOpenShiftClient();
try {
client.buildConfigs().inNamespace(namespace).withName(name).trigger(new WebHookTrigger(true, null));
} catch (Exception e) {
System.out.println("FAILED: " + e);
e.printStackTrace();
}
}
use of io.fabric8.openshift.client.DefaultOpenShiftClient in project fabric8 by jboss-fuse.
the class WatchBuildsExample method main.
public static void main(String... args) throws Exception {
OpenShiftClient client = new DefaultOpenShiftClient();
client.builds().watch(new Watcher<Build>() {
@Override
public void eventReceived(Action action, Build build) {
System.out.println(action + ": " + build);
}
@Override
public void onClose(KubernetesClientException e) {
System.out.println("Closed: " + e);
}
});
client.close();
}
use of io.fabric8.openshift.client.DefaultOpenShiftClient in project carbon-apimgt by wso2.
the class KubernetesGatewayImpl method initImpl.
/**
* @see ContainerBasedGatewayGenerator#initImpl(Map)
*/
@Override
void initImpl(Map<String, String> implParameters) throws ContainerBasedGatewayException {
try {
setValues(implParameters);
setClient(new DefaultOpenShiftClient(buildConfig()));
} catch (KubernetesClientException e) {
String msg = "Error occurred while creating Default Openshift Client";
throw new ContainerBasedGatewayException(msg, e, ExceptionCodes.ERROR_INITIALIZING_DEDICATED_CONTAINER_BASED_GATEWAY);
}
}
Aggregations