Skip to content

Commit

Permalink
Update/validation (#63)
Browse files Browse the repository at this point in the history
* add values.schema.json for nginx

* add values.schema.json for mongo

* add values.schema.json for postgres

* add values.schema.json for rabbitmq
  • Loading branch information
hlwanghl authored Jul 9, 2020
1 parent fff7d9c commit 286bca1
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/nginx/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ maintainers:
name: nginx
sources:
- https://github.com/kubesphere/helm-charts/tree/master/src/main/nginx
version: 1.2.1
version: 1.3.0
24 changes: 24 additions & 0 deletions src/main/nginx/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"replicaCount": {
"type": "integer",
"title": "Replicas Count",
"form": true,
"minimum": 1
},
"ingress": {
"type": "object",
"title": "Ingress",
"form": true,
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"form": true
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/test/mongodb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: mongodb
version: 0.2.0
version: 0.3.0
appVersion: 4.2.1
description: MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.
icon: https://upload.wikimedia.org/wikipedia/en/thumb/4/45/MongoDB-Logo.svg/250px-MongoDB-Logo.svg.png
Expand Down
38 changes: 38 additions & 0 deletions src/test/mongodb/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"persistence": {
"type": "object",
"title": "Data Persistence",
"form": true,
"properties": {
"size": {
"type": "string",
"title": "Persistent Volume Size",
"form": true,
"render": "slider",
"sliderMin": 1,
"sliderUnit": "Gi"
}
}
},
"rootUsername": {
"type": "string",
"title": "Root Username",
"form": true,
"regex": "^((?!root)\\w)+$"
},
"rootPassword": {
"type": "string",
"title": "Root Password",
"form": true,
"regex": "(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,32}"
}
},
"required": [
"persistence",
"rootUsername",
"rootPassword"
]
}
2 changes: 1 addition & 1 deletion src/test/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: postgresql
version: 0.2.0
version: 0.3.0
appVersion: "12.0"
description: PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
icon: https://wiki.postgresql.org/images/a/a4/PostgreSQL_logo.3colors.svg
Expand Down
43 changes: 43 additions & 0 deletions src/test/postgresql/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"persistence": {
"type": "object",
"title": "Data Persistence",
"form": true,
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"form": true
},
"size": {
"type": "string",
"title": "Persistent Volume Size",
"form": true,
"render": "slider",
"sliderMin": 1,
"sliderUnit": "Gi"
}
}
},
"rootUsername": {
"type": "string",
"title": "Root Username",
"form": true,
"regex": "^(?i)(?!(postgis|postgres|replica)$)[a-z_][a-z0-9_]{1,32}$"
},
"rootPassword": {
"type": "string",
"title": "Root Password",
"form": true,
"regex": "(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,32}"
}
},
"required": [
"persistence",
"rootUsername",
"rootPassword"
]
}
2 changes: 1 addition & 1 deletion src/test/rabbitmq/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: rabbitmq
version: 0.2.0
version: 0.3.0
appVersion: 3.8.1
description: RabbitMQ is the most widely deployed open source message broker. It supports multiple messaging protocols.
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/RabbitMQ_logo.svg/120px-RabbitMQ_logo.svg.png
Expand Down
64 changes: 64 additions & 0 deletions src/test/rabbitmq/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"persistence": {
"type": "object",
"title": "Data Persistence",
"form": true,
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"form": true
},
"size": {
"type": "string",
"title": "Persistent Volume Size",
"form": true,
"render": "slider",
"sliderMin": 1,
"sliderUnit": "Gi"
}
}
},
"extraPlugins": {
"type": "array",
"title": "Extra Plugins to Enable",
"form": true,
"items": {
"type": "string"
}
},
"extraConfigurations": {
"type": "string",
"title": "Extra Configurations",
"form": true,
"render": "textArea"
},
"advancedConfigurations": {
"type": "string",
"title": "Advanced Configurations",
"form": true,
"render": "textArea"
},
"defaultUsername": {
"type": "string",
"title": "Root Username",
"form": true,
"regex": "^\\w{1,32}$"
},
"defaultPassword": {
"type": "string",
"title": "Root Password",
"description": "Must contains at least one digit, one lowercase letter, and one uppercase letter",
"form": true,
"regex": "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,32}$"
}
},
"required": [
"persistence",
"defaultUsername",
"defaultPassword"
]
}

0 comments on commit 286bca1

Please sign in to comment.