diff --git a/Makefile b/Makefile index 24d2078b7..e159379d2 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ codegen-crds: codegen-conversion codegen-cli-docs: ## Generate CLI docs codegen-cli-docs: build @echo Generate cli docs... >&2 - @rm -rf website/docs/reference/commands && mkdir -p website/reference/docs/commands + @rm -rf website/docs/reference/commands && mkdir -p website/docs/reference/commands @./$(CLI_BIN) docs -o website/docs/reference/commands --autogenTag=false .PHONY: codegen-api-docs diff --git a/go.mod b/go.mod index 2992f082f..ff5a1c75c 100644 --- a/go.mod +++ b/go.mod @@ -10,10 +10,10 @@ require ( github.com/go-logr/logr v1.4.2 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/hashicorp/go-getter v1.7.6 - github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a + github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f github.com/jstemmer/go-junit-report/v2 v2.1.0 github.com/kudobuilder/kuttl v0.19.0 - github.com/kyverno/kyverno-json v0.0.4-0.20240927170902-0e22204b6718 + github.com/kyverno/kyverno-json v0.0.4-0.20240930153201-bab63edcc39f github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/prometheus/common v0.59.1 diff --git a/go.sum b/go.sum index ecce95e7b..e77d1168a 100644 --- a/go.sum +++ b/go.sum @@ -449,8 +449,8 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a h1:baQnVszUF+wENqBnqJDlgmSIBpJLMqQE0i+hICMZ9sI= -github.com/jmespath-community/go-jmespath v1.1.2-0.20240919193755-5e4e8ae73c8a/go.mod h1:VL6C6nwf/wRivvXAjziX9yFRVmvOC1qzERc8RTQ0tv4= +github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f h1:odDspPS6qzM68hfqzW5U/nADXItki7GdRSPJbMM1phY= +github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f/go.mod h1:VL6C6nwf/wRivvXAjziX9yFRVmvOC1qzERc8RTQ0tv4= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -483,8 +483,8 @@ github.com/kudobuilder/kuttl v0.19.0 h1:6fJ20R5lqCtY1c5K2UkCZH50kEHMoyuzpz+8+Mob github.com/kudobuilder/kuttl v0.19.0/go.mod h1:LgyzxMNqEpxev3N7Lu1T6mbo5E1ABiTzpXiekkhxx64= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/kyverno/kyverno-json v0.0.4-0.20240927170902-0e22204b6718 h1:+pwh7CjMQygWKYPppA3JZbC/CrRlBUKw5br4fIzdKfA= -github.com/kyverno/kyverno-json v0.0.4-0.20240927170902-0e22204b6718/go.mod h1:VTWmJihVuZcuBBWIuzMZebEDdpe0kX+wXz3PS9/p35Y= +github.com/kyverno/kyverno-json v0.0.4-0.20240930153201-bab63edcc39f h1:hlCU+XbKNoqkrlyKid7VdHA3NGp0CRi53AfsEg26+Fw= +github.com/kyverno/kyverno-json v0.0.4-0.20240930153201-bab63edcc39f/go.mod h1:Jp02iiWHohF4jzgkytd+EobGuaHBpfPfx7Trd7G2zrk= github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c h1:lAolpR9H8BwM5lRRvgCQ8JowswyxZRH+fgtIQzHFVCk= github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c/go.mod h1:02vxM0GNXz9+B/i6+rMfWAIwibUuAH+qFsd73IFskgQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/website/docs/reference/jp/examples/add.md b/website/docs/reference/jp/examples/add.md index 6fa1ebeca..5b1d1e1d9 100644 --- a/website/docs/reference/jp/examples/add.md +++ b/website/docs/reference/jp/examples/add.md @@ -6,7 +6,7 @@ ## Description -does arithmetic addition of two specified values of numbers, quantities, and durations +Does arithmetic addition of two specified values of numbers, quantities, and durations. ## Examples diff --git a/website/docs/reference/jp/examples/base64_decode.md b/website/docs/reference/jp/examples/base64_decode.md index b2797c24f..bdde6024d 100644 --- a/website/docs/reference/jp/examples/base64_decode.md +++ b/website/docs/reference/jp/examples/base64_decode.md @@ -6,7 +6,7 @@ ## Description -decodes a base 64 string +Decodes a base 64 string. ## Examples diff --git a/website/docs/reference/jp/examples/base64_encode.md b/website/docs/reference/jp/examples/base64_encode.md index 5f574edc4..b8b9a559f 100644 --- a/website/docs/reference/jp/examples/base64_encode.md +++ b/website/docs/reference/jp/examples/base64_encode.md @@ -6,7 +6,7 @@ ## Description -encodes a regular, plaintext and unencoded string to base64 +Encodes a regular, plaintext and unencoded string to base64. ## Examples diff --git a/website/docs/reference/jp/examples/compare.md b/website/docs/reference/jp/examples/compare.md index 4f9eb3bc8..092428dd4 100644 --- a/website/docs/reference/jp/examples/compare.md +++ b/website/docs/reference/jp/examples/compare.md @@ -6,7 +6,7 @@ ## Description -compares two strings lexicographically +Compares two strings lexicographically. ## Examples diff --git a/website/docs/reference/jp/examples/divide.md b/website/docs/reference/jp/examples/divide.md index 887818b01..e470ecd07 100644 --- a/website/docs/reference/jp/examples/divide.md +++ b/website/docs/reference/jp/examples/divide.md @@ -6,7 +6,7 @@ ## Description -divisor must be non zero +Divisor must be non zero. ## Examples diff --git a/website/docs/reference/jp/examples/equal_fold.md b/website/docs/reference/jp/examples/equal_fold.md index bba0d27f6..617351011 100644 --- a/website/docs/reference/jp/examples/equal_fold.md +++ b/website/docs/reference/jp/examples/equal_fold.md @@ -6,7 +6,7 @@ ## Description -allows comparing two strings for equivalency where the only differences are letter cases +Allows comparing two strings for equivalency where the only differences are letter cases. ## Examples diff --git a/website/docs/reference/jp/examples/find_first.md b/website/docs/reference/jp/examples/find_first.md index 64581b440..5301412f1 100644 --- a/website/docs/reference/jp/examples/find_first.md +++ b/website/docs/reference/jp/examples/find_first.md @@ -6,7 +6,7 @@ ## Description - +Returns the zero-based index of the first occurence where the substring appears in a string or null if it does not appear. ## Examples diff --git a/website/docs/reference/jp/examples/find_last.md b/website/docs/reference/jp/examples/find_last.md index e1e4ec33b..247d0d234 100644 --- a/website/docs/reference/jp/examples/find_last.md +++ b/website/docs/reference/jp/examples/find_last.md @@ -6,7 +6,7 @@ ## Description - +Returns the zero-based index of the last occurence where the substring appears in a string or null if it does not appear. ## Examples diff --git a/website/docs/reference/jp/examples/from_items.md b/website/docs/reference/jp/examples/from_items.md index 9f6dc3d0c..bf6a4cf28 100644 --- a/website/docs/reference/jp/examples/from_items.md +++ b/website/docs/reference/jp/examples/from_items.md @@ -6,7 +6,7 @@ ## Description - +Returns an object from the provided array of key value pairs. This function is the inversed of the `items()` function. ## Examples diff --git a/website/docs/reference/jp/examples/group_by.md b/website/docs/reference/jp/examples/group_by.md index e1691afbd..37d0413cf 100644 --- a/website/docs/reference/jp/examples/group_by.md +++ b/website/docs/reference/jp/examples/group_by.md @@ -6,7 +6,7 @@ ## Description - +Groups an array of objects using an expression as the group key. ## Examples diff --git a/website/docs/reference/jp/examples/items.md b/website/docs/reference/jp/examples/items.md index d52d86fef..313593a18 100644 --- a/website/docs/reference/jp/examples/items.md +++ b/website/docs/reference/jp/examples/items.md @@ -6,7 +6,7 @@ ## Description -converts a map or array to an array of objects where each key:value is an item in the array +Converts a map or array to an array of objects where each key:value is an item in the array. ## Examples diff --git a/website/docs/reference/jp/examples/label_match.md b/website/docs/reference/jp/examples/label_match.md index 4a10bd0fd..123d05bc2 100644 --- a/website/docs/reference/jp/examples/label_match.md +++ b/website/docs/reference/jp/examples/label_match.md @@ -6,7 +6,7 @@ ## Description -object arguments must be enclosed in backticks; ex. `{{request.object.spec.template.metadata.labels}}` +Object arguments must be enclosed in backticks; ex. `{{request.object.spec.template.metadata.labels}}`. ## Examples diff --git a/website/docs/reference/jp/examples/lookup.md b/website/docs/reference/jp/examples/lookup.md index 7f07e84cf..b31615508 100644 --- a/website/docs/reference/jp/examples/lookup.md +++ b/website/docs/reference/jp/examples/lookup.md @@ -6,7 +6,7 @@ ## Description -returns the value corresponding to the given key/index in the given object/array +Returns the value corresponding to the given key/index in the given object/array. ## Examples diff --git a/website/docs/reference/jp/examples/modulo.md b/website/docs/reference/jp/examples/modulo.md index ac30e15a1..3829a255e 100644 --- a/website/docs/reference/jp/examples/modulo.md +++ b/website/docs/reference/jp/examples/modulo.md @@ -6,7 +6,7 @@ ## Description -divisor must be non-zero, arguments must be integers +Divisor must be non-zero, arguments must be integers. ## Examples diff --git a/website/docs/reference/jp/examples/multiply.md b/website/docs/reference/jp/examples/multiply.md index 1c2e98706..445679d5a 100644 --- a/website/docs/reference/jp/examples/multiply.md +++ b/website/docs/reference/jp/examples/multiply.md @@ -6,7 +6,7 @@ ## Description -does arithmetic multiplication of two specified values of numbers, quantities, and durations +Does arithmetic multiplication of two specified values of numbers, quantities, and durations. ## Examples diff --git a/website/docs/reference/jp/examples/object_from_lists.md b/website/docs/reference/jp/examples/object_from_lists.md index 136e57b3f..c18d93142 100644 --- a/website/docs/reference/jp/examples/object_from_lists.md +++ b/website/docs/reference/jp/examples/object_from_lists.md @@ -6,7 +6,7 @@ ## Description -converts a pair of lists containing keys and values to an object +Converts a pair of lists containing keys and values to an object. ## Examples diff --git a/website/docs/reference/jp/examples/pad_left.md b/website/docs/reference/jp/examples/pad_left.md index c0c14c7aa..0f89dc076 100644 --- a/website/docs/reference/jp/examples/pad_left.md +++ b/website/docs/reference/jp/examples/pad_left.md @@ -6,7 +6,7 @@ ## Description - +Adds characters to the beginning of a string. ## Examples diff --git a/website/docs/reference/jp/examples/pad_right.md b/website/docs/reference/jp/examples/pad_right.md index d8d34c4e4..e665941a9 100644 --- a/website/docs/reference/jp/examples/pad_right.md +++ b/website/docs/reference/jp/examples/pad_right.md @@ -6,7 +6,7 @@ ## Description - +Adds characters to the end of a string. ## Examples diff --git a/website/docs/reference/jp/examples/parse_json.md b/website/docs/reference/jp/examples/parse_json.md index bf4883c46..146b7421a 100644 --- a/website/docs/reference/jp/examples/parse_json.md +++ b/website/docs/reference/jp/examples/parse_json.md @@ -6,7 +6,7 @@ ## Description -decodes a valid JSON encoded string to the appropriate type. Opposite of `to_string` function +Decodes a valid JSON encoded string to the appropriate type. Opposite of `to_string` function. ## Examples diff --git a/website/docs/reference/jp/examples/parse_yaml.md b/website/docs/reference/jp/examples/parse_yaml.md index 76586120a..d12b5e5b1 100644 --- a/website/docs/reference/jp/examples/parse_yaml.md +++ b/website/docs/reference/jp/examples/parse_yaml.md @@ -6,7 +6,7 @@ ## Description -decodes a valid YAML encoded string to the appropriate type provided it can be represented as JSON +Decodes a valid YAML encoded string to the appropriate type provided it can be represented as JSON. ## Examples diff --git a/website/docs/reference/jp/examples/path_canonicalize.md b/website/docs/reference/jp/examples/path_canonicalize.md index 45b142b95..b3b65611b 100644 --- a/website/docs/reference/jp/examples/path_canonicalize.md +++ b/website/docs/reference/jp/examples/path_canonicalize.md @@ -6,7 +6,7 @@ ## Description -normalizes or canonicalizes a given path by removing excess slashes +Normalizes or canonicalizes a given path by removing excess slashes. ## Examples diff --git a/website/docs/reference/jp/examples/pattern_match.md b/website/docs/reference/jp/examples/pattern_match.md index 39a992970..3a141b402 100644 --- a/website/docs/reference/jp/examples/pattern_match.md +++ b/website/docs/reference/jp/examples/pattern_match.md @@ -6,7 +6,7 @@ ## Description -'*' matches zero or more alphanumeric characters, '?' matches a single alphanumeric character +'*' matches zero or more alphanumeric characters, '?' matches a single alphanumeric character. ## Examples diff --git a/website/docs/reference/jp/examples/random.md b/website/docs/reference/jp/examples/random.md index 5fe791617..9009cb8f2 100644 --- a/website/docs/reference/jp/examples/random.md +++ b/website/docs/reference/jp/examples/random.md @@ -6,7 +6,7 @@ ## Description -Generates a random sequence of characters +Generates a random sequence of characters. ## Examples diff --git a/website/docs/reference/jp/examples/regex_match.md b/website/docs/reference/jp/examples/regex_match.md index de289ee80..aa37e7feb 100644 --- a/website/docs/reference/jp/examples/regex_match.md +++ b/website/docs/reference/jp/examples/regex_match.md @@ -6,7 +6,7 @@ ## Description -first string is the regular exression which is compared with second input which can be a number or string +First string is the regular exression which is compared with second input which can be a number or string. ## Examples diff --git a/website/docs/reference/jp/examples/regex_replace_all.md b/website/docs/reference/jp/examples/regex_replace_all.md index 9ab41ab9d..7658490e5 100644 --- a/website/docs/reference/jp/examples/regex_replace_all.md +++ b/website/docs/reference/jp/examples/regex_replace_all.md @@ -6,7 +6,7 @@ ## Description -converts all parameters to string +Converts all parameters to string. ## Examples diff --git a/website/docs/reference/jp/examples/regex_replace_all_literal.md b/website/docs/reference/jp/examples/regex_replace_all_literal.md index a8453812d..0145d9669 100644 --- a/website/docs/reference/jp/examples/regex_replace_all_literal.md +++ b/website/docs/reference/jp/examples/regex_replace_all_literal.md @@ -6,7 +6,7 @@ ## Description -converts all parameters to string +Converts all parameters to string. ## Examples diff --git a/website/docs/reference/jp/examples/replace.md b/website/docs/reference/jp/examples/replace.md index 729ce7f7c..60ef302e1 100644 --- a/website/docs/reference/jp/examples/replace.md +++ b/website/docs/reference/jp/examples/replace.md @@ -6,7 +6,7 @@ ## Description -replaces a specified number of instances of the source string with the replacement string in a parent +Replaces a specified number of instances of the source string with the replacement string in a parent. ## Examples diff --git a/website/docs/reference/jp/examples/replace_all.md b/website/docs/reference/jp/examples/replace_all.md index 8e32ed2c6..764cf025c 100644 --- a/website/docs/reference/jp/examples/replace_all.md +++ b/website/docs/reference/jp/examples/replace_all.md @@ -6,7 +6,7 @@ ## Description -replace all instances of one string with another in an overall parent string +Replace all instances of one string with another in an overall parent string. ## Examples diff --git a/website/docs/reference/jp/examples/round.md b/website/docs/reference/jp/examples/round.md index 4b9f69a45..807961ca7 100644 --- a/website/docs/reference/jp/examples/round.md +++ b/website/docs/reference/jp/examples/round.md @@ -6,7 +6,7 @@ ## Description -does roundoff to upto the given decimal places +Does roundoff to upto the given decimal places. ## Examples diff --git a/website/docs/reference/jp/examples/semver_compare.md b/website/docs/reference/jp/examples/semver_compare.md index cfff2bc59..737fe7fab 100644 --- a/website/docs/reference/jp/examples/semver_compare.md +++ b/website/docs/reference/jp/examples/semver_compare.md @@ -6,7 +6,7 @@ ## Description -compares two strings which comply with the semantic versioning schema and outputs a boolean response as to the position of the second relative to the first +Compares two strings which comply with the semantic versioning schema and outputs a boolean response as to the position of the second relative to the first. ## Examples diff --git a/website/docs/reference/jp/examples/split.md b/website/docs/reference/jp/examples/split.md index bcda9782a..6bec4f228 100644 --- a/website/docs/reference/jp/examples/split.md +++ b/website/docs/reference/jp/examples/split.md @@ -6,7 +6,7 @@ ## Description -splits the first string when the second string is found and converts it into an array +Splits the first string when the second string is found and converts it into an array. ## Examples diff --git a/website/docs/reference/jp/examples/subtract.md b/website/docs/reference/jp/examples/subtract.md index c0135b10d..f920d633f 100644 --- a/website/docs/reference/jp/examples/subtract.md +++ b/website/docs/reference/jp/examples/subtract.md @@ -6,7 +6,7 @@ ## Description -does arithmetic subtraction of two specified values of numbers, quantities, and durations +Does arithmetic subtraction of two specified values of numbers, quantities, and durations. ## Examples diff --git a/website/docs/reference/jp/examples/sum.md b/website/docs/reference/jp/examples/sum.md index 734a58fba..1a3f07a1d 100644 --- a/website/docs/reference/jp/examples/sum.md +++ b/website/docs/reference/jp/examples/sum.md @@ -6,7 +6,7 @@ ## Description -does arithmetic addition of specified array of values of numbers, quantities, and durations +Does arithmetic addition of specified array of values of numbers, quantities, and durations. ## Examples diff --git a/website/docs/reference/jp/examples/time_add.md b/website/docs/reference/jp/examples/time_add.md index 78b2a99eb..c390bc906 100644 --- a/website/docs/reference/jp/examples/time_add.md +++ b/website/docs/reference/jp/examples/time_add.md @@ -6,7 +6,7 @@ ## Description -adds duration (second string) to a time value (first string) +Adds duration (second string) to a time value (first string). ## Examples diff --git a/website/docs/reference/jp/examples/time_after.md b/website/docs/reference/jp/examples/time_after.md index 65e1d3b28..d4bd6d10b 100644 --- a/website/docs/reference/jp/examples/time_after.md +++ b/website/docs/reference/jp/examples/time_after.md @@ -6,7 +6,7 @@ ## Description -checks if a time is after another time, both in RFC3339 format +Checks if a time is after another time, both in RFC3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_before.md b/website/docs/reference/jp/examples/time_before.md index d58117fe8..20d44bb1c 100644 --- a/website/docs/reference/jp/examples/time_before.md +++ b/website/docs/reference/jp/examples/time_before.md @@ -6,7 +6,7 @@ ## Description -checks if a time is before another time, both in RFC3339 format +Checks if a time is before another time, both in RFC3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_between.md b/website/docs/reference/jp/examples/time_between.md index 5427a0d64..3a93c5340 100644 --- a/website/docs/reference/jp/examples/time_between.md +++ b/website/docs/reference/jp/examples/time_between.md @@ -6,7 +6,7 @@ ## Description -checks if a time is between a start and end time, all in RFC3339 format +Checks if a time is between a start and end time, all in RFC3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_diff.md b/website/docs/reference/jp/examples/time_diff.md index e9361ff55..b563fdba3 100644 --- a/website/docs/reference/jp/examples/time_diff.md +++ b/website/docs/reference/jp/examples/time_diff.md @@ -6,7 +6,7 @@ ## Description -calculate the difference between a start and end date in RFC3339 format +Calculate the difference between a start and end date in RFC3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_now.md b/website/docs/reference/jp/examples/time_now.md index 032872d61..cc7703a93 100644 --- a/website/docs/reference/jp/examples/time_now.md +++ b/website/docs/reference/jp/examples/time_now.md @@ -6,7 +6,7 @@ ## Description -returns current time in RFC 3339 format +Returns current time in RFC 3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_now_utc.md b/website/docs/reference/jp/examples/time_now_utc.md index 09c9e175c..1e592e513 100644 --- a/website/docs/reference/jp/examples/time_now_utc.md +++ b/website/docs/reference/jp/examples/time_now_utc.md @@ -6,7 +6,7 @@ ## Description -returns current UTC time in RFC 3339 format +Returns current UTC time in RFC 3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/time_parse.md b/website/docs/reference/jp/examples/time_parse.md index c25d5f7f7..f26491237 100644 --- a/website/docs/reference/jp/examples/time_parse.md +++ b/website/docs/reference/jp/examples/time_parse.md @@ -6,7 +6,7 @@ ## Description -changes a time value of a given layout to RFC 3339 +Changes a time value of a given layout to RFC 3339. ## Examples diff --git a/website/docs/reference/jp/examples/time_since.md b/website/docs/reference/jp/examples/time_since.md index 747835891..a59cb42ab 100644 --- a/website/docs/reference/jp/examples/time_since.md +++ b/website/docs/reference/jp/examples/time_since.md @@ -6,7 +6,7 @@ ## Description -calculate the difference between a start and end period of time where the end may either be a static definition or the then-current time +Calculate the difference between a start and end period of time where the end may either be a static definition or the then-current time. ## Examples diff --git a/website/docs/reference/jp/examples/time_to_cron.md b/website/docs/reference/jp/examples/time_to_cron.md index 81eaba27b..fec580a5a 100644 --- a/website/docs/reference/jp/examples/time_to_cron.md +++ b/website/docs/reference/jp/examples/time_to_cron.md @@ -6,7 +6,7 @@ ## Description -converts a time (RFC 3339) to a cron expression (string). +Converts a time (RFC 3339) to a cron expression (string). ## Examples diff --git a/website/docs/reference/jp/examples/time_truncate.md b/website/docs/reference/jp/examples/time_truncate.md index b3571e830..9ac84eb2b 100644 --- a/website/docs/reference/jp/examples/time_truncate.md +++ b/website/docs/reference/jp/examples/time_truncate.md @@ -6,7 +6,7 @@ ## Description -returns the result of rounding time down to a multiple of duration +Returns the result of rounding time down to a multiple of duration. ## Examples diff --git a/website/docs/reference/jp/examples/time_utc.md b/website/docs/reference/jp/examples/time_utc.md index 18fa705ec..6c3f97e86 100644 --- a/website/docs/reference/jp/examples/time_utc.md +++ b/website/docs/reference/jp/examples/time_utc.md @@ -6,7 +6,7 @@ ## Description -calcutes time in UTC from a given time in RFC 3339 format +Calcutes time in UTC from a given time in RFC 3339 format. ## Examples diff --git a/website/docs/reference/jp/examples/to_array.md b/website/docs/reference/jp/examples/to_array.md index e055205d6..3fccae0bc 100644 --- a/website/docs/reference/jp/examples/to_array.md +++ b/website/docs/reference/jp/examples/to_array.md @@ -6,7 +6,7 @@ ## Description - +Returns a one element array containing the passed in argument, or the passed in value if it's an array. ## Examples diff --git a/website/docs/reference/jp/examples/to_lower.md b/website/docs/reference/jp/examples/to_lower.md index 0eb1f670b..a675d8f48 100644 --- a/website/docs/reference/jp/examples/to_lower.md +++ b/website/docs/reference/jp/examples/to_lower.md @@ -6,7 +6,7 @@ ## Description -takes in a string and outputs the same string with all lower-case letters +Takes in a string and outputs the same string with all lower-case letters. ## Examples diff --git a/website/docs/reference/jp/examples/to_upper.md b/website/docs/reference/jp/examples/to_upper.md index 4674f4573..48c8e107d 100644 --- a/website/docs/reference/jp/examples/to_upper.md +++ b/website/docs/reference/jp/examples/to_upper.md @@ -6,7 +6,7 @@ ## Description -takes in a string and outputs the same string with all upper-case letters +Takes in a string and outputs the same string with all upper-case letters. ## Examples diff --git a/website/docs/reference/jp/examples/trim.md b/website/docs/reference/jp/examples/trim.md index a7c7704a2..e2fdafc45 100644 --- a/website/docs/reference/jp/examples/trim.md +++ b/website/docs/reference/jp/examples/trim.md @@ -6,7 +6,7 @@ ## Description -trims both ends of the source string by characters appearing in the second string +Trims both ends of the source string by characters appearing in the second string. ## Examples diff --git a/website/docs/reference/jp/examples/trim_left.md b/website/docs/reference/jp/examples/trim_left.md index 11b50986d..f09359830 100644 --- a/website/docs/reference/jp/examples/trim_left.md +++ b/website/docs/reference/jp/examples/trim_left.md @@ -6,7 +6,7 @@ ## Description - +Removes the leading characters found in the passed in string argument. ## Examples diff --git a/website/docs/reference/jp/examples/trim_prefix.md b/website/docs/reference/jp/examples/trim_prefix.md index e347ba6e6..7fb25e745 100644 --- a/website/docs/reference/jp/examples/trim_prefix.md +++ b/website/docs/reference/jp/examples/trim_prefix.md @@ -6,7 +6,7 @@ ## Description -trims the second string prefix from the first string if the first string starts with the prefix +Trims the second string prefix from the first string if the first string starts with the prefix. ## Examples diff --git a/website/docs/reference/jp/examples/trim_right.md b/website/docs/reference/jp/examples/trim_right.md index e8c3136b8..d16fb39bc 100644 --- a/website/docs/reference/jp/examples/trim_right.md +++ b/website/docs/reference/jp/examples/trim_right.md @@ -6,7 +6,7 @@ ## Description - +Removes the trailing characters found in the passed in string argument. ## Examples diff --git a/website/docs/reference/jp/examples/truncate.md b/website/docs/reference/jp/examples/truncate.md index 7a498877c..d1602c137 100644 --- a/website/docs/reference/jp/examples/truncate.md +++ b/website/docs/reference/jp/examples/truncate.md @@ -6,7 +6,7 @@ ## Description -length argument must be enclosed in backticks; ex. "{{request.object.metadata.name | truncate(@, `9`)}}" +Length argument must be enclosed in backticks; ex. "{{request.object.metadata.name | truncate(@, `9`)}}". ## Examples diff --git a/website/docs/reference/jp/examples/x509_decode.md b/website/docs/reference/jp/examples/x509_decode.md index c3720740b..83fbb50cd 100644 --- a/website/docs/reference/jp/examples/x509_decode.md +++ b/website/docs/reference/jp/examples/x509_decode.md @@ -6,7 +6,7 @@ ## Description -decodes an x.509 certificate to an object. you may also use this in conjunction with `base64_decode` jmespath function to decode a base64-encoded certificate +Decodes an x.509 certificate to an object. you may also use this in conjunction with `base64_decode` jmespath function to decode a base64-encoded certificate. ## Examples diff --git a/website/docs/reference/jp/examples/zip.md b/website/docs/reference/jp/examples/zip.md index 559325b5a..a22a7d984 100644 --- a/website/docs/reference/jp/examples/zip.md +++ b/website/docs/reference/jp/examples/zip.md @@ -6,7 +6,7 @@ ## Description - +Accepts one or more arrays as arguments and returns an array of arrays in which the i-th array contains the i-th element from each of the argument arrays. The returned array is truncated to the length of the shortest argument array. ## Examples diff --git a/website/docs/reference/jp/functions.md b/website/docs/reference/jp/functions.md index 2e03996b5..e3272cc40 100644 --- a/website/docs/reference/jp/functions.md +++ b/website/docs/reference/jp/functions.md @@ -8,121 +8,121 @@ ## built-in functions -| Name | Signature | Description | -|---|---|---| -| [abs](./examples/abs.md) | `abs(number)` | Returns the absolute value of the provided argument. | -| [avg](./examples/avg.md) | `avg(array[number])` | Returns the average of the elements in the provided array. An empty array will produce a return value of null. | -| [ceil](./examples/ceil.md) | `ceil(number)` | Returns the next highest integer value by rounding up if necessary. | -| [contains](./examples/contains.md) | `contains(array|string, any)` | Returns `true` if the given subject contains the provided search value. If the subject is an array, this function returns `true` if one of the elements in the array is equal to the provided search value. If the provided subject is a string, this function returns `true` if the string contains the provided search argument. | -| [ends_with](./examples/ends_with.md) | `ends_with(string, string)` | Reports whether the given string ends with the provided suffix argument. | -| [find_first](./examples/find_first.md) | `find_first(string, string, number, number)` | | -| [find_last](./examples/find_last.md) | `find_last(string, string, number, number)` | | -| [floor](./examples/floor.md) | `floor(number)` | Returns the next lowest integer value by rounding down if necessary. | -| [from_items](./examples/from_items.md) | `from_items(array[array])` | | -| [group_by](./examples/group_by.md) | `group_by(array, expref)` | | -| [items](./examples/items.md) | `items(object)` | Converts a given object into an array of key-value pairs. | -| [join](./examples/join.md) | `join(string, array[string])` | Returns all of the elements from the provided array joined together using the glue argument as a separator between each. | -| [keys](./examples/keys.md) | `keys(object)` | Returns an array containing the keys of the provided object. | -| [length](./examples/length.md) | `length(string|array|object)` | Returns the length of the given argument. If the argument is a string this function returns the number of code points in the string. If the argument is an array this function returns the number of elements in the array. If the argument is an object this function returns the number of key-value pairs in the object. | -| [lower](./examples/lower.md) | `lower(string)` | Returns the given string with all Unicode letters mapped to their lower case. | -| [map](./examples/map.md) | `map(expref, array)` | Transforms elements in a given array and returns the result. | -| [max](./examples/max.md) | `max(array[number]|array[string])` | Returns the highest found element in the provided array argument. An empty array will produce a return value of null. | -| [max_by](./examples/max_by.md) | `max_by(array, expref)` | Returns the highest found element using a custom expression to compute the associated value for each element in the input array. | -| [merge](./examples/merge.md) | `merge(object)` | Meges a list of objects together and returns the result. | -| [min](./examples/min.md) | `min(array[number]|array[string])` | Returns the lowest found element in the provided array argument. | -| [min_by](./examples/min_by.md) | `min_by(array, expref)` | Returns the lowest found element using a custom expression to compute the associated value for each element in the input array. | -| [not_null](./examples/not_null.md) | `not_null(any)` | Returns the first non null element in the input array. | -| [pad_left](./examples/pad_left.md) | `pad_left(string, number, string)` | | -| [pad_right](./examples/pad_right.md) | `pad_right(string, number, string)` | | -| [replace](./examples/replace.md) | `replace(string, string, string, number)` | Returns a copy of the input string with instances of old string argument replaced by new string argument. | -| [reverse](./examples/reverse.md) | `reverse(array|string)` | Reverses the input string or array and returns the result. | -| [sort](./examples/sort.md) | `sort(array[string]|array[number])` | This function accepts an array argument and returns the sorted elements as an array. | -| [sort_by](./examples/sort_by.md) | `sort_by(array, expref)` | This function accepts an array argument and returns the sorted elements as an array using a custom expression to compute the associated value for each element. | -| [split](./examples/split.md) | `split(string, string, number)` | Slices input string into substrings separated by a string argument and returns an array of the substrings between those separators. | -| [starts_with](./examples/starts_with.md) | `starts_with(string, string)` | Reports whether the input string begins with the provided string prefix argument. | -| [sum](./examples/sum.md) | `sum(array[number])` | Returns the sum of all numbers contained in the provided array. | -| [to_array](./examples/to_array.md) | `to_array(any)` | | -| [to_number](./examples/to_number.md) | `to_number(any)` | Returns the parsed number. | -| [to_string](./examples/to_string.md) | `to_string(any)` | The JSON encoded value of the given argument. | -| [trim](./examples/trim.md) | `trim(string, string)` | | -| [trim_left](./examples/trim_left.md) | `trim_left(string, string)` | | -| [trim_right](./examples/trim_right.md) | `trim_right(string, string)` | | -| [type](./examples/type.md) | `type(any)` | Returns the JavaScript type of the given argument as a string value. | -| [upper](./examples/upper.md) | `upper(string)` | Returns the given string with all Unicode letters mapped to their upper case. | -| [values](./examples/values.md) | `values(object)` | Returns the values of the provided object. | -| [zip](./examples/zip.md) | `zip(array, array)` | | +| Name | Description | +|---|---| +| [abs](./examples/abs.md) | Returns the absolute value of the provided argument. | +| [avg](./examples/avg.md) | Returns the average of the elements in the provided array. An empty array will produce a return value of null. | +| [ceil](./examples/ceil.md) | Returns the next highest integer value by rounding up if necessary. | +| [contains](./examples/contains.md) | Returns `true` if the given subject contains the provided search value. If the subject is an array, this function returns `true` if one of the elements in the array is equal to the provided search value. If the provided subject is a string, this function returns `true` if the string contains the provided search argument. | +| [ends_with](./examples/ends_with.md) | Reports whether the given string ends with the provided suffix argument. | +| [find_first](./examples/find_first.md) | Returns the zero-based index of the first occurence where the substring appears in a string or null if it does not appear. | +| [find_last](./examples/find_last.md) | Returns the zero-based index of the last occurence where the substring appears in a string or null if it does not appear. | +| [floor](./examples/floor.md) | Returns the next lowest integer value by rounding down if necessary. | +| [from_items](./examples/from_items.md) | Returns an object from the provided array of key value pairs. This function is the inversed of the `items()` function. | +| [group_by](./examples/group_by.md) | Groups an array of objects using an expression as the group key. | +| [items](./examples/items.md) | Converts a given object into an array of key-value pairs. | +| [join](./examples/join.md) | Returns all of the elements from the provided array joined together using the glue argument as a separator between each. | +| [keys](./examples/keys.md) | Returns an array containing the keys of the provided object. | +| [length](./examples/length.md) | Returns the length of the given argument. If the argument is a string this function returns the number of code points in the string. If the argument is an array this function returns the number of elements in the array. If the argument is an object this function returns the number of key-value pairs in the object. | +| [lower](./examples/lower.md) | Returns the given string with all Unicode letters mapped to their lower case. | +| [map](./examples/map.md) | Transforms elements in a given array and returns the result. | +| [max](./examples/max.md) | Returns the highest found element in the provided array argument. An empty array will produce a return value of null. | +| [max_by](./examples/max_by.md) | Returns the highest found element using a custom expression to compute the associated value for each element in the input array. | +| [merge](./examples/merge.md) | Meges a list of objects together and returns the result. | +| [min](./examples/min.md) | Returns the lowest found element in the provided array argument. | +| [min_by](./examples/min_by.md) | Returns the lowest found element using a custom expression to compute the associated value for each element in the input array. | +| [not_null](./examples/not_null.md) | Returns the first non null element in the input array. | +| [pad_left](./examples/pad_left.md) | Adds characters to the beginning of a string. | +| [pad_right](./examples/pad_right.md) | Adds characters to the end of a string. | +| [replace](./examples/replace.md) | Returns a copy of the input string with instances of old string argument replaced by new string argument. | +| [reverse](./examples/reverse.md) | Reverses the input string or array and returns the result. | +| [sort](./examples/sort.md) | This function accepts an array argument and returns the sorted elements as an array. | +| [sort_by](./examples/sort_by.md) | This function accepts an array argument and returns the sorted elements as an array using a custom expression to compute the associated value for each element. | +| [split](./examples/split.md) | Slices input string into substrings separated by a string argument and returns an array of the substrings between those separators. | +| [starts_with](./examples/starts_with.md) | Reports whether the input string begins with the provided string prefix argument. | +| [sum](./examples/sum.md) | Returns the sum of all numbers contained in the provided array. | +| [to_array](./examples/to_array.md) | Returns a one element array containing the passed in argument, or the passed in value if it's an array. | +| [to_number](./examples/to_number.md) | Returns the parsed number. | +| [to_string](./examples/to_string.md) | The JSON encoded value of the given argument. | +| [trim](./examples/trim.md) | Removes the leading and trailing characters found in the passed in string argument. | +| [trim_left](./examples/trim_left.md) | Removes the leading characters found in the passed in string argument. | +| [trim_right](./examples/trim_right.md) | Removes the trailing characters found in the passed in string argument. | +| [type](./examples/type.md) | Returns the JavaScript type of the given argument as a string value. | +| [upper](./examples/upper.md) | Returns the given string with all Unicode letters mapped to their upper case. | +| [values](./examples/values.md) | Returns the values of the provided object. | +| [zip](./examples/zip.md) | Accepts one or more arrays as arguments and returns an array of arrays in which the i-th array contains the i-th element from each of the argument arrays. The returned array is truncated to the length of the shortest argument array. | ## kyverno-json functions -| Name | Signature | Description | -|---|---|---| -| [at](./examples/at.md) | `at(array, number)` | Returns the element in an array at the given index. | -| [concat](./examples/concat.md) | `concat(string, string)` | Concatenates two strings together and returns the result. | -| [json_parse](./examples/json_parse.md) | `json_parse(string)` | Parses a given JSON string into an object. | -| [wildcard](./examples/wildcard.md) | `wildcard(string, string)` | Compares a wildcard pattern with a given string and returns if they match or not. | +| Name | Description | +|---|---| +| [at](./examples/at.md) | Returns the element in an array at the given index. | +| [concat](./examples/concat.md) | Concatenates two strings together and returns the result. | +| [json_parse](./examples/json_parse.md) | Parses a given JSON string into an object. | +| [wildcard](./examples/wildcard.md) | Compares a wildcard pattern with a given string and returns if they match or not. | ## kyverno functions -| Name | Signature | Description | -|---|---|---| -| [compare](./examples/compare.md) | `compare(string, string)` | compares two strings lexicographically | -| [equal_fold](./examples/equal_fold.md) | `equal_fold(string, string)` | allows comparing two strings for equivalency where the only differences are letter cases | -| [replace](./examples/replace.md) | `replace(string, string, string, number)` | replaces a specified number of instances of the source string with the replacement string in a parent | -| [replace_all](./examples/replace_all.md) | `replace_all(string, string, string)` | replace all instances of one string with another in an overall parent string | -| [to_upper](./examples/to_upper.md) | `to_upper(string)` | takes in a string and outputs the same string with all upper-case letters | -| [to_lower](./examples/to_lower.md) | `to_lower(string)` | takes in a string and outputs the same string with all lower-case letters | -| [trim](./examples/trim.md) | `trim(string, string)` | trims both ends of the source string by characters appearing in the second string | -| [trim_prefix](./examples/trim_prefix.md) | `trim_prefix(string, string)` | trims the second string prefix from the first string if the first string starts with the prefix | -| [split](./examples/split.md) | `split(string, string)` | splits the first string when the second string is found and converts it into an array | -| [regex_replace_all](./examples/regex_replace_all.md) | `regex_replace_all(string, string|number, string|number)` | converts all parameters to string | -| [regex_replace_all_literal](./examples/regex_replace_all_literal.md) | `regex_replace_all_literal(string, string|number, string|number)` | converts all parameters to string | -| [regex_match](./examples/regex_match.md) | `regex_match(string, string|number)` | first string is the regular exression which is compared with second input which can be a number or string | -| [pattern_match](./examples/pattern_match.md) | `pattern_match(string, string|number)` | '*' matches zero or more alphanumeric characters, '?' matches a single alphanumeric character | -| [label_match](./examples/label_match.md) | `label_match(object, object)` | object arguments must be enclosed in backticks; ex. `{{request.object.spec.template.metadata.labels}}` | -| [to_boolean](./examples/to_boolean.md) | `to_boolean(string)` | It returns true or false for any string, such as 'True', 'TruE', 'False', 'FAlse', 'faLSE', etc. | -| [add](./examples/add.md) | `add(any, any)` | does arithmetic addition of two specified values of numbers, quantities, and durations | -| [sum](./examples/sum.md) | `sum(array)` | does arithmetic addition of specified array of values of numbers, quantities, and durations | -| [subtract](./examples/subtract.md) | `subtract(any, any)` | does arithmetic subtraction of two specified values of numbers, quantities, and durations | -| [multiply](./examples/multiply.md) | `multiply(any, any)` | does arithmetic multiplication of two specified values of numbers, quantities, and durations | -| [divide](./examples/divide.md) | `divide(any, any)` | divisor must be non zero | -| [modulo](./examples/modulo.md) | `modulo(any, any)` | divisor must be non-zero, arguments must be integers | -| [round](./examples/round.md) | `round(number, number)` | does roundoff to upto the given decimal places | -| [base64_decode](./examples/base64_decode.md) | `base64_decode(string)` | decodes a base 64 string | -| [base64_encode](./examples/base64_encode.md) | `base64_encode(string)` | encodes a regular, plaintext and unencoded string to base64 | -| [time_since](./examples/time_since.md) | `time_since(string, string, string)` | calculate the difference between a start and end period of time where the end may either be a static definition or the then-current time | -| [time_now](./examples/time_now.md) | `time_now()` | returns current time in RFC 3339 format | -| [time_now_utc](./examples/time_now_utc.md) | `time_now_utc()` | returns current UTC time in RFC 3339 format | -| [path_canonicalize](./examples/path_canonicalize.md) | `path_canonicalize(string)` | normalizes or canonicalizes a given path by removing excess slashes | -| [truncate](./examples/truncate.md) | `truncate(string, number)` | length argument must be enclosed in backticks; ex. "{{request.object.metadata.name | truncate(@, `9`)}}" | -| [semver_compare](./examples/semver_compare.md) | `semver_compare(string, string)` | compares two strings which comply with the semantic versioning schema and outputs a boolean response as to the position of the second relative to the first | -| [parse_json](./examples/parse_json.md) | `parse_json(string)` | decodes a valid JSON encoded string to the appropriate type. Opposite of `to_string` function | -| [parse_yaml](./examples/parse_yaml.md) | `parse_yaml(string)` | decodes a valid YAML encoded string to the appropriate type provided it can be represented as JSON | -| [lookup](./examples/lookup.md) | `lookup(object|array, string|number)` | returns the value corresponding to the given key/index in the given object/array | -| [items](./examples/items.md) | `items(object|array, string, string)` | converts a map or array to an array of objects where each key:value is an item in the array | -| [object_from_lists](./examples/object_from_lists.md) | `object_from_lists(array, array)` | converts a pair of lists containing keys and values to an object | -| [random](./examples/random.md) | `random(string)` | Generates a random sequence of characters | -| [x509_decode](./examples/x509_decode.md) | `x509_decode(string)` | decodes an x.509 certificate to an object. you may also use this in conjunction with `base64_decode` jmespath function to decode a base64-encoded certificate | -| [time_to_cron](./examples/time_to_cron.md) | `time_to_cron(string)` | converts a time (RFC 3339) to a cron expression (string). | -| [time_add](./examples/time_add.md) | `time_add(string, string)` | adds duration (second string) to a time value (first string) | -| [time_parse](./examples/time_parse.md) | `time_parse(string, string)` | changes a time value of a given layout to RFC 3339 | -| [time_utc](./examples/time_utc.md) | `time_utc(string)` | calcutes time in UTC from a given time in RFC 3339 format | -| [time_diff](./examples/time_diff.md) | `time_diff(string, string)` | calculate the difference between a start and end date in RFC3339 format | -| [time_before](./examples/time_before.md) | `time_before(string, string)` | checks if a time is before another time, both in RFC3339 format | -| [time_after](./examples/time_after.md) | `time_after(string, string)` | checks if a time is after another time, both in RFC3339 format | -| [time_between](./examples/time_between.md) | `time_between(string, string, string)` | checks if a time is between a start and end time, all in RFC3339 format | -| [time_truncate](./examples/time_truncate.md) | `time_truncate(string, string)` | returns the result of rounding time down to a multiple of duration | +| Name | Description | +|---|---| +| [compare](./examples/compare.md) | Compares two strings lexicographically. | +| [equal_fold](./examples/equal_fold.md) | Allows comparing two strings for equivalency where the only differences are letter cases. | +| [replace](./examples/replace.md) | Replaces a specified number of instances of the source string with the replacement string in a parent. | +| [replace_all](./examples/replace_all.md) | Replace all instances of one string with another in an overall parent string. | +| [to_upper](./examples/to_upper.md) | Takes in a string and outputs the same string with all upper-case letters. | +| [to_lower](./examples/to_lower.md) | Takes in a string and outputs the same string with all lower-case letters. | +| [trim](./examples/trim.md) | Trims both ends of the source string by characters appearing in the second string. | +| [trim_prefix](./examples/trim_prefix.md) | Trims the second string prefix from the first string if the first string starts with the prefix. | +| [split](./examples/split.md) | Splits the first string when the second string is found and converts it into an array. | +| [regex_replace_all](./examples/regex_replace_all.md) | Converts all parameters to string. | +| [regex_replace_all_literal](./examples/regex_replace_all_literal.md) | Converts all parameters to string. | +| [regex_match](./examples/regex_match.md) | First string is the regular exression which is compared with second input which can be a number or string. | +| [pattern_match](./examples/pattern_match.md) | '*' matches zero or more alphanumeric characters, '?' matches a single alphanumeric character. | +| [label_match](./examples/label_match.md) | Object arguments must be enclosed in backticks; ex. `{{request.object.spec.template.metadata.labels}}`. | +| [to_boolean](./examples/to_boolean.md) | It returns true or false for any string, such as 'True', 'TruE', 'False', 'FAlse', 'faLSE', etc. | +| [add](./examples/add.md) | Does arithmetic addition of two specified values of numbers, quantities, and durations. | +| [sum](./examples/sum.md) | Does arithmetic addition of specified array of values of numbers, quantities, and durations. | +| [subtract](./examples/subtract.md) | Does arithmetic subtraction of two specified values of numbers, quantities, and durations. | +| [multiply](./examples/multiply.md) | Does arithmetic multiplication of two specified values of numbers, quantities, and durations. | +| [divide](./examples/divide.md) | Divisor must be non zero. | +| [modulo](./examples/modulo.md) | Divisor must be non-zero, arguments must be integers. | +| [round](./examples/round.md) | Does roundoff to upto the given decimal places. | +| [base64_decode](./examples/base64_decode.md) | Decodes a base 64 string. | +| [base64_encode](./examples/base64_encode.md) | Encodes a regular, plaintext and unencoded string to base64. | +| [time_since](./examples/time_since.md) | Calculate the difference between a start and end period of time where the end may either be a static definition or the then-current time. | +| [time_now](./examples/time_now.md) | Returns current time in RFC 3339 format. | +| [time_now_utc](./examples/time_now_utc.md) | Returns current UTC time in RFC 3339 format. | +| [path_canonicalize](./examples/path_canonicalize.md) | Normalizes or canonicalizes a given path by removing excess slashes. | +| [truncate](./examples/truncate.md) | Length argument must be enclosed in backticks; ex. "{{request.object.metadata.name | truncate(@, `9`)}}". | +| [semver_compare](./examples/semver_compare.md) | Compares two strings which comply with the semantic versioning schema and outputs a boolean response as to the position of the second relative to the first. | +| [parse_json](./examples/parse_json.md) | Decodes a valid JSON encoded string to the appropriate type. Opposite of `to_string` function. | +| [parse_yaml](./examples/parse_yaml.md) | Decodes a valid YAML encoded string to the appropriate type provided it can be represented as JSON. | +| [lookup](./examples/lookup.md) | Returns the value corresponding to the given key/index in the given object/array. | +| [items](./examples/items.md) | Converts a map or array to an array of objects where each key:value is an item in the array. | +| [object_from_lists](./examples/object_from_lists.md) | Converts a pair of lists containing keys and values to an object. | +| [random](./examples/random.md) | Generates a random sequence of characters. | +| [x509_decode](./examples/x509_decode.md) | Decodes an x.509 certificate to an object. you may also use this in conjunction with `base64_decode` jmespath function to decode a base64-encoded certificate. | +| [time_to_cron](./examples/time_to_cron.md) | Converts a time (RFC 3339) to a cron expression (string). | +| [time_add](./examples/time_add.md) | Adds duration (second string) to a time value (first string). | +| [time_parse](./examples/time_parse.md) | Changes a time value of a given layout to RFC 3339. | +| [time_utc](./examples/time_utc.md) | Calcutes time in UTC from a given time in RFC 3339 format. | +| [time_diff](./examples/time_diff.md) | Calculate the difference between a start and end date in RFC3339 format. | +| [time_before](./examples/time_before.md) | Checks if a time is before another time, both in RFC3339 format. | +| [time_after](./examples/time_after.md) | Checks if a time is after another time, both in RFC3339 format. | +| [time_between](./examples/time_between.md) | Checks if a time is between a start and end time, all in RFC3339 format. | +| [time_truncate](./examples/time_truncate.md) | Returns the result of rounding time down to a multiple of duration. | ## chainsaw functions -| Name | Signature | Description | -|---|---|---| -| [env](./examples/env.md) | `env(string)` | Returns the value of the environment variable passed in argument. | -| [x_k8s_get](./examples/x_k8s_get.md) | `x_k8s_get(any, string, string, string, string)` | Gets a resource from a Kubernetes cluster. | -| [x_k8s_list](./examples/x_k8s_list.md) | `x_k8s_list(any, string, string, string)` | Lists resources from a Kubernetes cluster. | -| [x_k8s_exists](./examples/x_k8s_exists.md) | `x_k8s_exists(any, string, string, string, string)` | Checks if a given resource exists in a Kubernetes cluster. | -| [x_k8s_resource_exists](./examples/x_k8s_resource_exists.md) | `x_k8s_resource_exists(any, string, string)` | Checks if a given resource type is available in a Kubernetes cluster. | -| [x_k8s_server_version](./examples/x_k8s_server_version.md) | `x_k8s_server_version(any)` | Returns the version of a Kubernetes cluster. | -| [x_metrics_decode](./examples/x_metrics_decode.md) | `x_metrics_decode(string)` | Decodes metrics in the Prometheus text format. | -| [trim_space](./examples/trim_space.md) | `trim_space(string)` | Trims leading and trailing spaces from the string passed in argument. | -| [as_string](./examples/as_string.md) | `as_string(any)` | Returns the passed in argument converted into a string. | +| Name | Description | +|---|---| +| [env](./examples/env.md) | Returns the value of the environment variable passed in argument. | +| [x_k8s_get](./examples/x_k8s_get.md) | Gets a resource from a Kubernetes cluster. | +| [x_k8s_list](./examples/x_k8s_list.md) | Lists resources from a Kubernetes cluster. | +| [x_k8s_exists](./examples/x_k8s_exists.md) | Checks if a given resource exists in a Kubernetes cluster. | +| [x_k8s_resource_exists](./examples/x_k8s_resource_exists.md) | Checks if a given resource type is available in a Kubernetes cluster. | +| [x_k8s_server_version](./examples/x_k8s_server_version.md) | Returns the version of a Kubernetes cluster. | +| [x_metrics_decode](./examples/x_metrics_decode.md) | Decodes metrics in the Prometheus text format. | +| [trim_space](./examples/trim_space.md) | Trims leading and trailing spaces from the string passed in argument. | +| [as_string](./examples/as_string.md) | Returns the passed in argument converted into a string. | diff --git a/website/jp/main.go b/website/jp/main.go index cdf24da60..6e86224e6 100644 --- a/website/jp/main.go +++ b/website/jp/main.go @@ -43,12 +43,19 @@ func main() { } func printFunctions(funcs ...jpfunctions.FunctionEntry) { - fmt.Println("| Name | Signature | Description |") - fmt.Println("|---|---|---|") + fmt.Println("| Name | Description |") + fmt.Println("|---|---|") for _, function := range funcs { sig := functionString(function) - fmt.Println("|", fmt.Sprintf("[%s](./examples/%s.md)", function.Name, function.Name), "|", "`"+sig+"`", "|", function.Description, "|") - data := fmt.Sprintf("# %s\n\n## Signature\n\n`%s`\n\n## Description\n\n%s\n\n## Examples\n\n", function.Name, sig, function.Description) + desc := function.Description + desc = strings.TrimSpace(desc) + if desc != "" { + desc = strings.ToUpper(desc[:1]) + desc[1:] + desc = strings.TrimSuffix(desc, ".") + desc = desc + "." + } + fmt.Println("|", fmt.Sprintf("[%s](./examples/%s.md)", function.Name, function.Name), "|", desc, "|") + data := fmt.Sprintf("# %s\n\n## Signature\n\n`%s`\n\n## Description\n\n%s\n\n## Examples\n\n", function.Name, sig, desc) if e, err := examples.ReadFile(fmt.Sprintf("examples/%s.md", function.Name)); err != nil { panic(err) } else {