From c14a865880185771e1b168277b81781d92d0375e Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 9 Oct 2019 15:37:02 +0530 Subject: [PATCH] Fix #1803: Missing "/" in request url while using customresource client --- CHANGELOG.md | 6 ++++-- .../dsl/internal/RawCustomResourceOperationsImpl.java | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62e727d5f19..1b05e93dd78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ #### Bugs * Fix #1796: Check if BouncyCastle provider is set * Fix #1724: createOrReplace function does not work properly for Custom defined resources +* Fix #1803: Missing "/" in request url while using customresource client * Fix #1789: Create or replace on operation seems broken * Fix #1782: Informer Deadlock; Fix lock typo in SharedProcessor #### Improvements -* Add support for filtering labels by EXISTS/NOT_EXISTS via the single argument versions of `.withLabel` and `.withoutLabel` -* Schedule reconnect in case of HTTP_GONE when watching; the rescheduled connect will start from beginning of history by not specifying resourceVersion +* Add support for filtering labels by EXISTS/NOT-EXISTS via the single argument versions of `.withLabel` and `.withoutLabel` +* Schedule reconnect in case of HTTP-GONE when watching; the rescheduled connect will start from beginning of history by not specifying resourceVersion +* Add support for filtering labels by EXISTS/NOT-EXISTS via the single argument versions of `.withLabel` and `.withoutLabel` #### Dependency Upgrade * Updated Knative Serving to v0.9.90 * Update Tekton to v0.7.0 diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java index d0c494c48fb..7865119e8b1 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/RawCustomResourceOperationsImpl.java @@ -406,7 +406,13 @@ private Map convertJsonStringToMap(String objectAsString) throws } private String fetchUrl(String namespace, Map labels) { + if (config.getMasterUrl() == null) { + return null; + } + StringBuilder urlBuilder = new StringBuilder(config.getMasterUrl()); + + urlBuilder.append(config.getMasterUrl().endsWith("/") ? "" : "/"); urlBuilder.append("apis/") .append(customResourceDefinition.getGroup()) .append("/")