<commit_before>suite: Test Ingress
templates:
- ingress.yaml
tests:
- it: should set external options
  set:
    tls: external
  asserts:
  - equal:
      path: metadata.annotations.nginx\.ingress\.kubernetes\.io/ssl-redirect
      value: "false"
  - isNull:
      path: metadata.annotations.certmanager\.k8s\.io/issuer
  - isNull:
      path: spec.tls
- it: should set default annotations with default cert-manager
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should set default annotations with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should set default annotations with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should over write proxy-connect-timeout with default cert-manager
  set:
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should over write proxy-connect-timeout with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should over write proxy-connect-timeout with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
- it: should set source secret
  set:
    hostname: test
    ingress.tls.source: secret
  asserts:
  - isNull:
      path: certmanager\.k8s\.io/issuer
  - contains:
      path: spec.tls
      content:
        hosts:
        - test
        secretName: tls-rancher-ingress
- it: should set static X-Forwarded-Host header with default cert-manager
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should set static X-Forwarded-Host header with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should set static X-Forwarded-Host header with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should be able to set multiple lines using configurationSnippet with default cert-manager
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";
- it: should be able to set multiple lines using configurationSnippet with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";
- it: should be able to set multiple lines using configurationSnippet with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
        nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";<commit_msg>Update tests<commit_after>suite: Test Ingress
templates:
- ingress.yaml
tests:
- it: should set external options
  set:
    tls: external
  asserts:
  - equal:
      path: metadata.annotations.nginx\.ingress\.kubernetes\.io/ssl-redirect
      value: "false"
  - isNull:
      path: metadata.annotations.certmanager\.k8s\.io/issuer
  - isNull:
      path: spec.tls
- it: should set default annotations with default cert-manager
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
- it: should set default annotations with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
- it: should set default annotations with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
- it: should over write proxy-connect-timeout with default cert-manager
  set:
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
- it: should over write proxy-connect-timeout with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
- it: should over write proxy-connect-timeout with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    ingress.extraAnnotations:
      nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
- it: should set source secret
  set:
    hostname: test
    ingress.tls.source: secret
  asserts:
  - isNull:
      path: certmanager\.k8s\.io/issuer
  - contains:
      path: spec.tls
      content:
        hosts:
        - test
        secretName: tls-rancher-ingress
- it: should set static X-Forwarded-Host header with default cert-manager
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should set static X-Forwarded-Host header with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should set static X-Forwarded-Host header with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
- it: should be able to set multiple lines using configurationSnippet with default cert-manager
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        cert-manager.io/issuer: RELEASE-NAME-rancher
        cert-manager.io/issuer-kind: Issuer
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";
- it: should be able to set multiple lines using configurationSnippet with cert-manager < 0.11.0 using capabilities
  capabilities:
    apiversions:
    - certmanager.k8s.io/v1alpha1
  set:
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";
- it: should be able to set multiple lines using configurationSnippet with cert-manager < 0.11.0 using parameter
  set:
    certmanager.version: 0.9.0
    hostname: host.example.com
    ingress:
      configurationSnippet: |
        more_set_input_headers "X-Forwarded-Host: {{ .Values.hostname }}";
        more_set_input_headers "foo: bar";
  asserts:
  - equal:
      path: metadata.annotations
      value:
        certmanager.k8s.io/issuer: RELEASE-NAME-rancher
        nginx.ingress.kubernetes.io/configuration-snippet: |
          more_set_input_headers "X-Forwarded-Host: host.example.com";
          more_set_input_headers "foo: bar";
{'fraction_non_alphanumeric': 0.10799477555509727, 'fraction_numerical': 0.01856052794390596, 'mean_word_length': 2.7905158936946326, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6485273', 'n_tokens_mistral': 4942, 'n_tokens_neox': 4690, 'n_words': 864}