diff --git a/README.md b/README.md index 6cc2d34..1926ba0 100644 --- a/README.md +++ b/README.md @@ -118,39 +118,10 @@ Currently supported modifiers: - `[array]` Indicates that the value of the parameter must be set to `[]`. - `[object]` Indicates that the value of the parameter must be set to `{}`. - `[string]` Indicates that the value of the parameter must be set to `""`. +- `[boolean]` Indicates that the value of the parameter must be set to `false`. - `[nullable]` Indicates that the parameter value can be set to `null`. - `[default: DEFAULT_VALUE]` Sets the default value to `DEFAULT_VALUE`. -The modifiers are also customizable via the [configuration file](#configuration-file). - -In case you are adding a `custom modifier` to a parameter that does not have value in the values file -you must add one of the `supported modifiers` as last modifier. - -Example: - -Values file - -```yaml -# @param noDefaultValue [number, nullable] Description -# noDefaultValue: 1 -``` - -Custom configuration snippet: - -```json -{ - ... - "modifiers": { - "array": "array", - "object": "object" - "string": "string" - "nullable": "nullable", - "number": "number" - }, - ... -} -``` - ## Configuration file The configuration file has the following structure: @@ -172,6 +143,7 @@ The configuration file has the following structure: "array": "array", <-- Modifier that indicates an array type "object": "object" <-- Modifier that indicates an object type "string": "string" <-- Modifier that indicates a string type + "boolean": "boolean" <-- Modifier that indicates a boolean type "nullable": "nullable" <-- Modifier that indicates a parameter that can be set to null }, "regexp": { diff --git a/config.json b/config.json index b2f956f..4e07cc8 100644 --- a/config.json +++ b/config.json @@ -14,6 +14,7 @@ "array": "array", "object": "object", "string": "string", + "boolean": "boolean", "nullable": "nullable", "default": "default" }, diff --git a/lib/builder.js b/lib/builder.js index 115d644..94c8643 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -39,6 +39,11 @@ function applyModifiers(param, config) { param.value = '""'; } break; + case `${config.modifiers.boolean}`: + param.type = modifier; + // Default value is false + param.value = false; + break; case `${config.modifiers.nullable}`: if (param.value === undefined) { param.value = 'nil'; diff --git a/tests/expected-readme.config.md b/tests/expected-readme.config.md index 011339e..5911813 100644 --- a/tests/expected-readme.config.md +++ b/tests/expected-readme.config.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/expected-readme.first-execution.md b/tests/expected-readme.first-execution.md index fe77a60..020dfcd 100644 --- a/tests/expected-readme.first-execution.md +++ b/tests/expected-readme.first-execution.md @@ -161,3 +161,4 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | diff --git a/tests/expected-readme.last-section-text-below.md b/tests/expected-readme.last-section-text-below.md index 107bfe1..e7e7bb4 100644 --- a/tests/expected-readme.last-section-text-below.md +++ b/tests/expected-readme.last-section-text-below.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/expected-readme.last-section.md b/tests/expected-readme.last-section.md index d766cb4..3bec963 100644 --- a/tests/expected-readme.last-section.md +++ b/tests/expected-readme.last-section.md @@ -199,3 +199,4 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | diff --git a/tests/expected-readme.md b/tests/expected-readme.md index d43d668..c53ea20 100644 --- a/tests/expected-readme.md +++ b/tests/expected-readme.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/expected-schema.json b/tests/expected-schema.json index 0e4f1f9..5fe703b 100644 --- a/tests/expected-schema.json +++ b/tests/expected-schema.json @@ -731,6 +731,11 @@ "default": "8.10.3" } } + }, + "booleanValue": { + "type": "boolean", + "description": "A boolean value", + "default": false } } } \ No newline at end of file diff --git a/tests/test-config.json b/tests/test-config.json index 808c690..5694f0e 100644 --- a/tests/test-config.json +++ b/tests/test-config.json @@ -14,6 +14,7 @@ "array": "array", "object": "object", "string": "string", + "boolean": "boolean", "nullable": "nullable", "default": "default" }, diff --git a/tests/test-readme.config.md b/tests/test-readme.config.md index 011339e..5911813 100644 --- a/tests/test-readme.config.md +++ b/tests/test-readme.config.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/test-readme.last-section-text-below.md b/tests/test-readme.last-section-text-below.md index 107bfe1..e7e7bb4 100644 --- a/tests/test-readme.last-section-text-below.md +++ b/tests/test-readme.last-section-text-below.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/test-readme.last-section.md b/tests/test-readme.last-section.md index d766cb4..3bec963 100644 --- a/tests/test-readme.last-section.md +++ b/tests/test-readme.last-section.md @@ -199,3 +199,4 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | diff --git a/tests/test-readme.md b/tests/test-readme.md index d43d668..c53ea20 100644 --- a/tests/test-readme.md +++ b/tests/test-readme.md @@ -199,6 +199,7 @@ This description starts in a new line instead of the same line of description st | `vault.annotations.vault.hashicorp.com/agent-inject` | Some desc | `true` | | `stack.mode` | way to deploy | `nil` | | `stack.version` | version of the stack | `8.10.3` | +| `booleanValue` | A boolean value | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/tests/test-schema.json b/tests/test-schema.json index 0e4f1f9..5fe703b 100644 --- a/tests/test-schema.json +++ b/tests/test-schema.json @@ -731,6 +731,11 @@ "default": "8.10.3" } } + }, + "booleanValue": { + "type": "boolean", + "description": "A boolean value", + "default": false } } } \ No newline at end of file diff --git a/tests/test-values.yaml b/tests/test-values.yaml index 5e48989..5c40913 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -562,4 +562,7 @@ vault: ## @param stack.mode [string, nullable] way to deploy ## @param stack.version version of the stack stack: - version: 8.10.3 \ No newline at end of file + version: 8.10.3 +## Issue: ## Issue: https://github.com/bitnami/readme-generator-for-helm/issues/173 +## @param booleanValue [boolean] A boolean value +booleanValue: false \ No newline at end of file