-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUILD/MAJOR: cn: update client native to v3
- Loading branch information
Showing
71 changed files
with
498 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit | ||
set -o pipefail | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
command -v yq >/dev/null 2>&1 || { echo >&2 "yq not installed. Aborting."; exit 1; } | ||
command -v jq >/dev/null 2>&1 || { echo >&2 "jq not installed. Aborting."; exit 1; } | ||
CN_COMMIT=$(go list -m github.com/haproxytech/client-native/v2 | sed 's/^.*-//') | ||
|
||
CN_COMMIT=$(go list -m github.com/haproxytech/client-native/v3 | sed 's/^.*-//') | ||
|
||
if [ -z "$1" ]; then echo >&2 "No model name supplied. Aborting."; exit 1; fi | ||
if [ -z "$CN_COMMIT" ]; then echo >&2 "Unable to get git commit for CN module. Aborting."; exit 1; fi | ||
|
||
curl -sk https://raw.githubusercontent.com/haproxytech/client-native/$CN_COMMIT/specification/models/configuration.yaml | | ||
yq | | ||
jq --arg MODEL $1 '.| | ||
jq --arg MODEL $1 '.| | ||
reduce paths as $p(.; | ||
if $p[0] == $MODEL and $p[-1] == "$ref" then | ||
if $p[0] == $MODEL and $p[-1] == "$ref" then | ||
setpath($p[0:-1];getpath(getpath($p) | split("/")[-1]| split(" "))) | ||
else | ||
. | ||
else | ||
. | ||
end | ||
) | | ||
.[$MODEL] | | ||
) | | ||
.[$MODEL] | | ||
walk( | ||
if type == "object" then with_entries( | ||
if type == "object" then with_entries( | ||
if .key == "x-nullable" then | ||
if .value == false then | ||
empty | ||
else | ||
.key = "nullable" | ||
end | ||
elif (.key | contains("x-")) then | ||
empty | ||
else | ||
. | ||
end | ||
elif (.key | contains("x-")) then | ||
empty | ||
else | ||
. | ||
end | ||
) else . end | ||
)' | | ||
yq -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.