From 7ba675b32383251a18fba333d86a88ba2db8d41b Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Thu, 22 Jul 2021 11:18:51 +0200 Subject: [PATCH] fix: OpenShiftConfig missing some configurations from provided Config --- CHANGELOG.md | 5 +- .../openshift/client/OpenShiftConfig.java | 50 +++++++++---------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c59dd893634..16208b45395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ## CHANGELOG -### 5.6-SNAPSHOT +### 5.7-SNAPSHOT #### Bugs -Fix : https configuration ignored for OpenShiftServer in CRUD mode +* Fix #3346: https configuration ignored for OpenShiftServer in CRUD mode +* Fix #3347: OpenShiftConfig missing some configurations from provided Config #### Improvements diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfig.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfig.java index 7a660941d8f..6118f797e1a 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfig.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftConfig.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import io.fabric8.kubernetes.client.Config; +import io.fabric8.kubernetes.client.OAuthTokenProvider; import io.fabric8.kubernetes.client.utils.URLUtils; import io.fabric8.kubernetes.client.utils.Utils; import io.sundr.builder.annotations.Buildable; @@ -64,8 +65,8 @@ public OpenShiftConfig(Config kubernetesConfig, String openShiftUrl) { } @Buildable(builderPackage = "io.fabric8.kubernetes.api.builder", editableEnabled = false, refs = {@BuildableReference(Config.class)}) - public OpenShiftConfig(String openShiftUrl, String oapiVersion, String masterUrl, String apiVersion, String namespace, boolean trustCerts, boolean disableHostnameVerification, String caCertFile, String caCertData, String clientCertFile, String clientCertData, String clientKeyFile, String clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String username, String password, String oauthToken, int watchReconnectInterval, int watchReconnectLimit, int connectionTimeout, int requestTimeout, long rollingTimeout, long scaleTimeout, int loggingInterval, Integer maxConcurrentRequests, Integer maxConcurrentRequestsPerHost, String httpProxy, String httpsProxy, String[] noProxy, Map errorMessages, String userAgent, TlsVersion[] tlsVersions, long buildTimeout, long websocketTimeout, long websocketPingInterval, String proxyUsername, String proxyPassword, String trustStoreFile, String trustStorePassphrase, String keyStoreFile, String keyStorePassphrase, String impersonateUsername, String[] impersonateGroups, Map> impersonateExtras, boolean openshiftApiGroupsEnabled, boolean disableApiGroupCheck) { - super(masterUrl, apiVersion, namespace, trustCerts, disableHostnameVerification, caCertFile, caCertData, clientCertFile, clientCertData, clientKeyFile, clientKeyData, clientKeyAlgo, clientKeyPassphrase, username, password, oauthToken, watchReconnectInterval, watchReconnectLimit, connectionTimeout, requestTimeout, rollingTimeout, scaleTimeout, loggingInterval, maxConcurrentRequests, maxConcurrentRequestsPerHost, httpProxy, httpsProxy, noProxy, errorMessages, userAgent, tlsVersions, websocketTimeout, websocketPingInterval, proxyUsername, proxyPassword, trustStoreFile, trustStorePassphrase, keyStoreFile, keyStorePassphrase, impersonateUsername, impersonateGroups, impersonateExtras); + public OpenShiftConfig(String openShiftUrl, String oapiVersion, String masterUrl, String apiVersion, String namespace, boolean trustCerts, boolean disableHostnameVerification, String caCertFile, String caCertData, String clientCertFile, String clientCertData, String clientKeyFile, String clientKeyData, String clientKeyAlgo, String clientKeyPassphrase, String username, String password, String oauthToken, int watchReconnectInterval, int watchReconnectLimit, int connectionTimeout, int requestTimeout, long rollingTimeout, long scaleTimeout, int loggingInterval, int maxConcurrentRequests, int maxConcurrentRequestsPerHost, boolean http2Disable, String httpProxy, String httpsProxy, String[] noProxy, Map errorMessages, String userAgent, TlsVersion[] tlsVersions, long websocketTimeout, long websocketPingInterval, String proxyUsername, String proxyPassword, String trustStoreFile, String trustStorePassphrase, String keyStoreFile, String keyStorePassphrase, String impersonateUsername, String[] impersonateGroups, Map> impersonateExtras, OAuthTokenProvider oauthTokenProvider, Map customHeaders, int requestRetryBackoffLimit, int requestRetryBackoffInterval, int uploadConnectionTimeout, int uploadRequestTimeout, long buildTimeout, boolean openshiftApiGroupsEnabled, boolean disableApiGroupCheck) { + super(masterUrl, apiVersion, namespace, trustCerts, disableHostnameVerification, caCertFile, caCertData, clientCertFile, clientCertData, clientKeyFile, clientKeyData, clientKeyAlgo, clientKeyPassphrase, username, password, oauthToken, watchReconnectInterval, watchReconnectLimit, connectionTimeout, requestTimeout, rollingTimeout, scaleTimeout, loggingInterval, maxConcurrentRequests, maxConcurrentRequestsPerHost, http2Disable, httpProxy, httpsProxy, noProxy, errorMessages, userAgent, tlsVersions, websocketTimeout, websocketPingInterval, proxyUsername, proxyPassword, trustStoreFile, trustStorePassphrase, keyStoreFile, keyStorePassphrase, impersonateUsername, impersonateGroups, impersonateExtras, oauthTokenProvider, customHeaders, requestRetryBackoffLimit, requestRetryBackoffInterval, uploadConnectionTimeout, uploadRequestTimeout); this.oapiVersion = oapiVersion; this.openShiftUrl = openShiftUrl; this.buildTimeout = buildTimeout; @@ -81,36 +82,31 @@ public OpenShiftConfig(String openShiftUrl, String oapiVersion, String masterUrl } public OpenShiftConfig(Config kubernetesConfig, String openShiftUrl, String oapiVersion, long buildTimeout) { - this(openShiftUrl, oapiVersion, kubernetesConfig.getMasterUrl(), kubernetesConfig.getApiVersion(), kubernetesConfig.getNamespace(), kubernetesConfig.isTrustCerts(), kubernetesConfig.isDisableHostnameVerification(), - kubernetesConfig.getCaCertFile(), kubernetesConfig.getCaCertData(), - kubernetesConfig.getClientCertFile(), kubernetesConfig.getClientCertData(), - kubernetesConfig.getClientKeyFile(), kubernetesConfig.getClientKeyData(), - kubernetesConfig.getClientKeyAlgo(), kubernetesConfig.getClientKeyPassphrase(), + this(openShiftUrl, oapiVersion, + kubernetesConfig.getMasterUrl(), kubernetesConfig.getApiVersion(), + kubernetesConfig.getNamespace(), kubernetesConfig.isTrustCerts(), + kubernetesConfig.isDisableHostnameVerification(), kubernetesConfig.getCaCertFile(), + kubernetesConfig.getCaCertData(), kubernetesConfig.getClientCertFile(), + kubernetesConfig.getClientCertData(), kubernetesConfig.getClientKeyFile(), + kubernetesConfig.getClientKeyData(), kubernetesConfig.getClientKeyAlgo(), kubernetesConfig.getClientKeyPassphrase(), kubernetesConfig.getUsername(), kubernetesConfig.getPassword(), kubernetesConfig.getOauthToken(), kubernetesConfig.getWatchReconnectInterval(), kubernetesConfig.getWatchReconnectLimit(), kubernetesConfig.getConnectionTimeout(), kubernetesConfig.getRequestTimeout(), kubernetesConfig.getRollingTimeout(), kubernetesConfig.getScaleTimeout(), - kubernetesConfig.getLoggingInterval(), - kubernetesConfig.getMaxConcurrentRequests(), - kubernetesConfig.getMaxConcurrentRequestsPerHost(), - kubernetesConfig.getHttpProxy(), - kubernetesConfig.getHttpsProxy(), - kubernetesConfig.getNoProxy(), - kubernetesConfig.getErrorMessages(), - kubernetesConfig.getUserAgent(), - kubernetesConfig.getTlsVersions(), + kubernetesConfig.getLoggingInterval(), kubernetesConfig.getMaxConcurrentRequests(), + kubernetesConfig.getMaxConcurrentRequestsPerHost(), kubernetesConfig.isHttp2Disable(), + kubernetesConfig.getHttpProxy(), kubernetesConfig.getHttpsProxy(), kubernetesConfig.getNoProxy(), + kubernetesConfig.getErrorMessages(), kubernetesConfig.getUserAgent(), + kubernetesConfig.getTlsVersions(), kubernetesConfig.getWebsocketTimeout(), + kubernetesConfig.getWebsocketPingInterval(), kubernetesConfig.getProxyUsername(), + kubernetesConfig.getProxyPassword(), kubernetesConfig.getTrustStoreFile(), + kubernetesConfig.getTrustStorePassphrase(), kubernetesConfig.getKeyStoreFile(), + kubernetesConfig.getKeyStorePassphrase(), kubernetesConfig.getImpersonateUsername(), + kubernetesConfig.getImpersonateGroups(), kubernetesConfig.getImpersonateExtras(), + kubernetesConfig.getOauthTokenProvider(), kubernetesConfig.getCustomHeaders(), + kubernetesConfig.getRequestRetryBackoffLimit(), kubernetesConfig.getRequestRetryBackoffInterval(), + kubernetesConfig.getUploadConnectionTimeout(), kubernetesConfig.getUploadRequestTimeout(), buildTimeout, - kubernetesConfig.getWebsocketTimeout(), - kubernetesConfig.getWebsocketPingInterval(), - kubernetesConfig.getProxyUsername(), - kubernetesConfig.getProxyPassword(), - kubernetesConfig.getTrustStoreFile(), - kubernetesConfig.getTrustStorePassphrase(), - kubernetesConfig.getKeyStoreFile(), - kubernetesConfig.getKeyStorePassphrase(), - kubernetesConfig.getImpersonateUsername(), - kubernetesConfig.getImpersonateGroups(), - kubernetesConfig.getImpersonateExtras(), false, false );