Skip to content

Commit a846155

Browse files
author
Shimin Guo
committed
avoid shadowing
1 parent 4a1e2bb commit a846155

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

kubeconfig/src/Kubernetes/KubeConfig.hs

+12-12
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ This is a mostly straightforward translation into Haskell, with 'FromJSON' and '
1818
-}
1919
module Kubernetes.KubeConfig where
2020

21-
import Data.Aeson (FromJSON (..), Options, ToJSON (..),
22-
Value (..), camelTo2, defaultOptions,
23-
fieldLabelModifier, genericParseJSON,
24-
genericToJSON, object, omitNothingFields,
25-
withObject, (.:), (.=))
26-
import qualified Data.Map as Map
21+
import Data.Aeson (FromJSON (..), Options, ToJSON (..),
22+
Value (..), camelTo2, defaultOptions,
23+
fieldLabelModifier, genericParseJSON,
24+
genericToJSON, object, omitNothingFields,
25+
withObject, (.:), (.=))
26+
import qualified Data.Map as Map
2727
import Data.Proxy
28-
import Data.Semigroup ((<>))
29-
import Data.Text (Text)
30-
import qualified Data.Text as T
28+
import Data.Semigroup ((<>))
29+
import Data.Text (Text)
30+
import qualified Data.Text as T
3131
import Data.Typeable
3232
import GHC.Generics
3333
import GHC.TypeLits
@@ -176,9 +176,9 @@ getAuthInfo cfg@Config {..} = do
176176

177177
-- |Returns the currently active cluster.
178178
getCluster :: Config -> Either String Cluster
179-
getCluster cfg@Config {..} = do
180-
Context {..} <- getContext cfg
181-
let maybeCluster = Map.lookup cluster (toMap clusters)
179+
getCluster cfg@Config {clusters=clusters} = do
180+
Context {cluster=clusterName} <- getContext cfg
181+
let maybeCluster = Map.lookup clusterName (toMap clusters)
182182
case maybeCluster of
183183
Just cluster -> Right cluster
184184
Nothing -> Left ("No cluster named " <> T.unpack cluster)

0 commit comments

Comments
 (0)