Skip to content

Commit

Permalink
fix: expression schema error
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Oct 2, 2024
1 parent e3ad6bb commit 5b7e5d6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
17 changes: 17 additions & 0 deletions chart/tests/statefulset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -879,3 +879,20 @@ tests:
- equal:
path: kind
value: StatefulSet

- it: sync custom resources
set:
sync:
toHost:
customResources:
test.cert-manager.io:
enabled: true
translate:
- path: spec.dnsNames[*]
expression:
fromHost: "value.startsWith('www.') ? value.slice(4) : value"
toHost: '"www."+value'
asserts:
- equal:
path: kind
value: StatefulSet
14 changes: 0 additions & 14 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3237,20 +3237,6 @@
"type": "object"
},
"TranslatePatchExpression": {
"oneOf": [
{
"required": [
"toHost"
],
"title": "toHost"
},
{
"required": [
"fromHost"
],
"title": "fromHost"
}
],
"properties": {
"toHost": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ type TranslatePatchReference struct {

type TranslatePatchExpression struct {
// ToHost is the expression to apply when retrieving a change from virtual to host.
ToHost string `json:"toHost,omitempty" jsonschema:"oneof_required=toHost"`
ToHost string `json:"toHost,omitempty"`

// FromHost is the patch to apply when retrieving a change from host to virtual.
FromHost string `json:"fromHost,omitempty" jsonschema:"oneof_required=fromHost"`
FromHost string `json:"fromHost,omitempty"`
}

type SyncFromHostCustomResource struct {
Expand Down

0 comments on commit 5b7e5d6

Please sign in to comment.