Fix issues with host.v1 config type schema (#640)

- require "low", "high" properties in portRange
- fixed allowedAddresses item type in json schema docs
This commit is contained in:
Shawn Carey
2021-04-23 09:39:29 -04:00
committed by GitHub
parent 570fae8f84
commit deef2bba6a
4 changed files with 21 additions and 7 deletions
@@ -316,6 +316,7 @@ var tunnelDefinitions = map[string]interface{}{
"low": map[string]interface{}{"$ref": "#/definitions/portNumber"},
"high": map[string]interface{}{"$ref": "#/definitions/portNumber"},
},
"required": []interface{}{"low", "high"},
},
"protocolName": map[string]interface{}{
"type": "string",
+6 -1
View File
@@ -22,7 +22,7 @@ import (
)
const (
CurrentDbVersion = 21
CurrentDbVersion = 22
FieldVersion = "version"
)
@@ -91,6 +91,11 @@ func (m *Migrations) migrate(step *boltz.MigrationStep) int {
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV2ConfigType, nil))
}
if step.CurrentVersion < 22 {
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV1ConfigType, nil))
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV2ConfigType, nil))
}
// current version
if step.CurrentVersion <= CurrentDbVersion {
return CurrentDbVersion
+7 -3
View File
@@ -71,7 +71,11 @@
"high": {
"$ref": "#/$defs/portNumber"
}
}
},
"required": [
"low",
"high"
]
},
"protocolName": {
"type": "string",
@@ -136,7 +140,7 @@
{
"if": {
"properties": {
"forwardProtocol": {
"forwardPort": {
"const": true
}
},
@@ -173,7 +177,7 @@
},
{
"items": {
"$ref": "#/$defs/dialAddress"
"$ref": "#/$defs/listenAddress"
}
}
]
+7 -3
View File
@@ -156,7 +156,11 @@
"high": {
"$ref": "#/definitions/portNumber"
}
}
},
"required": [
"low",
"high"
]
},
"protocolName": {
"type": "string",
@@ -258,7 +262,7 @@
{
"if": {
"properties": {
"forwardProtocol": {
"forwardPort": {
"const": true
}
},
@@ -295,7 +299,7 @@
},
{
"items": {
"$ref": "#/definitions/dialAddress"
"$ref": "#/definitions/listenAddress"
}
}
]