use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.
the class HealthCheckHelperTest method createNamespace.
// Create a named namespace
private V1Namespace createNamespace(String name) throws Exception {
CallBuilderFactory factory = new CallBuilderFactory(null);
try {
V1Namespace existing = factory.create().readNamespace(name);
if (existing != null)
return existing;
} catch (ApiException ignore) {
// Just ignore and try to create it
}
V1Namespace body = new V1Namespace();
// Set the required api version and kind of resource
body.setApiVersion("v1");
body.setKind("Namespace");
// Setup the standard object metadata
V1ObjectMeta meta = new V1ObjectMeta();
meta.setName(name);
body.setMetadata(meta);
return factory.create().createNamespace(body);
}
use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.
the class IngressWatcherTest method whenIngressHasNoDomainUid_returnNull.
@Test
public void whenIngressHasNoDomainUid_returnNull() throws Exception {
V1beta1Ingress ingress = new V1beta1Ingress().metadata(new V1ObjectMeta());
assertThat(IngressWatcher.getIngressDomainUID(ingress), nullValue());
}
use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.
the class IngressWatcherTest method whenIngressHasDomainUid_returnIt.
@Test
public void whenIngressHasDomainUid_returnIt() throws Exception {
V1beta1Ingress ingress = new V1beta1Ingress().metadata(new V1ObjectMeta().labels(ImmutableMap.of(DOMAINUID_LABEL, "domain1")));
assertThat(IngressWatcher.getIngressDomainUID(ingress), equalTo("domain1"));
}
use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.
the class IngressWatcherTest method whenIngressHasClusterName_returnIt.
@Test
public void whenIngressHasClusterName_returnIt() throws Exception {
V1beta1Ingress ingress = new V1beta1Ingress().metadata(new V1ObjectMeta().labels(ImmutableMap.of(CLUSTERNAME_LABEL, "mycluster")));
assertThat(IngressWatcher.getIngressClusterName(ingress), equalTo("mycluster"));
}
use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.
the class IngressWatcherTest method whenIngressHasNoClusterName_returnNull.
@Test
public void whenIngressHasNoClusterName_returnNull() throws Exception {
V1beta1Ingress ingress = new V1beta1Ingress().metadata(new V1ObjectMeta());
assertThat(IngressWatcher.getIngressClusterName(ingress), nullValue());
}
Aggregations