Skip to content

Commit 0911424

Browse files
committed
Almost there with Stackage lts-21.0
1 parent bc1985b commit 0911424

File tree

7 files changed

+43
-47
lines changed

7 files changed

+43
-47
lines changed

Diff for: kubernetes-client/kubernetes-client.cabal

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.35.1.
3+
-- This file has been generated from package.yaml by hpack version 0.35.2.
44
--
55
-- see: https://github.com/sol/hpack
66

@@ -61,16 +61,16 @@ library
6161
, http-client >=0.5 && <0.8
6262
, http-client-tls >=0.3
6363
, jose-jwt >=0.8
64-
, jsonpath >=0.1 && <0.3
64+
, jsonpath >=0.1 && <0.4
6565
, kubernetes-client-core ==0.4.3.0
6666
, microlens >=0.4
6767
, mtl >=2.2
6868
, oidc-client >=0.4
6969
, pem >=0.2
7070
, safe-exceptions >=0.1.0.0
7171
, stm >=2.4
72-
, streaming-bytestring >=0.1 && <0.3
73-
, text >=0.11 && <1.3
72+
, streaming-bytestring >=0.1 && <0.4
73+
, text >=0.11 && <3
7474
, time >=1.8
7575
, timerep >=2.0
7676
, tls >=1.4.1
@@ -107,7 +107,7 @@ test-suite example
107107
, http-client >=0.5 && <0.8
108108
, http-client-tls >=0.3
109109
, jose-jwt >=0.8
110-
, jsonpath >=0.1 && <0.3
110+
, jsonpath >=0.1 && <0.4
111111
, kubernetes-client
112112
, kubernetes-client-core ==0.4.3.0
113113
, microlens >=0.4
@@ -116,8 +116,8 @@ test-suite example
116116
, pem >=0.2
117117
, safe-exceptions >=0.1.0.0
118118
, stm >=2.4
119-
, streaming-bytestring >=0.1 && <0.3
120-
, text >=0.11 && <1.3
119+
, streaming-bytestring >=0.1 && <0.4
120+
, text >=0.11 && <3
121121
, time >=1.8
122122
, timerep >=2.0
123123
, tls >=1.4.1
@@ -162,7 +162,7 @@ test-suite spec
162162
, http-client >=0.5 && <0.8
163163
, http-client-tls >=0.3
164164
, jose-jwt >=0.8
165-
, jsonpath >=0.1 && <0.3
165+
, jsonpath >=0.1 && <0.4
166166
, kubernetes-client
167167
, kubernetes-client-core ==0.4.3.0
168168
, microlens >=0.4
@@ -171,8 +171,8 @@ test-suite spec
171171
, pem >=0.2
172172
, safe-exceptions >=0.1.0.0
173173
, stm >=2.4
174-
, streaming-bytestring >=0.1 && <0.3
175-
, text >=0.11 && <1.3
174+
, streaming-bytestring >=0.1 && <0.4
175+
, text >=0.11 && <3
176176
, time >=1.8
177177
, timerep >=2.0
178178
, tls >=1.4.1

Diff for: kubernetes-client/package.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies:
4141
- bytestring >=0.10
4242
- aeson >=1.2 && <3
4343
- attoparsec >=0.13
44-
- jsonpath >=0.1 && <0.3
44+
- jsonpath >=0.1 && <0.4
4545
- connection >=0.2
4646
- containers >= 0.5
4747
- data-default-class >=0.1
@@ -58,8 +58,8 @@ dependencies:
5858
- pem >=0.2
5959
- safe-exceptions >=0.1.0.0
6060
- stm >=2.4
61-
- streaming-bytestring >= 0.1 && < 0.3
62-
- text >=0.11 && <1.3
61+
- streaming-bytestring >= 0.1 && < 0.4
62+
- text >=0.11 && <3
6363
- time >=1.8
6464
- timerep >=2.0
6565
- tls >=1.4.1

Diff for: kubernetes-client/src/Kubernetes/Client/Auth/OIDC.hs

+8-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ instance AuthMethod OIDCAuth where
6060
$ setHeader req [("Authorization", "Bearer " <> (Text.encodeUtf8 token))]
6161
& L.set rAuthTypesL []
6262

63-
data OIDCGetTokenException = OIDCOAuthException (OAuth2Error OAuth2TokenRequest.Errors)
64-
| OIDCURIException URIParseError
65-
| OIDCGetTokenException String
63+
data OIDCGetTokenException =
64+
#if MIN_VERSION_hoauth2(2,8,0)
65+
OIDCOAuthException TokenRequestError
66+
#else
67+
OIDCOAuthException (OAuth2Error OAuth2TokenRequest.Errors)
68+
#endif
69+
| OIDCURIException URIParseError
70+
| OIDCGetTokenException String
6671
deriving Show
6772
instance Exception OIDCGetTokenException
6873

