Config { @JsonProperty("customHeaders") public Map<String, String> getCustomHeaders() { return customHeaders; } @Deprecated  Config(); private  Config(Boolean autoConfigure); @Deprecated  Config(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 maxConcurrentRequestsPerHost, String httpProxy, String httpsProxy, String[] noProxy, Map<Integer, String> 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<String, List<String>> impersonateExtras); @Buildable(builderPackage = "io.fabric8.kubernetes.api.builder", editableEnabled = false)  Config(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 maxConcurrentRequestsPerHost, boolean http2Disable, String httpProxy, String httpsProxy, String[] noProxy, Map<Integer, String> 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<String, List<String>> impersonateExtras, OAuthTokenProvider oauthTokenProvider,Map<String,String> customHeaders); static Config empty(); static Config autoConfigure(String context); static void configFromSysPropsOrEnvVars(Config config); static Config fromKubeconfig(String kubeconfigContents); static Config fromKubeconfig(String context, String kubeconfigContents, String kubeconfigPath); static String getKubeconfigFilename(); static String getKeyAlgorithm(InputStream inputStream); static String getKeyAlgorithm(String clientKeyFile, String clientKeyData); @JsonProperty("oauthToken") String getOauthToken(); void setOauthToken(String oauthToken); @JsonProperty("password") String getPassword(); void setPassword(String password); @JsonProperty("username") String getUsername(); void setUsername(String username); @JsonProperty("impersonateUsername") String getImpersonateUsername(); void setImpersonateUsername(String impersonateUsername); @JsonProperty("impersonateGroups") String[] getImpersonateGroups(); void setImpersonateGroups(String... impersonateGroup); @Deprecated @JsonProperty("impersonateGroup") String getImpersonateGroup(); @Deprecated void setImpersonateGroup(String impersonateGroup); @JsonProperty("impersonateExtras") Map<String, List<String>> getImpersonateExtras(); void setImpersonateExtras(Map<String, List<String>> impersonateExtras); @JsonProperty("clientKeyPassphrase") String getClientKeyPassphrase(); void setClientKeyPassphrase(String clientKeyPassphrase); @JsonProperty("clientKeyAlgo") String getClientKeyAlgo(); void setClientKeyAlgo(String clientKeyAlgo); @JsonProperty("clientKeyData") String getClientKeyData(); void setClientKeyData(String clientKeyData); @JsonProperty("clientKeyFile") String getClientKeyFile(); void setClientKeyFile(String clientKeyFile); @JsonProperty("clientCertData") String getClientCertData(); void setClientCertData(String clientCertData); @JsonProperty("clientCertFile") String getClientCertFile(); void setClientCertFile(String clientCertFile); @JsonProperty("caCertData") String getCaCertData(); void setCaCertData(String caCertData); @JsonProperty("caCertFile") String getCaCertFile(); void setCaCertFile(String caCertFile); @JsonProperty("apiVersion") String getApiVersion(); void setApiVersion(String apiVersion); @JsonProperty("masterUrl") String getMasterUrl(); void setMasterUrl(String masterUrl); @JsonProperty("trustCerts") boolean isTrustCerts(); void setTrustCerts(boolean trustCerts); @JsonProperty("disableHostnameVerification") boolean isDisableHostnameVerification(); void setDisableHostnameVerification(boolean disableHostnameVerification); @JsonProperty("watchReconnectInterval") int getWatchReconnectInterval(); void setWatchReconnectInterval(int watchReconnectInterval); @JsonProperty("watchReconnectLimit") int getWatchReconnectLimit(); void setWatchReconnectLimit(int watchReconnectLimit); @JsonProperty("errorMessages") Map<Integer, String> getErrorMessages(); void setErrorMessages(Map<Integer, String> errorMessages); static ConfigBuilder builder(); @JsonProperty("connectionTimeout") int getConnectionTimeout(); void setConnectionTimeout(int connectionTimeout); @JsonProperty("requestTimeout") int getRequestTimeout(); void setRequestTimeout(int requestTimeout); @JsonProperty("rollingTimeout") long getRollingTimeout(); void setRollingTimeout(long rollingTimeout); @JsonProperty("scaleTimeout") long getScaleTimeout(); void setScaleTimeout(long scaleTimeout); @JsonProperty("loggingInterval") int getLoggingInterval(); void setLoggingInterval(int loggingInterval); @JsonProperty("http2Disable") boolean isHttp2Disable(); void setHttp2Disable(boolean http2Disable); void setHttpProxy(String httpProxy); @JsonProperty("httpProxy") String getHttpProxy(); void setHttpsProxy(String httpsProxy); @JsonProperty("httpsProxy") String getHttpsProxy(); void setNoProxy(String[] noProxy); @JsonProperty("noProxy") String[] getNoProxy(); @JsonProperty("namespace") String getNamespace(); void setNamespace(String namespace); @JsonProperty("userAgent") String getUserAgent(); void setUserAgent(String userAgent); @JsonProperty("tlsVersions") TlsVersion[] getTlsVersions(); void setTlsVersions(TlsVersion[] tlsVersions); @JsonProperty("websocketTimeout") long getWebsocketTimeout(); void setWebsocketTimeout(long websocketTimeout); @JsonProperty("websocketPingInterval") long getWebsocketPingInterval(); void setWebsocketPingInterval(long websocketPingInterval); int getMaxConcurrentRequests(); void setMaxConcurrentRequests(int maxConcurrentRequests); int getMaxConcurrentRequestsPerHost(); void setMaxConcurrentRequestsPerHost(int maxConcurrentRequestsPerHost); @JsonProperty("proxyUsername") String getProxyUsername(); void setProxyUsername(String proxyUsername); @JsonProperty("proxyPassword") String getProxyPassword(); void setProxyPassword(String proxyPassword); RequestConfig getRequestConfig(); void setTrustStorePassphrase(String trustStorePassphrase); @JsonProperty("trustStorePassphrase") String getTrustStorePassphrase(); void setKeyStorePassphrase(String keyStorePassphrase); @JsonProperty("keyStorePassphrase") String getKeyStorePassphrase(); void setTrustStoreFile(String trustStoreFile); @JsonProperty("trustStoreFile") String getTrustStoreFile(); void setKeyStoreFile(String keyStoreFile); @JsonProperty("keyStoreFile") String getKeyStoreFile(); @JsonIgnore OAuthTokenProvider getOauthTokenProvider(); void setOauthTokenProvider(OAuthTokenProvider oauthTokenProvider); @JsonProperty("customHeaders") Map<String, String> getCustomHeaders(); void setCustomHeaders(Map<String, String> customHeaders); Boolean getAutoConfigure(); List<NamedContext> getContexts(); void setContexts(List<NamedContext> contexts); NamedContext getCurrentContext(); void setCurrentContext(NamedContext context); File getFile(); static final String KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY; static final String KUBERNETES_MASTER_SYSTEM_PROPERTY; static final String KUBERNETES_API_VERSION_SYSTEM_PROPERTY; static final String KUBERNETES_TRUST_CERT_SYSTEM_PROPERTY; static final String KUBERNETES_DISABLE_HOSTNAME_VERIFICATION_SYSTEM_PROPERTY; static final String KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY; static final String KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_CERTIFICATE_FILE_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_CERTIFICATE_DATA_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_KEY_FILE_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_KEY_DATA_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_KEY_ALGO_SYSTEM_PROPERTY; static final String KUBERNETES_CLIENT_KEY_PASSPHRASE_SYSTEM_PROPERTY; static final String KUBERNETES_AUTH_BASIC_USERNAME_SYSTEM_PROPERTY; static final String KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY; static final String KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY; static final String KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY; static final String KUBERNETES_OAUTH_TOKEN_SYSTEM_PROPERTY; static final String KUBERNETES_WATCH_RECONNECT_INTERVAL_SYSTEM_PROPERTY; static final String KUBERNETES_WATCH_RECONNECT_LIMIT_SYSTEM_PROPERTY; static final String KUBERNETES_CONNECTION_TIMEOUT_SYSTEM_PROPERTY; static final String KUBERNETES_REQUEST_TIMEOUT_SYSTEM_PROPERTY; static final String KUBERNETES_ROLLING_TIMEOUT_SYSTEM_PROPERTY; static final String KUBERNETES_LOGGING_INTERVAL_SYSTEM_PROPERTY; static final String KUBERNETES_SCALE_TIMEOUT_SYSTEM_PROPERTY; static final String KUBERNETES_WEBSOCKET_TIMEOUT_SYSTEM_PROPERTY; static final String KUBERNETES_WEBSOCKET_PING_INTERVAL_SYSTEM_PROPERTY; static final String KUBERNETES_MAX_CONCURRENT_REQUESTS; static final String KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST; static final String KUBERNETES_IMPERSONATE_USERNAME; static final String KUBERNETES_IMPERSONATE_GROUP; static final String KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY; static final String KUBERNETES_TRUSTSTORE_FILE_PROPERTY; static final String KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY; static final String KUBERNETES_KEYSTORE_FILE_PROPERTY; static final String KUBERNETES_TLS_VERSIONS; static final String KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY; static final String KUBERNETES_NAMESPACE_PATH; static final String KUBERNETES_NAMESPACE_FILE; static final String KUBERNETES_NAMESPACE_SYSTEM_PROPERTY; static final String KUBERNETES_KUBECONFIG_FILE; static final String KUBERNETES_SERVICE_HOST_PROPERTY; static final String KUBERNETES_SERVICE_PORT_PROPERTY; static final String KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH; static final String KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH; static final String KUBERNETES_HTTP2_DISABLE; static final String KUBERNETES_HTTP_PROXY; static final String KUBERNETES_HTTPS_PROXY; static final String KUBERNETES_ALL_PROXY; static final String KUBERNETES_NO_PROXY; static final String KUBERNETES_PROXY_USERNAME; static final String KUBERNETES_PROXY_PASSWORD; static final String KUBERNETES_USER_AGENT; static final String DEFAULT_MASTER_URL; static final Long DEFAULT_ROLLING_TIMEOUT; static final Long DEFAULT_SCALE_TIMEOUT; static final int DEFAULT_LOGGING_INTERVAL; static final Long DEFAULT_WEBSOCKET_TIMEOUT; static final Long DEFAULT_WEBSOCKET_PING_INTERVAL; static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS; static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST; static final String HTTP_PROTOCOL_PREFIX; static final String HTTPS_PROTOCOL_PREFIX; }
@Test void testWithCustomHeader() { Map<String,String> customHeaders = new HashMap<>(); customHeaders.put("user-id","test-user"); customHeaders.put("cluster-id","test-cluster"); Config config = new ConfigBuilder() .withCustomHeaders(customHeaders) .build(); assertNotNull(config); assertNotNull(config.getCustomHeaders()); assertEquals(2,config.getCustomHeaders().size()); }