Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"array": "array",
"object": "object",
"string": "string",
"boolean": "boolean",
"nullable": "nullable",
"default": "default"
},
Expand Down
5 changes: 5 additions & 0 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions tests/expected-readme.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 1 addition & 0 deletions tests/expected-readme.first-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
1 change: 1 addition & 0 deletions tests/expected-readme.last-section-text-below.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 1 addition & 0 deletions tests/expected-readme.last-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
1 change: 1 addition & 0 deletions tests/expected-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
5 changes: 5 additions & 0 deletions tests/expected-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,11 @@
"default": "8.10.3"
}
}
},
"booleanValue": {
"type": "boolean",
"description": "A boolean value",
"default": false
}
}
}
1 change: 1 addition & 0 deletions tests/test-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"array": "array",
"object": "object",
"string": "string",
"boolean": "boolean",
"nullable": "nullable",
"default": "default"
},
Expand Down
1 change: 1 addition & 0 deletions tests/test-readme.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 1 addition & 0 deletions tests/test-readme.last-section-text-below.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 1 addition & 0 deletions tests/test-readme.last-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
1 change: 1 addition & 0 deletions tests/test-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
5 changes: 5 additions & 0 deletions tests/test-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,11 @@
"default": "8.10.3"
}
}
},
"booleanValue": {
"type": "boolean",
"description": "A boolean value",
"default": false
}
}
}
5 changes: 4 additions & 1 deletion tests/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
version: 8.10.3
## Issue: ## Issue: https://github.com/bitnami/readme-generator-for-helm/issues/173
## @param booleanValue [boolean] A boolean value
booleanValue: false