Diff for: kubernetes-client/src/Kubernetes/Data/K8sJSONPath.hs

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{-# LANGUAGE OverloadedStrings #-}
2+
{-# LANGUAGE CPP #-}
23
module Kubernetes.Data.K8sJSONPath where
34

5+
import Control.Applicative ((<|>))
46
import Data.Aeson
57
import Data.Aeson.Text
8+
import Data.Attoparsec.Text ( many1, char, takeWhile1, Parser )
69
import Data.JSONPath
710
import Data.Monoid ((<>))
811
import Data.Text as Text
9-
10-
import Control.Applicative ((<|>))
11-
import Data.Attoparsec.Text
1212
import Data.Text.Lazy (toStrict)
1313

14+
1415
data K8sPathElement = PlainText Text
1516
| JSONPath [JSONPathElement]
1617
deriving (Show, Eq)
@@ -25,7 +26,11 @@ plainTextParser :: Parser K8sPathElement
2526
plainTextParser = PlainText <$> takeWhile1 (/= '{')
2627

2728
jsonpathParser :: Parser K8sPathElement
29+
#if MIN_VERSION_jsonpath(0,3,0)
30+
jsonpathParser = JSONPath <$> (char '{' *> jsonPath undefined <* char '}')
31+
#else
2832
jsonpathParser = JSONPath <$> (char '{' *> jsonPath <* char '}')
33+
#endif
2934

3035
runJSONPath :: [K8sPathElement] -> Value -> Either String Text
3136
runJSONPath [] _ = pure ""
@@ -38,10 +43,15 @@ runPathElement :: K8sPathElement -> Value -> Either String Text
3843
runPathElement (PlainText t) _ = pure t
3944
runPathElement (JSONPath p) v = encodeResult $ executeJSONPath p v
4045

46+
#if MIN_VERSION_jsonpath(0,3,0)
47+
encodeResult :: [Value] -> Either String Text
48+
encodeResult vals = return $ (intercalate " " $ Prelude.map jsonToText vals)
49+
#else
4150
encodeResult :: ExecutionResult Value -> Either String Text
4251
encodeResult (ResultValue val) = return $ jsonToText val
4352
encodeResult (ResultList vals) = return $ (intercalate " " $ Prelude.map jsonToText vals)
4453
encodeResult (ResultError err) = Left err
54+
#endif
4555

4656
jsonToText :: Value -> Text
4757
jsonToText (String t) = t

Diff for: kubernetes/kubernetes-client-core.cabal

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ library
4343
, containers >=0.5.0.0 && <0.8
4444
, deepseq >= 1.4 && <1.6
4545
, exceptions >= 0.4
46-
, http-api-data >= 0.3.4 && <0.5
46+
, http-api-data >= 0.3.4 && <0.6
4747
, http-client >=0.5 && <0.8
4848
, http-client-tls
4949
, http-media >= 0.4 && < 0.9
@@ -54,11 +54,11 @@ library
5454
, network >=2.6.2 && <3.9
5555
, random >=1.1
5656
, safe-exceptions <0.2
57-
, text >=0.11 && <1.3
57+
, text >=0.11 && <3
5858
, time >=1.5
5959
, transformers >=0.4.0.0
6060
, unordered-containers
61-
, vector >=0.10.9 && <0.13
61+
, vector >=0.10.9 && <0.14
6262
other-modules:
6363
Paths_kubernetes_client_core
6464
Kubernetes.OpenAPI.ImportMappings

Diff for: stack.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
resolver: lts-20.11
2-
compiler: ghc-9.2.5
3-
4-
extra-deps:
5-
- jsonpath-0.2.1.0
6-
- oidc-client-0.7.0.1
1+
resolver: lts-21.0
72

83
packages:
94
- kubernetes

Diff for: stack.yaml.lock

+5-19
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,10 @@
33
# For more information, please see the documentation at:
44
# https://docs.haskellstack.org/en/stable/lock_files
55

6-
packages:
7-
- completed:
8-
hackage: jsonpath-0.2.1.0@sha256:0a16677ca023ce46344d0f4812e076578f7b21fc0bec6a21fda227b7b33e1447,1929
9-
pantry-tree:
10-
sha256: b477413421c0856e2ac2ba85f7308fe1192d7a9f9ec7c1f4be3de3c0d4cf6de5
11-
size: 1097
12-
original:
13-
hackage: jsonpath-0.2.1.0
14-
- completed:
15-
hackage: oidc-client-0.7.0.1@sha256:557341f7521e62c09abddf0d06c8e8acce119d3a9a4c4ffac1ab8ca3fc0e5067,3382
16-
pantry-tree:
17-
sha256: 51cfcd6c170923db24ba297ac9937961f6b26e041ceec8ff09500e61017b433b
18-
size: 1298
19-
original:
20-
hackage: oidc-client-0.7.0.1
6+
packages: []
217
snapshots:
228
- completed:
23-
sha256: adbc602422dde10cc330175da7de8609e70afc41449a7e2d6e8b1827aa0e5008
24-
size: 649342
25-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/11.yaml
26-
original: lts-20.11
9+
sha256: 1867d84255dff8c87373f5dd03e5a5cb1c10a99587e26c8793e750c54e83ffdc
10+
size: 639139
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/0.yaml
12+
original: lts-21.0

0 commit comments

Comments
 (0)