From 9dc5601787c8c69e5586eb6f1bb0a7affdff1e0b Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Wed, 18 Oct 2023 12:29:04 +0200 Subject: [PATCH 1/7] Allow setting a default value for a parameter Signed-off-by: Jota Martos --- README.md | 1 + lib/builder.js | 4 +- lib/parser.js | 3 +- package-lock.json | 2 +- package.json | 2 +- tests/expected-readme.first-execution.md | 86 +++++++++---------- ...expected-readme.last-section-text-below.md | 86 +++++++++---------- tests/expected-readme.last-section.md | 86 +++++++++---------- tests/expected-readme.md | 86 +++++++++---------- tests/expected-schema.json | 2 +- tests/test-readme.last-section-text-below.md | 86 +++++++++---------- tests/test-readme.last-section.md | 86 +++++++++---------- tests/test-readme.md | 86 +++++++++---------- tests/test-schema.json | 2 +- tests/test-values.yaml | 2 +- 15 files changed, 311 insertions(+), 309 deletions(-) diff --git a/README.md b/README.md index 375d72d..125e553 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ By default we use a format similar to Javadoc, using `@xxx` for tags followed by The following are the tags supported at this very moment: - For a parameter: `## @param fullKeyPath [modifier?] Description`. + - Optional: Parameter with default value: `## @param fullKeyPath [modifier?] Description Default: DEFAULT_VALUE` - For a section: `## @section Section Title"`. - To skip an object and all its children: `## @skip fullKeyPath Description?`. - To add a description for an intermediate object (i.e. not final in the YAML tree): `## @extra fullkeyPath Description`. diff --git a/lib/builder.js b/lib/builder.js index d8e3d83..028af95 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -58,8 +58,8 @@ function combineMetadataAndValues(valuesObject, valuesMetadata) { if (!param.extra) { const paramIndex = valuesObject.findIndex((e) => e.name === param.name); if (paramIndex !== -1) { - // Set the value from actual object - param.value = valuesObject[paramIndex].value; + // Set the value from actual object if not set before + if (!param.value) param.value = valuesObject[paramIndex].value; param.type = valuesObject[paramIndex].type; // TODO(miguelaeh): Hack to avoid render parameters with dots in keys into the schema. // Must be removed once fixed diff --git a/lib/parser.js b/lib/parser.js index 10d0337..41a00ed 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -27,7 +27,7 @@ function parseMetadataComments(valuesFilePath, config) { const lines = data.split(/\r?\n/); const parsedValues = new Metadata(); - const paramRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.param}\\s*([^\\s]+)\\s*(\\[.*?\\])?\\s*(.*)$`); + const paramRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.param}\\s*([^\\s]+)\\s*(\\[.*?\\])?\\s*(.*?)(\\s*Default:\\s*(.*))?$`); const sectionRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.section}\\s*(.*)$`); const descriptionStartRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.descriptionStart}\\s*(.*)`); const descriptionContentRegex = new RegExp(`^\\s*${config.comments.format}\\s*(.*)`); @@ -46,6 +46,7 @@ function parseMetadataComments(valuesFilePath, config) { const modifiers = paramMatch[2] ? paramMatch[2].split('[')[1].split(']')[0] : ''; param.modifiers = modifiers.split(',').filter((m) => m).map((m) => m.trim()); param.description = paramMatch[3]; + if (paramMatch[4]) param.value = paramMatch[5]; if (currentSection) { param.section = currentSection.name; currentSection.addParameter(param); diff --git a/package-lock.json b/package-lock.json index 2f0ac5d..3b14fd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@bitnami/readme-generator-for-helm", - "version": "2.5.2", + "version": "2.5.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index af1ecb1..5754a63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitnami/readme-generator-for-helm", - "version": "2.5.2", + "version": "2.5.3", "description": "Autogenerate READMEs tables and OpenAPI schemas for Helm Charts", "main": "index.js", "scripts": { diff --git a/tests/expected-readme.first-execution.md b/tests/expected-readme.first-execution.md index 98d4361..2e6fe53 100644 --- a/tests/expected-readme.first-execution.md +++ b/tests/expected-readme.first-execution.md @@ -29,49 +29,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/expected-readme.last-section-text-below.md b/tests/expected-readme.last-section-text-below.md index ed17db4..6662cfb 100644 --- a/tests/expected-readme.last-section-text-below.md +++ b/tests/expected-readme.last-section-text-below.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/expected-readme.last-section.md b/tests/expected-readme.last-section.md index 5a61664..0d7cba9 100644 --- a/tests/expected-readme.last-section.md +++ b/tests/expected-readme.last-section.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/expected-readme.md b/tests/expected-readme.md index 7f8715b..25191b1 100644 --- a/tests/expected-readme.md +++ b/tests/expected-readme.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/expected-schema.json b/tests/expected-schema.json index 93196c4..1b586db 100644 --- a/tests/expected-schema.json +++ b/tests/expected-schema.json @@ -61,7 +61,7 @@ "repository": { "type": "string", "description": "Kubewatch image name", - "default": "bitnami/kubewatch" + "default": "REPOSITORY_NAME/kubewatch" }, "tag": { "type": "string", diff --git a/tests/test-readme.last-section-text-below.md b/tests/test-readme.last-section-text-below.md index ed17db4..6662cfb 100644 --- a/tests/test-readme.last-section-text-below.md +++ b/tests/test-readme.last-section-text-below.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/test-readme.last-section.md b/tests/test-readme.last-section.md index 5a61664..0d7cba9 100644 --- a/tests/test-readme.last-section.md +++ b/tests/test-readme.last-section.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/test-readme.md b/tests/test-readme.md index 7f8715b..25191b1 100644 --- a/tests/test-readme.md +++ b/tests/test-readme.md @@ -67,49 +67,49 @@ It even supports multiple lines and [Link parsing](#common-parameters). This description starts in a new line instead of the same line of description start tag. It does not have multiple lines. -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------- | ---------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | -| `image.repository` | Kubewatch image name | `bitnami/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `slack.enabled` | Enable Slack notifications | `true` | -| `slack.channel` | Slack channel to notify | `XXXX` | -| `slack.token` | Slack API token | `XXXX` | -| `hipchat.enabled` | Enable HipChat notifications | `false` | -| `hipchat.room` | HipChat room to notify | `""` | -| `hipchat.token` | HipChat token | `""` | -| `hipchat.url` | HipChat URL | `""` | -| `mattermost.enabled` | Enable Mattermost notifications | `false` | -| `mattermost.channel` | Mattermost channel to notify | `""` | -| `mattermost.username` | Mattermost user to notify | `""` | -| `mattermost.url` | Mattermost URL | `""` | -| `flock.enabled` | Enable Flock notifications | `false` | -| `flock.url` | Flock URL | `""` | -| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | -| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | -| `webhook` | Enable Webhook notifications | `{}` | -| `smtp.enabled` | Enable SMTP (email) notifications | `false` | -| `smtp.to` | Destination email address (required) | `""` | -| `smtp.from` | Source email address (required) | `""` | -| `smtp.hello` | SMTP hello field (optional) | `""` | -| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | -| `smtp.subject` | SMTP subject for the email | `""` | -| `smtp.requireTLS` | Force STARTTLS | `false` | -| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | -| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | -| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | -| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | -| `resourcesToWatch.pod` | Watch changes to Pods | `true` | -| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | -| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | -| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | -| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | -| `resourcesToWatch.services` | Watch changes to Services | `false` | -| `resourcesToWatch.job` | Watch changes to Jobs | `false` | -| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | +| Name | Description | Value | +| ---------------------------------------- | --------------------------------------------------- | --------------------------- | +| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | +| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `slack.enabled` | Enable Slack notifications | `true` | +| `slack.channel` | Slack channel to notify | `XXXX` | +| `slack.token` | Slack API token | `XXXX` | +| `hipchat.enabled` | Enable HipChat notifications | `false` | +| `hipchat.room` | HipChat room to notify | `""` | +| `hipchat.token` | HipChat token | `""` | +| `hipchat.url` | HipChat URL | `""` | +| `mattermost.enabled` | Enable Mattermost notifications | `false` | +| `mattermost.channel` | Mattermost channel to notify | `""` | +| `mattermost.username` | Mattermost user to notify | `""` | +| `mattermost.url` | Mattermost URL | `""` | +| `flock.enabled` | Enable Flock notifications | `false` | +| `flock.url` | Flock URL | `""` | +| `msteams.enabled` | Enable Microsoft Teams notifications | `false` | +| `msteams.webhookurl` | Microsoft Teams webhook URL | `""` | +| `webhook` | Enable Webhook notifications | `{}` | +| `smtp.enabled` | Enable SMTP (email) notifications | `false` | +| `smtp.to` | Destination email address (required) | `""` | +| `smtp.from` | Source email address (required) | `""` | +| `smtp.hello` | SMTP hello field (optional) | `""` | +| `smtp.smarthost` | SMTP server address (name:port) (required) | `""` | +| `smtp.subject` | SMTP subject for the email | `""` | +| `smtp.requireTLS` | Force STARTTLS | `false` | +| `smtp.auth.username` | Username for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.password` | Password for LOGIN and PLAIN auth mech | `""` | +| `smtp.auth.secret` | Secret for CRAM-MD5 auth mech | `""` | +| `smtp.auth.identity` | Identity for PLAIN auth mech | `""` | +| `namespaceToWatch` | Namespace to watch, leave it empty for watching all | `""` | +| `resourcesToWatch.pod` | Watch changes to Pods | `true` | +| `resourcesToWatch.deployment` | Watch changes to Deployments | `true` | +| `resourcesToWatch.replicationcontroller` | Watch changes to ReplicationControllers | `false` | +| `resourcesToWatch.replicaset` | Watch changes to ReplicaSets | `false` | +| `resourcesToWatch.daemonset` | Watch changes to DaemonSets | `false` | +| `resourcesToWatch.services` | Watch changes to Services | `false` | +| `resourcesToWatch.job` | Watch changes to Jobs | `false` | +| `resourcesToWatch.persistentvolume` | Watch changes to PersistentVolumes | `false` | ### Deployment parameters diff --git a/tests/test-schema.json b/tests/test-schema.json index 93196c4..1b586db 100644 --- a/tests/test-schema.json +++ b/tests/test-schema.json @@ -61,7 +61,7 @@ "repository": { "type": "string", "description": "Kubewatch image name", - "default": "bitnami/kubewatch" + "default": "REPOSITORY_NAME/kubewatch" }, "tag": { "type": "string", diff --git a/tests/test-values.yaml b/tests/test-values.yaml index f4637bf..c92f0b6 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -60,7 +60,7 @@ hostAliases: [] ## ref: https://hub.docker.com/r/bitnami/kubewatch/tags/ ## ## @param image.registry Kubewatch image registry -## @param image.repository Kubewatch image name +## @param image.repository Kubewatch image name Default: REPOSITORY_NAME/kubewatch ## @param image.tag Kubewatch image tag ## @param image.pullPolicy Kubewatch image tag ## @param image.pullSecrets Specify docker-registry secret names as an array From 2ad767a6e8d8384d26a4d864dff9312bc6ba5144 Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Wed, 18 Oct 2023 12:37:10 +0200 Subject: [PATCH 2/7] Test change in the image.registry parameter Signed-off-by: Jota Martos --- tests/expected-readme.first-execution.md | 3 +-- tests/expected-readme.last-section-text-below.md | 3 +-- tests/expected-readme.last-section.md | 3 +-- tests/expected-readme.md | 3 +-- tests/expected-schema.json | 4 ++-- tests/test-readme.last-section-text-below.md | 3 +-- tests/test-readme.last-section.md | 3 +-- tests/test-readme.md | 3 +-- tests/test-schema.json | 4 ++-- tests/test-values.yaml | 4 ++-- 10 files changed, 13 insertions(+), 20 deletions(-) diff --git a/tests/expected-readme.first-execution.md b/tests/expected-readme.first-execution.md index 2e6fe53..024f96b 100644 --- a/tests/expected-readme.first-execution.md +++ b/tests/expected-readme.first-execution.md @@ -31,9 +31,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/expected-readme.last-section-text-below.md b/tests/expected-readme.last-section-text-below.md index 6662cfb..92d3be0 100644 --- a/tests/expected-readme.last-section-text-below.md +++ b/tests/expected-readme.last-section-text-below.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/expected-readme.last-section.md b/tests/expected-readme.last-section.md index 0d7cba9..e68352c 100644 --- a/tests/expected-readme.last-section.md +++ b/tests/expected-readme.last-section.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/expected-readme.md b/tests/expected-readme.md index 25191b1..82eb8db 100644 --- a/tests/expected-readme.md +++ b/tests/expected-readme.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/expected-schema.json b/tests/expected-schema.json index 1b586db..a66a707 100644 --- a/tests/expected-schema.json +++ b/tests/expected-schema.json @@ -56,7 +56,7 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "docker.io" + "default": "REGISTRY_NAME" }, "repository": { "type": "string", @@ -65,7 +65,7 @@ }, "tag": { "type": "string", - "description": "Kubewatch image tag", + "description": "", "default": "0.1.0-debian-10-r162" }, "pullPolicy": { diff --git a/tests/test-readme.last-section-text-below.md b/tests/test-readme.last-section-text-below.md index 6662cfb..92d3be0 100644 --- a/tests/test-readme.last-section-text-below.md +++ b/tests/test-readme.last-section-text-below.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/test-readme.last-section.md b/tests/test-readme.last-section.md index 0d7cba9..e68352c 100644 --- a/tests/test-readme.last-section.md +++ b/tests/test-readme.last-section.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/test-readme.md b/tests/test-readme.md index 25191b1..82eb8db 100644 --- a/tests/test-readme.md +++ b/tests/test-readme.md @@ -69,9 +69,8 @@ This description starts in a new line instead of the same line of description st | Name | Description | Value | | ---------------------------------------- | --------------------------------------------------- | --------------------------- | -| `image.registry` | Kubewatch image registry | `docker.io` | +| `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.tag` | Kubewatch image tag | `0.1.0-debian-10-r162` | | `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | diff --git a/tests/test-schema.json b/tests/test-schema.json index 1b586db..a66a707 100644 --- a/tests/test-schema.json +++ b/tests/test-schema.json @@ -56,7 +56,7 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "docker.io" + "default": "REGISTRY_NAME" }, "repository": { "type": "string", @@ -65,7 +65,7 @@ }, "tag": { "type": "string", - "description": "Kubewatch image tag", + "description": "", "default": "0.1.0-debian-10-r162" }, "pullPolicy": { diff --git a/tests/test-values.yaml b/tests/test-values.yaml index c92f0b6..e5f5bd5 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -59,9 +59,9 @@ hostAliases: [] ## Bitnami Kubewatch image version ## ref: https://hub.docker.com/r/bitnami/kubewatch/tags/ ## -## @param image.registry Kubewatch image registry +## @param image.registry Kubewatch image registry Default: REGISTRY_NAME ## @param image.repository Kubewatch image name Default: REPOSITORY_NAME/kubewatch -## @param image.tag Kubewatch image tag +## @skip image.tag Kubewatch image tag ## @param image.pullPolicy Kubewatch image tag ## @param image.pullSecrets Specify docker-registry secret names as an array image: From 7602b30e3c78d698d500d11f5aca2445e9475374 Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Wed, 18 Oct 2023 13:27:44 +0200 Subject: [PATCH 3/7] Add default modifier Signed-off-by: Jota Martos --- README.md | 2 +- config.json | 3 ++- lib/builder.js | 4 ++++ lib/parser.js | 3 +-- tests/expected-schema.json | 4 ++-- tests/test-schema.json | 4 ++-- tests/test-values.yaml | 4 ++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 125e553..d3f04c3 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,6 @@ By default we use a format similar to Javadoc, using `@xxx` for tags followed by The following are the tags supported at this very moment: - For a parameter: `## @param fullKeyPath [modifier?] Description`. - - Optional: Parameter with default value: `## @param fullKeyPath [modifier?] Description Default: DEFAULT_VALUE` - For a section: `## @section Section Title"`. - To skip an object and all its children: `## @skip fullKeyPath Description?`. - To add a description for an intermediate object (i.e. not final in the YAML tree): `## @extra fullkeyPath Description`. @@ -118,6 +117,7 @@ Currently supported modifiers: - `[object]` Indicates that the value of the parameter must be set to `{}`. - `[string]` Indicates that the value of the parameter must be set to `""`. - `[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). diff --git a/config.json b/config.json index 7781709..b2f956f 100644 --- a/config.json +++ b/config.json @@ -14,7 +14,8 @@ "array": "array", "object": "object", "string": "string", - "nullable": "nullable" + "nullable": "nullable", + "default": "default" }, "regexp": { "paramsSectionTitle": "Parameters" diff --git a/lib/builder.js b/lib/builder.js index 028af95..416e978 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -35,6 +35,10 @@ function applyModifiers(param, config) { // unless another modifier is applied at the same time. In that case, the second // modifier specifies the default value. break; + case modifier.match(new RegExp(config.modifiers.default))?.input: + const defaultSpacesRegex = `${config.modifiers.default}:\\s*`; + param.value = modifier.replace(new RegExp(defaultSpacesRegex),''); + break; default: throw new Error(`Unknown modifier: ${modifier} for parameter ${param.name}`); } diff --git a/lib/parser.js b/lib/parser.js index 41a00ed..10d0337 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -27,7 +27,7 @@ function parseMetadataComments(valuesFilePath, config) { const lines = data.split(/\r?\n/); const parsedValues = new Metadata(); - const paramRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.param}\\s*([^\\s]+)\\s*(\\[.*?\\])?\\s*(.*?)(\\s*Default:\\s*(.*))?$`); + const paramRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.param}\\s*([^\\s]+)\\s*(\\[.*?\\])?\\s*(.*)$`); const sectionRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.section}\\s*(.*)$`); const descriptionStartRegex = new RegExp(`^\\s*${config.comments.format}\\s*${config.tags.descriptionStart}\\s*(.*)`); const descriptionContentRegex = new RegExp(`^\\s*${config.comments.format}\\s*(.*)`); @@ -46,7 +46,6 @@ function parseMetadataComments(valuesFilePath, config) { const modifiers = paramMatch[2] ? paramMatch[2].split('[')[1].split(']')[0] : ''; param.modifiers = modifiers.split(',').filter((m) => m).map((m) => m.trim()); param.description = paramMatch[3]; - if (paramMatch[4]) param.value = paramMatch[5]; if (currentSection) { param.section = currentSection.name; currentSection.addParameter(param); diff --git a/tests/expected-schema.json b/tests/expected-schema.json index a66a707..2731296 100644 --- a/tests/expected-schema.json +++ b/tests/expected-schema.json @@ -56,12 +56,12 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "REGISTRY_NAME" + "default": "docker.io" }, "repository": { "type": "string", "description": "Kubewatch image name", - "default": "REPOSITORY_NAME/kubewatch" + "default": "bitnami/kubewatch" }, "tag": { "type": "string", diff --git a/tests/test-schema.json b/tests/test-schema.json index a66a707..2731296 100644 --- a/tests/test-schema.json +++ b/tests/test-schema.json @@ -56,12 +56,12 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "REGISTRY_NAME" + "default": "docker.io" }, "repository": { "type": "string", "description": "Kubewatch image name", - "default": "REPOSITORY_NAME/kubewatch" + "default": "bitnami/kubewatch" }, "tag": { "type": "string", diff --git a/tests/test-values.yaml b/tests/test-values.yaml index e5f5bd5..bcad0d8 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -59,8 +59,8 @@ hostAliases: [] ## Bitnami Kubewatch image version ## ref: https://hub.docker.com/r/bitnami/kubewatch/tags/ ## -## @param image.registry Kubewatch image registry Default: REGISTRY_NAME -## @param image.repository Kubewatch image name Default: REPOSITORY_NAME/kubewatch +## @param image.registry [default: REGISTRY_NAME] Kubewatch image registry +## @param image.repository [default: REPOSITORY_NAME/kubewatch] Kubewatch image name ## @skip image.tag Kubewatch image tag ## @param image.pullPolicy Kubewatch image tag ## @param image.pullSecrets Specify docker-registry secret names as an array From d0ff1c01cd6af5c4af538e1a64c20dfd7b3f6ae4 Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Wed, 18 Oct 2023 14:45:14 +0200 Subject: [PATCH 4/7] Fix linter Signed-off-by: Jota Martos --- lib/builder.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/builder.js b/lib/builder.js index 416e978..332eafa 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -35,10 +35,11 @@ function applyModifiers(param, config) { // unless another modifier is applied at the same time. In that case, the second // modifier specifies the default value. break; - case modifier.match(new RegExp(config.modifiers.default))?.input: + case modifier.match(new RegExp(config.modifiers.default))?.input: { const defaultSpacesRegex = `${config.modifiers.default}:\\s*`; - param.value = modifier.replace(new RegExp(defaultSpacesRegex),''); + param.value = modifier.replace(new RegExp(defaultSpacesRegex), ''); break; + } default: throw new Error(`Unknown modifier: ${modifier} for parameter ${param.name}`); } From 7125baf2da7c27efe38873f3196f3c58deea7a05 Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Wed, 18 Oct 2023 15:03:45 +0200 Subject: [PATCH 5/7] Improve regex and documentation Signed-off-by: Jota Martos --- README.md | 2 +- lib/builder.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d3f04c3..706a68c 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Currently supported modifiers: - `[object]` Indicates that the value of the parameter must be set to `{}`. - `[string]` Indicates that the value of the parameter must be set to `""`. - `[nullable]` Indicates that the parameter value can be set to `null`. -- `[default: DEFAULT_VALUE]` Sets the default value to `DEFAULT_VALUE`. +- `[default: DEFAULT_VALUE]` Sets the default value to `DEFAULT_VALUE`. The modifiers are also customizable via the [configuration file](#configuration-file). diff --git a/lib/builder.js b/lib/builder.js index 332eafa..3757d83 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -35,7 +35,7 @@ function applyModifiers(param, config) { // unless another modifier is applied at the same time. In that case, the second // modifier specifies the default value. break; - case modifier.match(new RegExp(config.modifiers.default))?.input: { + case modifier.match(new RegExp(`${config.modifiers.default}:.*`))?.input: { const defaultSpacesRegex = `${config.modifiers.default}:\\s*`; param.value = modifier.replace(new RegExp(defaultSpacesRegex), ''); break; From 8cc04040b428fef05762b3c2b25870568ea16ff6 Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Thu, 19 Oct 2023 12:29:09 +0200 Subject: [PATCH 6/7] Update schema information with modifiers and skip params Signed-off-by: Jota Martos --- index.js | 1 + lib/parser.js | 2 +- tests/expected-readme.first-execution.md | 2 +- ...expected-readme.last-section-text-below.md | 2 +- tests/expected-readme.last-section.md | 2 +- tests/expected-readme.md | 2 +- tests/expected-schema.json | 95 +++---------------- tests/test-readme.last-section-text-below.md | 2 +- tests/test-readme.last-section.md | 2 +- tests/test-readme.md | 2 +- tests/test-schema.json | 95 +++---------------- tests/test-values.yaml | 2 +- 12 files changed, 40 insertions(+), 169 deletions(-) diff --git a/index.js b/index.js index 97c6a7a..dedf98a 100644 --- a/index.js +++ b/index.js @@ -60,6 +60,7 @@ function runReadmeGenerator(options) { } if (schemaFilePath) { + parsedMetadata.parameters = buildParamsToRenderList(parsedMetadata.parameters, config); renderOpenAPISchema(schemaFilePath, parsedMetadata.parameters, config); } } diff --git a/lib/parser.js b/lib/parser.js index 10d0337..a6ddb5d 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -170,7 +170,7 @@ function createValuesObject(valuesFilePath) { // The existence check is needed to avoid duplicate plain array keys if (!resultValues.find((v) => v.name === valuePath)) { const param = new Parameter(valuePath); - param.value = value; + if (!param.value) param.value = value; param.type = type; resultValues.push(param); param.schema = renderInSchema; diff --git a/tests/expected-readme.first-execution.md b/tests/expected-readme.first-execution.md index 024f96b..6aa8059 100644 --- a/tests/expected-readme.first-execution.md +++ b/tests/expected-readme.first-execution.md @@ -33,7 +33,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/expected-readme.last-section-text-below.md b/tests/expected-readme.last-section-text-below.md index 92d3be0..15adea4 100644 --- a/tests/expected-readme.last-section-text-below.md +++ b/tests/expected-readme.last-section-text-below.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/expected-readme.last-section.md b/tests/expected-readme.last-section.md index e68352c..846918a 100644 --- a/tests/expected-readme.last-section.md +++ b/tests/expected-readme.last-section.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/expected-readme.md b/tests/expected-readme.md index 82eb8db..e5a2630 100644 --- a/tests/expected-readme.md +++ b/tests/expected-readme.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/expected-schema.json b/tests/expected-schema.json index 2731296..443534a 100644 --- a/tests/expected-schema.json +++ b/tests/expected-schema.json @@ -56,21 +56,16 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "docker.io" + "default": "REGISTRY_NAME" }, "repository": { "type": "string", "description": "Kubewatch image name", - "default": "bitnami/kubewatch" - }, - "tag": { - "type": "string", - "description": "", - "default": "0.1.0-debian-10-r162" + "default": "REPOSITORY_NAME/kubewatch" }, "pullPolicy": { "type": "string", - "description": "Kubewatch image tag", + "description": "Kubewatch image pull policy", "default": "IfNotPresent" }, "pullSecrets": { @@ -181,21 +176,6 @@ } } }, - "webhook": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "", - "default": false - }, - "url": { - "type": "string", - "description": "", - "default": "" - } - } - }, "smtp": { "type": "object", "properties": { @@ -390,21 +370,6 @@ } } }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "description": "", - "default": {} - }, - "requests": { - "type": "object", - "description": "", - "default": {} - } - } - }, "livenessProbe": { "type": "object", "properties": { @@ -603,10 +568,7 @@ "arrayModifier": { "type": "array", "description": "Test parameter for modifier array", - "default": [ - "a", - "b" - ], + "default": "[]", "items": { "type": "string" } @@ -614,7 +576,7 @@ "configuration": { "type": "string", "description": "haproxy configuration", - "default": "global\n log stdout format raw local0\n maxconn 1024\ndefaults\n" + "default": "\"\"" }, "jobs": { "type": "array", @@ -684,41 +646,6 @@ } } }, - "forceSchemaArrayModifier": { - "type": "array", - "description": "", - "items": { - "type": "object", - "properties": { - "w": { - "type": "string", - "description": "" - }, - "y": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - } - } - } - }, - "linkInDescription": { - "type": "object", - "properties": { - "propertyOne": { - "type": "string", - "description": "", - "default": "valueOne" - }, - "propertyTwo": { - "type": "string", - "description": "", - "default": "valueTwo" - } - } - }, "extraTest": { "type": "object", "properties": { @@ -729,6 +656,14 @@ } } }, + "forceSchemaArrayModifier": { + "type": "array", + "description": "The parameter should appear completely into the schema but with the modifier value into the README", + "default": "[]", + "items": { + "type": "string" + } + }, "nullable": { "type": "object", "description": "Nullable parameter", @@ -738,7 +673,7 @@ "nullableNullStringWithValueChange": { "type": "string", "description": "Nullable null string. We apply string modifier that will change the type and value, but the schema will show `nullable: true`.", - "default": null, + "default": "\"\"", "nullable": true }, "nullableNullArray": { @@ -776,7 +711,7 @@ "arrayEmptyModifier": { "type": "array", "description": "Test empty array modifier", - "default": "value", + "default": "[]", "items": { "type": "string" } diff --git a/tests/test-readme.last-section-text-below.md b/tests/test-readme.last-section-text-below.md index 92d3be0..15adea4 100644 --- a/tests/test-readme.last-section-text-below.md +++ b/tests/test-readme.last-section-text-below.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/test-readme.last-section.md b/tests/test-readme.last-section.md index e68352c..846918a 100644 --- a/tests/test-readme.last-section.md +++ b/tests/test-readme.last-section.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/test-readme.md b/tests/test-readme.md index 82eb8db..e5a2630 100644 --- a/tests/test-readme.md +++ b/tests/test-readme.md @@ -71,7 +71,7 @@ This description starts in a new line instead of the same line of description st | ---------------------------------------- | --------------------------------------------------- | --------------------------- | | `image.registry` | Kubewatch image registry | `REGISTRY_NAME` | | `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | -| `image.pullPolicy` | Kubewatch image tag | `IfNotPresent` | +| `image.pullPolicy` | Kubewatch image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `slack.enabled` | Enable Slack notifications | `true` | | `slack.channel` | Slack channel to notify | `XXXX` | diff --git a/tests/test-schema.json b/tests/test-schema.json index 2731296..443534a 100644 --- a/tests/test-schema.json +++ b/tests/test-schema.json @@ -56,21 +56,16 @@ "registry": { "type": "string", "description": "Kubewatch image registry", - "default": "docker.io" + "default": "REGISTRY_NAME" }, "repository": { "type": "string", "description": "Kubewatch image name", - "default": "bitnami/kubewatch" - }, - "tag": { - "type": "string", - "description": "", - "default": "0.1.0-debian-10-r162" + "default": "REPOSITORY_NAME/kubewatch" }, "pullPolicy": { "type": "string", - "description": "Kubewatch image tag", + "description": "Kubewatch image pull policy", "default": "IfNotPresent" }, "pullSecrets": { @@ -181,21 +176,6 @@ } } }, - "webhook": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "", - "default": false - }, - "url": { - "type": "string", - "description": "", - "default": "" - } - } - }, "smtp": { "type": "object", "properties": { @@ -390,21 +370,6 @@ } } }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "description": "", - "default": {} - }, - "requests": { - "type": "object", - "description": "", - "default": {} - } - } - }, "livenessProbe": { "type": "object", "properties": { @@ -603,10 +568,7 @@ "arrayModifier": { "type": "array", "description": "Test parameter for modifier array", - "default": [ - "a", - "b" - ], + "default": "[]", "items": { "type": "string" } @@ -614,7 +576,7 @@ "configuration": { "type": "string", "description": "haproxy configuration", - "default": "global\n log stdout format raw local0\n maxconn 1024\ndefaults\n" + "default": "\"\"" }, "jobs": { "type": "array", @@ -684,41 +646,6 @@ } } }, - "forceSchemaArrayModifier": { - "type": "array", - "description": "", - "items": { - "type": "object", - "properties": { - "w": { - "type": "string", - "description": "" - }, - "y": { - "type": "array", - "description": "", - "items": { - "type": "string" - } - } - } - } - }, - "linkInDescription": { - "type": "object", - "properties": { - "propertyOne": { - "type": "string", - "description": "", - "default": "valueOne" - }, - "propertyTwo": { - "type": "string", - "description": "", - "default": "valueTwo" - } - } - }, "extraTest": { "type": "object", "properties": { @@ -729,6 +656,14 @@ } } }, + "forceSchemaArrayModifier": { + "type": "array", + "description": "The parameter should appear completely into the schema but with the modifier value into the README", + "default": "[]", + "items": { + "type": "string" + } + }, "nullable": { "type": "object", "description": "Nullable parameter", @@ -738,7 +673,7 @@ "nullableNullStringWithValueChange": { "type": "string", "description": "Nullable null string. We apply string modifier that will change the type and value, but the schema will show `nullable: true`.", - "default": null, + "default": "\"\"", "nullable": true }, "nullableNullArray": { @@ -776,7 +711,7 @@ "arrayEmptyModifier": { "type": "array", "description": "Test empty array modifier", - "default": "value", + "default": "[]", "items": { "type": "string" } diff --git a/tests/test-values.yaml b/tests/test-values.yaml index bcad0d8..f2238a9 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -62,7 +62,7 @@ hostAliases: [] ## @param image.registry [default: REGISTRY_NAME] Kubewatch image registry ## @param image.repository [default: REPOSITORY_NAME/kubewatch] Kubewatch image name ## @skip image.tag Kubewatch image tag -## @param image.pullPolicy Kubewatch image tag +## @param image.pullPolicy Kubewatch image pull policy ## @param image.pullSecrets Specify docker-registry secret names as an array image: registry: docker.io From 4eaa86373778b6bf309a3eb888bf7d92308a333d Mon Sep 17 00:00:00 2001 From: Jota Martos Date: Thu, 19 Oct 2023 12:30:02 +0200 Subject: [PATCH 7/7] Bump version Signed-off-by: Jota Martos --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b14fd0..16648da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@bitnami/readme-generator-for-helm", - "version": "2.5.3", + "version": "2.6.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 5754a63..766e493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitnami/readme-generator-for-helm", - "version": "2.5.3", + "version": "2.6.0", "description": "Autogenerate READMEs tables and OpenAPI schemas for Helm Charts", "main": "index.js", "scripts": {