use of io.fabric8.annotations.Path in project fabric8 by jboss-fuse.
the class MappingRuleResolver method findMappingRule.
public MappingResult findMappingRule(String requestURI) {
String[] paths = Paths.splitPaths(requestURI);
MappingResult answer = null;
// TODO we could build a path based tree to do more efficient matching?
for (HttpProxyRule mappingRule : mappingRules.getMappingRules().values()) {
answer = mappingRule.matches(paths);
if (answer != null) {
break;
}
}
return answer;
}
use of io.fabric8.annotations.Path in project ballerina by ballerina-lang.
the class DefaultBallerinaDockerClient method buildImage.
/*
Execute a Docker image build using Fabric8 DSL.
*/
private void buildImage(String dockerEnv, String imageName, Path tmpDir, String buildArgs) throws InterruptedException, IOException {
DockerClient client = getDockerClient(dockerEnv);
OutputHandle buildHandle = client.image().build().withRepositoryName(imageName).withNoCache().alwaysRemovingIntermediate().withBuildArgs(buildArgs).usingListener(new DockerBuilderEventListener()).fromFolder(tmpDir.toString());
buildDone.await();
buildHandle.close();
client.close();
}
use of io.fabric8.annotations.Path in project fabric8-maven-plugin by fabric8io.
the class WildFlySwarmHealthCheckEnricher method discoverWildFlySwarmHealthCheck.
private Probe discoverWildFlySwarmHealthCheck(int initialDelay) {
if (hasDependency(this.getProject(), "org.wildfly.swarm", "monitor")) {
Integer port = getPort();
// scheme must be in upper case in k8s
String scheme = getScheme().toUpperCase();
String path = getPath();
// lets default to adding a wildfly swarm health check
return new ProbeBuilder().withNewHttpGet().withNewPort(port).withPath(path).withScheme(scheme).endHttpGet().withInitialDelaySeconds(initialDelay).build();
}
return null;
}
use of io.fabric8.annotations.Path in project fabric8-maven-plugin by fabric8io.
the class ClientToolsService method getKubeCtlExecutable.
public File getKubeCtlExecutable() {
OpenShiftClient openShiftClient = controller.getOpenShiftClientOrNull();
String command = openShiftClient != null ? "oc" : "kubectl";
String missingCommandMessage;
File file = ProcessUtil.findExecutable(log, command);
if (file == null && command.equals("oc")) {
file = ProcessUtil.findExecutable(log, command);
missingCommandMessage = "commands oc or kubectl";
} else {
missingCommandMessage = "command " + command;
}
if (file == null) {
throw new IllegalStateException("Could not find " + missingCommandMessage + ". Please install the necessary binaries and ensure they get added to your $PATH");
}
return file;
}
use of io.fabric8.annotations.Path in project fabric8-maven-plugin by fabric8io.
the class ContainerHandlerTest method getVolumeMountWithMultipleMountTest.
@Test
public void getVolumeMountWithMultipleMountTest() {
ContainerHandler handler = new ContainerHandler(project, envVarHandler, probeHandler);
images.clear();
images.add(imageConfiguration1);
List<String> mounts = new ArrayList<>();
mounts.add("/path/etc");
// volume config with name and multiple mount
mounts.add("/path/system");
mounts.add("/path/sys");
VolumeConfig volumeConfig4 = new VolumeConfig.Builder().name("test").mounts(mounts).build();
volumes1.clear();
volumes1.add(volumeConfig4);
ResourceConfig config4 = new ResourceConfig.Builder().volumes(volumes1).build();
containers = handler.getContainers(config4, images);
assertEquals(3, containers.get(0).getVolumeMounts().size());
for (int i = 0; i <= 2; i++) assertEquals("test", containers.get(0).getVolumeMounts().get(i).getName());
}
Aggregations