Search in sources :

Example 21 with V1ObjectMeta

use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.

the class Main method deleteDomainPresence.

private static void deleteDomainPresence(Domain dom) {
    V1ObjectMeta meta = dom.getMetadata();
    DomainSpec spec = dom.getSpec();
    String namespace = meta.getNamespace();
    String domainUID = spec.getDomainUID();
    deleteDomainPresence(namespace, domainUID);
}
Also used : DomainSpec(oracle.kubernetes.weblogic.domain.v1.DomainSpec) V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta)

Example 22 with V1ObjectMeta

use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.

the class Main method dispatchIngressWatch.

private static void dispatchIngressWatch(Watch.Response<V1beta1Ingress> item) {
    V1beta1Ingress i = item.object;
    if (i != null) {
        V1ObjectMeta metadata = i.getMetadata();
        String domainUID = metadata.getLabels().get(LabelConstants.DOMAINUID_LABEL);
        String clusterName = metadata.getLabels().get(LabelConstants.CLUSTERNAME_LABEL);
        if (domainUID != null) {
            DomainPresenceInfo info = domains.get(domainUID);
            if (info != null && clusterName != null) {
                switch(item.type) {
                    case "ADDED":
                        info.getIngresses().put(clusterName, i);
                        break;
                    case "MODIFIED":
                        V1beta1Ingress skoIngress = info.getIngresses().get(clusterName);
                        if (skoIngress != null) {
                            info.getIngresses().replace(clusterName, skoIngress, i);
                        }
                        break;
                    case "DELETED":
                        V1beta1Ingress oldIngress = info.getIngresses().remove(clusterName);
                        if (oldIngress != null) {
                            // Ingress was deleted, but sko still contained a non-null entry
                            LOGGER.info(MessageKeys.INGRESS_DELETED, domainUID, metadata.getNamespace(), clusterName);
                            doCheckAndCreateDomainPresence(info.getDomain(), true);
                        }
                        break;
                    case "ERROR":
                    default:
                }
            }
        }
    }
}
Also used : V1beta1Ingress(io.kubernetes.client.models.V1beta1Ingress) V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta) DomainPresenceInfo(oracle.kubernetes.operator.helpers.DomainPresenceInfo)

Example 23 with V1ObjectMeta

use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.

the class PodWatcher method getPodServerName.

static String getPodServerName(V1Pod pod) {
    V1ObjectMeta meta = pod.getMetadata();
    Map<String, String> labels = meta.getLabels();
    if (labels != null) {
        return labels.get(LabelConstants.SERVERNAME_LABEL);
    }
    return null;
}
Also used : V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta)

Example 24 with V1ObjectMeta

use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.

the class PodWatcher method getPodDomainUID.

static String getPodDomainUID(V1Pod pod) {
    V1ObjectMeta meta = pod.getMetadata();
    Map<String, String> labels = meta.getLabels();
    if (labels != null) {
        return labels.get(LabelConstants.DOMAINUID_LABEL);
    }
    return null;
}
Also used : V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta)

Example 25 with V1ObjectMeta

use of io.kubernetes.client.models.V1ObjectMeta in project weblogic-kubernetes-operator by oracle.

the class ServiceWatcher method getServiceServerName.

static String getServiceServerName(V1Service service) {
    V1ObjectMeta meta = service.getMetadata();
    Map<String, String> labels = meta.getLabels();
    if (labels != null) {
        return labels.get(LabelConstants.SERVERNAME_LABEL);
    }
    return null;
}
Also used : V1ObjectMeta(io.kubernetes.client.models.V1ObjectMeta)

Aggregations

V1ObjectMeta (io.kubernetes.client.models.V1ObjectMeta)36 Test (org.junit.Test)12 V1Service (io.kubernetes.client.models.V1Service)10 ApiException (io.kubernetes.client.ApiException)7 CallBuilderFactory (oracle.kubernetes.operator.helpers.CallBuilderFactory)6 V1beta1Ingress (io.kubernetes.client.models.V1beta1Ingress)5 DomainPresenceInfo (oracle.kubernetes.operator.helpers.DomainPresenceInfo)4 IntOrString (io.kubernetes.client.custom.IntOrString)3 V1PodTemplateSpec (io.kubernetes.client.models.V1PodTemplateSpec)3 HashMap (java.util.HashMap)3 Domain (oracle.kubernetes.weblogic.domain.v1.Domain)3 DomainSpec (oracle.kubernetes.weblogic.domain.v1.DomainSpec)3 V1LabelSelector (io.kubernetes.client.models.V1LabelSelector)2 V1Namespace (io.kubernetes.client.models.V1Namespace)2 V1Secret (io.kubernetes.client.models.V1Secret)2 V1ServicePort (io.kubernetes.client.models.V1ServicePort)2 V1ServiceSpec (io.kubernetes.client.models.V1ServiceSpec)2 Method (java.lang.reflect.Method)2 ArrayList (java.util.ArrayList)2 ServerKubernetesObjects (oracle.kubernetes.operator.helpers.ServerKubernetesObjects)2