예제 #1
0
 protected URL getNamespacedUrl(String namespace) throws MalformedURLException {
   URL requestUrl = getRootUrl();
   if (namespace != null) {
     requestUrl = new URL(URLUtils.join(requestUrl.toString(), "namespaces", namespace));
   }
   requestUrl = new URL(URLUtils.join(requestUrl.toString(), resourceT));
   return requestUrl;
 }
예제 #2
0
 public URL getRootUrl() {
   try {
     return new URL(
         URLUtils.join(client.getMasterUrl().toString(), "api", client.getApiVersion()));
   } catch (MalformedURLException e) {
     throw KubernetesClientException.launderThrowable(e);
   }
 }
예제 #3
0
 @Override
 public T get() {
   if (item != null) {
     return item;
   }
   try {
     URL requestUrl = getNamespacedUrl();
     if (name != null) {
       requestUrl = new URL(URLUtils.join(requestUrl.toString(), name));
     }
     return handleGet(requestUrl);
   } catch (KubernetesClientException e) {
     if (e.getCode() != 404) {
       throw e;
     }
     return null;
   } catch (InterruptedException | ExecutionException | IOException e) {
     throw KubernetesClientException.launderThrowable(e);
   }
 }
예제 #4
0
 protected URL getResourceUrl() throws MalformedURLException {
   if (name == null) {
     return getNamespacedUrl();
   }
   return new URL(URLUtils.join(getNamespacedUrl().toString(), name));
 }