Skip to content

Instantly share code, notes, and snippets.

View kevholditch's full-sized avatar
💭
Eat sleep code repeat

Kevin Holditch kevholditch

💭
Eat sleep code repeat
View GitHub Profile
# Vault Helm Chart Value Overrides
global:
enabled: true
tlsDisable: false
injector:
enabled: true
# Use the Vault K8s Image https://github.com/hashicorp/vault-k8s/
image:
repository: "hashicorp/vault-k8s"
@kevholditch
kevholditch / deserialisation.go
Created July 31, 2018 19:01
Custom go JSON deserialisation
func (a *Api) UnmarshalJSON(data []byte) error {
fixedJson := strings.Replace(string(data), `"hosts":{}`, `"hosts":[]`, -1)
fixedJson = strings.Replace(fixedJson, `"uris":{}`, `"uris":[]`, -1)
fixedJson = strings.Replace(fixedJson, `"methods":{}`, `"methods":[]`, -1)
type Alias Api
aux := &struct {
*Alias
}{
@kevholditch
kevholditch / deserialisation.go
Created July 31, 2018 18:57
json deserialisation broken first try
func (a *Api) UnmarshalJSON(data []byte) error {
fixedJson := strings.Replace(string(data), `"hosts":{}`, `"hosts":[]`, -1)
fixedJson = strings.Replace(fixedJson, `"uris":{}`, `"uris":[]`, -1)
fixedJson = strings.Replace(fixedJson, `"methods":{}`, `"methods":[]`, -1)
return json.Unmarshal([]byte(fixedJson), &a)
}
env:
matrix:
- KONG_VERSION=0.11 TF_ACC=1
- KONG_VERSION=0.11.1 TF_ACC=1
- KONG_VERSION=0.11.2 TF_ACC=1
git tag -a v0.1.0 -m "My release"
git push origin v0.1.0
release:
go get github.com/goreleaser/goreleaser; \
goreleaser; \
builds:
- binary: terraform-provider-kong
goos:
- darwin
- linux
- windows
goarch:
- amd64
archive:
format: zip
server {
server_name notification_proxy;
listen 8117;
location / {
resolver $DNS_ADDR ipv6=off;
set_by_lua_block $proxy_addr {
return ngx.unescape_uri(ngx.var.arg_address)
}
#!/usr/local/bin/dumb-init /bin/bash
set -e
export DNS_ADDR=`cat /etc/resolv.conf | grep nameserver | cut -d' ' -f2-`
envsubst '$DNS_ADDR' < /etc/nginx/nginx.template > /usr/local/openresty/nginx/conf/nginx.conf
/usr/local/openresty/bin/openresty -g "daemon off;"
server {
server_name notification_proxy;
listen 8117;
location / {
resolver 127.0.0.11 ipv6=off;
set_by_lua_block $proxy_addr {
return ngx.unescape_uri(ngx.var.arg_address)
}