diff --git a/chart/tests/statefulset_test.yaml b/chart/tests/statefulset_test.yaml index fd270cc6da..90dce70aa4 100644 --- a/chart/tests/statefulset_test.yaml +++ b/chart/tests/statefulset_test.yaml @@ -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 diff --git a/chart/values.schema.json b/chart/values.schema.json index d01d2512cb..283c338732 100755 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -3237,20 +3237,6 @@ "type": "object" }, "TranslatePatchExpression": { - "oneOf": [ - { - "required": [ - "toHost" - ], - "title": "toHost" - }, - { - "required": [ - "fromHost" - ], - "title": "fromHost" - } - ], "properties": { "toHost": { "type": "string", diff --git a/config/config.go b/config/config.go index 17745a62e6..47ce0f3e0e 100644 --- a/config/config.go +++ b/config/config.go @@ -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 {