Skip to content

Commit b94fc2a

Browse files
Update jsonschema regex for target vc and make it required (loft-sh#3443)
1 parent d520bdf commit b94fc2a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

chart/values.schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@
10321032
},
10331033
"targetVirtualCluster": {
10341034
"type": "string",
1035+
"minLength": 1,
1036+
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
10351037
"description": "TargetVirtualCluster is the target virtual cluster for the custom resource proxy"
10361038
},
10371039
"accessResources": {
@@ -1040,7 +1042,10 @@
10401042
}
10411043
},
10421044
"additionalProperties": false,
1043-
"type": "object"
1045+
"type": "object",
1046+
"required": [
1047+
"targetVirtualCluster"
1048+
]
10441049
},
10451050
"Database": {
10461051
"properties": {

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ type CustomResourceProxy struct {
24172417
Enabled bool `json:"enabled,omitempty"`
24182418

24192419
// TargetVirtualCluster is the target virtual cluster for the custom resource proxy
2420-
TargetVirtualCluster string `json:"targetVirtualCluster,omitempty"`
2420+
TargetVirtualCluster string `json:"targetVirtualCluster" jsonschema:"required,minLength=1,pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"`
24212421

24222422
// AccessResources defines which resources should be accessible in the proxy.
24232423
AccessResources AccessResourcesMode `json:"accessResources,omitempty"`

0 commit comments

Comments
 (0)