suite: Test Gateway API backendTLSPolicy.yaml release: name: gitea-unittests namespace: testing templates: - templates/gitea/backendTLSPolicy.yaml tests: - it: should not render when gatewayAPI.enabled is false set: gatewayAPI: enabled: false core: backendTLSPolicy: enabled: true validation: hostname: git.internal caCertificateRefs: - name: gitea-ca group: "" kind: ConfigMap asserts: - hasDocuments: count: 0 - it: should not render when backendTLSPolicy.enabled is false set: gatewayAPI: enabled: true gatewayAPI.core.backendTLSPolicy.enabled: false asserts: - hasDocuments: count: 0 - it: should render a BackendTLSPolicy targeting the http Service by default set: gatewayAPI: enabled: true core: backendTLSPolicy: enabled: true validation: hostname: git.internal caCertificateRefs: - name: gitea-ca group: "" kind: ConfigMap asserts: - hasDocuments: count: 1 - isKind: of: BackendTLSPolicy - equal: path: apiVersion value: gateway.networking.k8s.io/v1 - equal: path: metadata.name value: gitea-unittests - equal: path: spec.targetRefs[0].name value: gitea-unittests-http - equal: path: spec.targetRefs[0].kind value: Service - equal: path: spec.validation.hostname value: git.internal - it: should fail when validation is missing set: gatewayAPI: enabled: true core: backendTLSPolicy: enabled: true asserts: - failedTemplate: errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required - it: should fail when validation is an empty dict set: gatewayAPI: enabled: true core: backendTLSPolicy: enabled: true validation: {} asserts: - failedTemplate: errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required