diff --git a/README.md b/README.md index 375d72d..706a68c 100644 --- a/README.md +++ b/README.md @@ -117,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/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/builder.js b/lib/builder.js index d8e3d83..3757d83 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -35,6 +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: { + 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}`); } @@ -58,8 +63,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..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/package-lock.json b/package-lock.json index 2f0ac5d..16648da 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.6.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index af1ecb1..766e493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitnami/readme-generator-for-helm", - "version": "2.5.2", + "version": "2.6.0", "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..6aa8059 100644 --- a/tests/expected-readme.first-execution.md +++ b/tests/expected-readme.first-execution.md @@ -29,49 +29,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..15adea4 100644 --- a/tests/expected-readme.last-section-text-below.md +++ b/tests/expected-readme.last-section-text-below.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..846918a 100644 --- a/tests/expected-readme.last-section.md +++ b/tests/expected-readme.last-section.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..e5a2630 100644 --- a/tests/expected-readme.md +++ b/tests/expected-readme.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..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": "Kubewatch image tag", - "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 ed17db4..15adea4 100644 --- a/tests/test-readme.last-section-text-below.md +++ b/tests/test-readme.last-section-text-below.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..846918a 100644 --- a/tests/test-readme.last-section.md +++ b/tests/test-readme.last-section.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..e5a2630 100644 --- a/tests/test-readme.md +++ b/tests/test-readme.md @@ -67,49 +67,48 @@ 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 | `REGISTRY_NAME` | +| `image.repository` | Kubewatch image name | `REPOSITORY_NAME/kubewatch` | +| `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` | +| `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..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": "Kubewatch image tag", - "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 f4637bf..f2238a9 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -59,10 +59,10 @@ hostAliases: [] ## Bitnami Kubewatch image version ## ref: https://hub.docker.com/r/bitnami/kubewatch/tags/ ## -## @param image.registry Kubewatch image registry -## @param image.repository Kubewatch image name -## @param image.tag Kubewatch image tag -## @param image.pullPolicy Kubewatch image tag +## @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 pull policy ## @param image.pullSecrets Specify docker-registry secret names as an array image: registry: docker.io