Comments (5)
Update: I'm making some slow progress towards this issue. #87 will fix (3) in the above list.
I've still to look into a fix for (2). I'm going to tackle it after v0.6.0 is out.
from deck.
This is no longer a problem with Kong 1.4.0.
Kong works fine with empty/null values present in the config file.
from deck.
Adding the header by default when writing, ignore during reading
This is already done and will be available in v0.5.0
Empty/null values should actually be omitted from the dump
Could you give an example of when this was problematic? decK already omits writing anything that has is null.
SNI must be in the format name: sni-value instead of just the sni value as it is currently, because Kong "expecst a record".
Kong should have been able to handle this out of the box.
I'll talk to the Kong team to see if we can include this in Kong itself or add it to decK.
Thank you for the feedback!
from deck.
Thanks for the quick reply.
-
👍
-
It actually does not omit them :) A snippet from the deck dump:
plugins: - name: cors config: credentials: false exposed_headers: null headers: null max_age: null
using
deck sync
works without any issues, however, loading this yaml in a dbless deployment (tried with Kong 1.2), Kong will complain that expects a numeric value, or whatever data type the null field is supposed to be. -
Kong fails to handle this, and in my opinion, since Kong is the more complex piece of software, it makes more sense that deck accommodate to Kong requirements sooner, rather than having Kong team fix this :)
Currently I have an ugly but working shell script, that depends on yq utility:
FILE=output.yaml
## Get the snis of the first element in the certificates array, prefix it with 'name: ' and prepare it as a yq merge script
## $1 - filename
## $2 - certificates array index
yq_snis() {
OUT=`yq r $1 "certificates[$2].snis" | grep -vP '^null$'`
[[ -z "$OUT" ]] && return
echo "$OUT" | sed -E 's,^- ,- name: ,' | sed "1i certificates[$2].snis:"
}
deck --kong-addr $KONG_ADMIN_URL dump -o $FILE
[[ $? -ne 0 ]] && \
echo "[WARNING] Deck dump failed for $KONG_ADMIN_URL, proceeding to process existing $FILE"
echo '_format_version: "1.1"' > $FILE.dbless
sed -E 's,(.*-)?\s*[^:]+:\s*null,\1 ,g' $FILE | yq r - >> $FILE.dbless
IDX=0
OUT=`yq_snis $FILE.dbless $IDX`
while [[ -n "$OUT" ]]; do
## Update the yaml in place
echo "$OUT" | yq w -i -s - $FILE.dbless
IDX=`expr $IDX + 1`
OUT=`yq_snis $FILE.dbless $IDX`
done
from deck.
Thank you for sharing the configuration.
Let me try to experiment what can be done here.
Meanwhile, Kong 1.3 is shipping this week and it contains kong config db_export
command to export all your entities, which can then be consumed by a DB-less Kong node.
from deck.
Related Issues (20)
- deck file render - env substition does not work with string values HOT 4
- deck gateway dump with RS256 JWT consumer secrets cannot be synced without modification
- How to manage deletion of services and routes in distributed configuration HOT 2
- render adding "regex_priority" key to expression route resulting sync to fails
- deck always update rate-limiter plugin config even no changes HOT 1
- Missing Docker image for v1.36.0 HOT 1
- README update download version from 1.8 to latest
- Deck sees blacklist/whitelist in plugins as diffs when run against Kong 2.X
- Please update go version to 1.21.9 or 1.22.2 HOT 3
- Cannot upload new Certificate to Kong using decK HOT 1
- Deck convert from 2.x to 3.x does not handle the escape characters in the regex paths HOT 3
- decK colours do not work correctly in non-tty environment
- OpenAPI 3.1 support for `deck file` commands HOT 3
- Add `deck file echo --selector=...` command HOT 4
- deck file lint: `Error: accepts 1 arg(s), received 0` HOT 4
- Require better validation for patch files for deck file patch command
- Ignore/support _comments and _ignore HOT 2
- Add degraphql entity support
- Send analytics on a best-effort basis
- `service` field under a plugin should be ignored for nested routes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deck.