@@ -6,13 +6,13 @@ module Kubernetes.Client.Config
6
6
, addCACertFile
7
7
, applyAuthSettings
8
8
, clientHooksL
9
- , Kubernetes.Client.Config. cluster
10
9
, defaultTLSClientParams
11
10
, disableServerCertValidation
12
11
, disableServerNameValidation
13
12
, disableValidateAuthMethods
14
- , kubeClient
15
13
, loadPEMCerts
14
+ , mkInClusterClientConfig
15
+ , mkKubeClientConfig
16
16
, newManager
17
17
, onCertificateRequestL
18
18
, onServerCertificateL
@@ -63,11 +63,11 @@ data KubeConfigSource = KubeConfigFile FilePath
63
63
across an application share an 'OIDCCache', this makes sure updation of OAuth
64
64
token is synchronized across all the different clients being used.
65
65
-}
66
- kubeClient
66
+ mkKubeClientConfig
67
67
:: OIDCCache
68
68
-> KubeConfigSource
69
69
-> IO (NH. Manager , K. KubernetesClientConfig )
70
- kubeClient oidcCache (KubeConfigFile f) = do
70
+ mkKubeClientConfig oidcCache (KubeConfigFile f) = do
71
71
kubeConfigFile <- decodeFileThrow f
72
72
masterURI <- getCluster kubeConfigFile
73
73
& fmap server
@@ -83,11 +83,11 @@ kubeClient oidcCache (KubeConfigFile f) = do
83
83
Right (_, auth) -> applyAuthSettings oidcCache auth (tlsParams, clientConfig)
84
84
mgr <- newManager tlsParamsWithAuth
85
85
return (mgr, clientConfigWithAuth)
86
- kubeClient _ (KubeConfigCluster ) = Kubernetes.Client.Config. cluster
86
+ mkKubeClientConfig _ (KubeConfigCluster ) = mkInClusterClientConfig
87
87
88
88
-- | Creates 'NH.Manager' and 'K.KubernetesClientConfig' assuming it is being executed in a pod
89
- cluster :: (MonadIO m , MonadThrow m ) => m (NH. Manager , K. KubernetesClientConfig )
90
- cluster = do
89
+ mkInClusterClientConfig :: (MonadIO m , MonadThrow m ) => m (NH. Manager , K. KubernetesClientConfig )
90
+ mkInClusterClientConfig = do
91
91
caStore <- loadPEMCerts $ serviceAccountDir ++ " /ca.crt"
92
92
defTlsParams <- liftIO defaultTLSClientParams
93
93
mgr <- liftIO . newManager . setCAStore caStore $ disableServerNameValidation defTlsParams
0 commit comments