Skip to content

Commit

Permalink
Ambassador v2 mappings (#56)
Browse files Browse the repository at this point in the history
* Add Ambassador V2 Mappings

* add v2 mappings to package.dhall

* missing idle_timeout_ms default

* Fix mappingv2 pointing to old mapping spec
  • Loading branch information
kevoriordan authored Mar 10, 2020
1 parent 0a51da8 commit 70e28a6
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 2 deletions.
92 changes: 92 additions & 0 deletions kubernetes/ambassador/MappingSpecV2/Type.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{-
Ambassador Mapping Spec
https://www.getambassador.io/reference/mappings/
-}
let Map =
https://prelude.dhall-lang.org/v12.0.0/Map/Type sha256:210c7a9eba71efbb0f7a66b3dcf8b9d3976ffc2bc0e907aadfb6aa29c333e8ed

in { name : Text
, prefix : Text
, service : Text
, add_linkerd_headers : Optional Bool
, add_request_headers :
Optional
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, add_response_headers :
Optional
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, cluster_idle_timeout_ms : Optional Natural
, connect_timeout_ms : Optional Natural
, cors :
Optional
( ../Cors/Type.dhall sha256:0b86d5f694ee3a96e484ae446d6577d203c9db954ed14411ad136cc333ca48f0
? ../Cors/Type.dhall
)
, circuit_breakers :
Optional
( List
( ../CircuitBreaker/Type.dhall sha256:5259c491f2a58dc6645dad41259456b1a5246f03eddbf5157d02cc712e714022
? ../CircuitBreaker/Type.dhall
)
)
, enable_ipv4 : Optional Bool
, enable_ipv6 : Optional Bool
, grpc : Optional Bool
, headers :
Optional
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, host : Optional Text
, host_regex : Optional Bool
, host_rewrite : Optional Text
, idle_timeout_ms : Optional Natural
, load_balancer :
Optional
( ../Loadbalancer/Type.dhall sha256:49728b27fe193b251a030abf3324b36cdcbf898eaf82454078956f73474812e5
? ../Loadbalancer/Type.dhall
)
, method : Optional Text
, method_regex : Optional Bool
, prefix_regex : Optional Bool
, rate_limits :
Optional
( List
( ../RateLimit/Type.dhall sha256:ff00d495134b63b0cf9b13a8d5b8433ec09023e1be6b3ca214009ab501db2c02
? ../RateLimit/Type.dhall
)
)
, remove_request_headers : Optional (List Text)
, remove_response_headers : Optional (List Text)
, regex_headers : Optional (Map Text Text)
, rewrite : Optional Text
, retry_policy :
Optional
( ../RetryPolicy/Type.dhall sha256:72293302405d13f7c649c16c88d49cadbee8fd2101baf6853eef0fd437192acd
? ../RetryPolicy/Type.dhall
)
, timeout_ms : Optional Natural
, tls : Optional Bool
, use_websocket : Optional Bool
, shadow : Optional Bool
, weight : Optional Natural
, auto_host_rewrite : Optional Bool
, case_sensitive : Optional Bool
, host_redirect : Optional Bool
, path_redirect : Optional Text
, precedence : Optional Integer
, bypass_auth : Optional Bool
}
86 changes: 86 additions & 0 deletions kubernetes/ambassador/MappingSpecV2/default.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
let Map =
https://prelude.dhall-lang.org/v12.0.0/Map/Type sha256:210c7a9eba71efbb0f7a66b3dcf8b9d3976ffc2bc0e907aadfb6aa29c333e8ed
? https://prelude.dhall-lang.org/v12.0.0/Map/Type

in { add_linkerd_headers = None Bool
, add_request_headers =
None
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, add_response_headers =
None
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, cluster_idle_timeout_ms = None Natural
, cors =
None
( ../Cors/Type.dhall sha256:0b86d5f694ee3a96e484ae446d6577d203c9db954ed14411ad136cc333ca48f0
? ../Cors/Type.dhall
)
, circuit_breakers =
None
( List
( ../CircuitBreaker/Type.dhall sha256:5259c491f2a58dc6645dad41259456b1a5246f03eddbf5157d02cc712e714022
? ../CircuitBreaker/Type.dhall
)
)
, enable_ipv4 = None Bool
, enable_ipv6 = None Bool
, grpc = None Bool
, headers =
None
( Map
Text
( ../HeaderValue/Type.dhall sha256:39b0867682d87243817188faa79e0eb9d5300cbacb7bcbdfcc7e6cb1c0e30565
? ../HeaderValue/Type.dhall
)
)
, host = None Text
, host_regex = None Bool
, host_rewrite = None Text
, idle_timeout_ms = None Natural
, load_balancer =
None
( ../Loadbalancer/Type.dhall sha256:49728b27fe193b251a030abf3324b36cdcbf898eaf82454078956f73474812e5
? ../Loadbalancer/Type.dhall
)
, method = None Text
, method_regex = None Bool
, prefix_regex = None Bool
, rate_limits =
None
( List
( ../RateLimit/Type.dhall sha256:ff00d495134b63b0cf9b13a8d5b8433ec09023e1be6b3ca214009ab501db2c02
? ../RateLimit/Type.dhall
)
)
, remove_request_headers = None (List Text)
, remove_response_headers = None (List Text)
, regex_headers = None (Map Text Text)
, rewrite = None Text
, retry_policy =
None
( ../RetryPolicy/Type.dhall sha256:72293302405d13f7c649c16c88d49cadbee8fd2101baf6853eef0fd437192acd
? ../RetryPolicy/Type.dhall
)
, timeout_ms = None Natural
, connect_timeout_ms = None Natural
, tls = None Bool
, use_websocket = None Bool
, shadow = None Bool
, weight = None Natural
, auto_host_rewrite = None Bool
, case_sensitive = None Bool
, host_redirect = None Bool
, path_redirect = None Text
, precedence = None Integer
, bypass_auth = None Bool
}
7 changes: 7 additions & 0 deletions kubernetes/ambassador/MappingSpecV2/package.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ Type =
./Type.dhall sha256:c79c13128e0ec1984f8929f5e44311fcd611a8c1c3f0253e4758b7d5d8c49a0c
? ./Type.dhall
, default =
./default.dhall sha256:363d7d2ee579d0c67b5b3774466df7bf900195018abcdd679e9bdeba0815e896
? ./default.dhall
}
17 changes: 17 additions & 0 deletions kubernetes/ambassador/MappingV2/Type.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{-
Ambassador Mapping
https://www.getambassador.io/reference/mappings/
Note: we support only standalone mappings in dhall
-}

