本文整理了Java中io.fabric8.openshift.api.model.Route.getMetadata
方法的一些代码示例,展示了Route.getMetadata
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Route.getMetadata
方法的具体详情如下:
包路径:io.fabric8.openshift.api.model.Route
类名称:Route
方法名:getMetadata
暂无
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
public OpenShiftServerResolver(List<Service> services, List<Route> routes) {
super(services, Collections.emptyList());
this.routes = ArrayListMultimap.create();
for (Route route : routes) {
String machineName =
Annotations.newDeserializer(route.getMetadata().getAnnotations()).machineName();
this.routes.put(machineName, route);
}
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
private void useSecureProtocolForServers(final Route route) {
Map<String, ServerConfigImpl> servers =
Annotations.newDeserializer(route.getMetadata().getAnnotations()).servers();
servers.values().forEach(s -> s.setProtocol(getSecureProtocol(s.getProtocol())));
Map<String, String> annotations = Annotations.newSerializer().servers(servers).annotations();
route.getMetadata().getAnnotations().putAll(annotations);
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
@Override
public void provision(OpenShiftEnvironment osEnv, RuntimeIdentity identity)
throws InfrastructureException {
super.provision(osEnv, identity);
final Set<Route> routes = new HashSet<>(osEnv.getRoutes().values());
osEnv.getRoutes().clear();
for (Route route : routes) {
final ObjectMeta routeMeta = route.getMetadata();
putLabel(route, Constants.CHE_ORIGINAL_NAME_LABEL, routeMeta.getName());
final String routeName = Names.generateName("route");
routeMeta.setName(routeName);
osEnv.getRoutes().put(routeName, route);
}
}
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
private void validateRoutesMatchServices(OpenShiftEnvironment env) throws ValidationException {
Set<String> recipeServices =
env.getServices()
.values()
.stream()
.map(s -> s.getMetadata().getName())
.collect(Collectors.toSet());
for (Route route : env.getRoutes().values()) {
if (route.getSpec() == null
|| route.getSpec().getTo() == null
|| !route.getSpec().getTo().getKind().equals(SERVICE_KIND)) {
continue;
}
String serviceName = route.getSpec().getTo().getName();
if (!recipeServices.contains(serviceName)) {
throw new ValidationException(
String.format(
"Route '%s' refers to Service '%s'. Routes must refer to Services included in recipe",
route.getMetadata().getName(), serviceName));
}
}
}
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
private void fillRouteServers(Route route, Map<String, ServerImpl> servers) {
Annotations.newDeserializer(route.getMetadata().getAnnotations())
.servers()
.forEach(
(name, config) ->
servers.put(
name,
newServer(
config.getProtocol(),
route.getSpec().getHost(),
null,
config.getPath(),
config.getAttributes())));
}
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
@Override
public void expose(
OpenShiftEnvironment openShiftEnvironment,
String machineName,
String serviceName,
ServicePort servicePort,
Map<String, ServerConfig> externalServers) {
Route route =
new RouteBuilder()
.withName(serviceName + '-' + servicePort.getName())
.withMachineName(machineName)
.withTargetPort(servicePort.getName())
.withServers(externalServers)
.withTo(serviceName)
.build();
openShiftEnvironment.getRoutes().put(route.getMetadata().getName(), route);
}
代码示例来源:origin: org.domeos/kubernetes-model
public RouteBuilder(RouteFluent<?> fluent,Route instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withKind(instance.getKind());
fluent.withMetadata(instance.getMetadata());
fluent.withSpec(instance.getSpec());
fluent.withStatus(instance.getStatus());
this.validationEnabled = validationEnabled;
}
public RouteBuilder(Route instance){
代码示例来源:origin: org.domeos/kubernetes-model
public RouteBuilder(Route instance,Boolean validationEnabled){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.withSpec(instance.getSpec());
this.withStatus(instance.getStatus());
this.validationEnabled = validationEnabled;
}
代码示例来源:origin: org.apache.stratos/kubernetes-model
public RouteBuilder( RouteFluent<?> fluent , Route instance ){
this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); fluent.withSpec(instance.getSpec()); fluent.withStatus(instance.getStatus());
}
public RouteBuilder( Route instance ){
代码示例来源:origin: org.domeos/kubernetes-model
public RouteFluentImpl(Route instance){
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.withSpec(instance.getSpec());
this.withStatus(instance.getStatus());
}
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public RouteBuilder( RouteFluent<?> fluent , Route instance ){
this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); fluent.withSpec(instance.getSpec()); fluent.withStatus(instance.getStatus());
}
public RouteBuilder( Route instance ){
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public RouteBuilder( Route instance ){
this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus());
}
代码示例来源:origin: org.apache.stratos/kubernetes-model
public RouteBuilder( Route instance ){
this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus());
}
代码示例来源:origin: org.eclipse.che.infrastructure/infrastructure-openshift
} else if (object instanceof Route) {
Route route = (Route) object;
routes.put(route.getMetadata().getName(), route);
} else if (object instanceof PersistentVolumeClaim) {
PersistentVolumeClaim pvc = (PersistentVolumeClaim) object;
内容来源于网络,如有侵权,请联系作者删除!