let k8s =
../../k8s/1.14.dhall sha256:7839bf40f940757e4d71d3c1b84d878f6a4873c3b2706ae4be307b5991acdcac
? ../../k8s/1.14.dhall

in { apiVersion : Text
, kind : Text
, metadata : k8s.ObjectMeta.Type
, spec :
../MappingSpecV2/Type.dhall sha256:c79c13128e0ec1984f8929f5e44311fcd611a8c1c3f0253e4758b7d5d8c49a0c
? ../MappingSpecV2/Type.dhall
}
1 change: 1 addition & 0 deletions kubernetes/ambassador/MappingV2/default.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ apiVersion = "getambassador.io/v2", kind = "Mapping" }
7 changes: 7 additions & 0 deletions kubernetes/ambassador/MappingV2/package.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ Type =
./Type.dhall sha256:37612b234eee4d02c7b51c7894db1fd05a9371555574f917bc3c83c88ba7d9cb
? ./Type.dhall
, default =
./default.dhall sha256:7e2ca7f1d4a89b214af43ec5144f12cb597923968d814f4489462b4d069d2b67
? ./default.dhall
}
5 changes: 5 additions & 0 deletions kubernetes/ambassador/RateLimit/Type.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{-
Rate limit
https://www.getambassador.io/reference/rate-limits/
-}
{ descriptor : Optional Text, headers : Optional (List Text) }
1 change: 1 addition & 0 deletions kubernetes/ambassador/RateLimit/default.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ descriptor = None Text, headers = None (List Text) }
7 changes: 7 additions & 0 deletions kubernetes/ambassador/RateLimit/package.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ Type =
./Type.dhall sha256:ff00d495134b63b0cf9b13a8d5b8433ec09023e1be6b3ca214009ab501db2c02
? ./Type.dhall
, default =
./default.dhall sha256:907e41ec8746bb69d6cb347ff385dc54da4bfd8257134c72f2651e387a68d9c5
? ./default.dhall
}
9 changes: 9 additions & 0 deletions kubernetes/ambassador/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
, MappingSpec =
./MappingSpec/package.dhall sha256:ac43b68bd088657681858fe761529135357019bfb55faa09cedf85a0df3780ae
? ./MappingSpec/package.dhall
, MappingV2 =
./MappingV2/package.dhall sha256:11efd70c6d3de56593ba26837b7927b09fd29b915330e2160daff8a05a2cfc4a
? ./MappingV2/package.dhall
, MappingSpecV2 =
./MappingSpecV2/package.dhall sha256:fa039d5cf9e82d6b869f50b59db25ac319e4930b6ace9ad8160418de92639415
? ./MappingSpecV2/package.dhall
, RateLimit =
./RateLimit/Type.dhall sha256:ff00d495134b63b0cf9b13a8d5b8433ec09023e1be6b3ca214009ab501db2c02
? ./RateLimit/Type.dhall
, RetryOnValue =
./RetryOnValue/Type.dhall sha256:f4b75c7df63d13e9637cc950fc6109465f6cbaaffb767248e42f963ed36b28b0
? ./RetryOnValue/Type.dhall
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
./argo-events/package.dhall sha256:06fdc660a4abfc141641cfc58855ad52192b9f93d4d8edbaae2f9aba77d1efc7
? ./argo-events/package.dhall
, ambassador =
./ambassador/package.dhall sha256:5aaed07cae5f55f7a989ec39240716e6f9656c47681c552aca8fd138aaf14bcf
./ambassador/package.dhall sha256:cab330e175a5a53fa0ebeaf8087c351ed76e685627b7aade401efffe01c652ec
? ./ambassador/package.dhall
, webhook =
./webhook/package.dhall sha256:a64f1ecb837e63b975ea0f0cb0304c926e3d4d3efab92bc6af163cdea6a24561
Expand Down
2 changes: 1 addition & 1 deletion package.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ kubernetes =
./kubernetes/package.dhall sha256:9612994f4c633ab868b4c2382da64904f77a287f2f5e88d044a60d16266bfbc8
./kubernetes/package.dhall sha256:21f920141bbd3284bf3604dbd3f767826551542d680d989804ac63f8f86892fb
? ./kubernetes/package.dhall
, Prelude =
https://prelude.dhall-lang.org/v12.0.0/package.dhall sha256:aea6817682359ae1939f3a15926b84ad5763c24a3740103202d2eaaea4d01f4c
Expand Down

0 comments on commit 70e28a6

Please sign in to comment.