
  - name: {{job_name}}
    cluster: {{build_cluster}}
    branches:
    - {{branch}}
    {%- if run_if_changed %}
    run_if_changed: '{{run_if_changed}}'
    {%- endif %}
    always_run: {{always_run}}
    optional: {{optional}}
    skip_report: {{skip_report}}
    labels:
      {%- if cloud == "aws" %}
      preset-service-account: "true"
      preset-aws-ssh: "true"
      {%- if not boskos_resource_type %}
      preset-k8s-kops-aws-credential: "true"
      {%- endif %}
      {%- elif cloud == "azure" %}
      preset-service-account: "true"
      preset-kops-azure-cred-wi: "true"
      {%- elif cloud == "do" %}
      preset-service-account: "true"
      preset-do-credential: "true"
      preset-do-spaces-credential: "true"
      preset-do-ssh: "true"
      {%- else %}
      preset-k8s-ssh: "true"
      {%- endif %}
    decorate: true
    decoration_config:
      timeout: {{job_timeout}}
    path_alias: k8s.io/kops
    {%- if extra_refs %}
    extra_refs:
    {%- for ref in extra_refs %}
    - org: {{ ref.org }}
      repo: {{ ref.repo }}
      base_ref: {{ ref.base_ref }}
      {%- if ref.path_alias %}
      path_alias: {{ ref.path_alias }}
      {%- endif %}
    {%- endfor %}
    {%- endif %}
    spec:
      {%- if cloud == "gce" %}
      serviceAccountName: k8s-kops-test
      {%- elif cloud == "azure" %}
      serviceAccountName: azure
      {%- endif %}
      containers:
      - image: {{image}}
        imagePullPolicy: Always
        command:
        - runner.sh
        args:
        - bash
        - -c
        - |
            make test-e2e-install
            kubetest2 kops \
            -v 2 \
            --up --build --down \
            {%- if cloud == "do" %}
            --cloud-provider=digitalocean \
            --env S3_ENDPOINT=https://sfo3.digitaloceanspaces.com \
            {%- else %}
            --cloud-provider={{cloud}} \
            {%- endif %}
            {%- if cloud == "gce" %}
            --admin-access=0.0.0.0/0 \
            {%- endif %}
            --create-args="{{create_args}}" \
            {%- if cluster_name %}
            --cluster-name="{{ cluster_name }}" \
            {%- endif %}
            {%- if kops_feature_flags %}
            --env=KOPS_FEATURE_FLAGS={{kops_feature_flags}} \
            {%- endif %}
            {%- if kubernetes_feature_gates %}
            --kubernetes-feature-gates={{ kubernetes_feature_gates }} \
            {%- endif %}
            {%- if boskos_resource_type and cloud == "aws" %}
            --boskos-aws-resource-type={{boskos_resource_type}} \
            {%- endif %}
            {%- if boskos_resource_type and cloud == "gce" %}
            --boskos-gcp-resource-type={{boskos_resource_type}} \
            {%- endif %}
            --kubernetes-version={{k8s_deploy_url}} \
            --kops-binary-path=/home/prow/go/src/k8s.io/kops/.build/dist/linux/amd64/kops \
            {%- if terraform_version %}
            --terraform-version={{terraform_version}} \
            {%- endif %}
            {%- if template_path %}
            --template-path={{template_path}} \
            {%- endif %}
            {%- for flag in instance_groups_overrides %}
            --control-plane-instance-group-overrides={{flag}} \
            --node-instance-group-overrides={{flag}} \
            {%- endfor %}
            --test=kops \
            -- \
            {%- if test_args %}
            --test-args="-test.timeout={{test_timeout}} {{ test_args }}" \
            {%- else %}
            --test-args="-test.timeout={{test_timeout}}" \
            {%- endif %}
            {%- if test_package_url %}
            --test-package-url={{test_package_url}} \
            {%- endif %}
            {%- if test_package_dir %}
            --test-package-dir={{test_package_dir}} \
            {%- endif %}
            --test-package-marker={{marker}} \
            {%- if focus_regex %}
            --focus-regex="{{focus_regex}}" \
            {%- endif %}
            {%- if skip_regex %}
            --skip-regex="{{skip_regex}}" \
            {%- endif %}
            --parallel={{test_parallelism}}
        securityContext:
          privileged: true
        env:
        {%- if cloud != "azure" and cloud != "do" %}
        - name: KUBE_SSH_KEY_PATH
          value: {{kops_ssh_key_path}}
        - name: KUBE_SSH_USER
          value: {{kops_ssh_user}}
        {%- endif %}
        - name: GINKGO_NO_COLOR
          value: "TRUE"
        - name: GOPATH
          value: /home/prow/go
        {%- for key, val in env.items() %}
        - name: {{ key }}
          value: "{{ val }}"
        {%- endfor %}
        resources:
          limits:
            cpu: "4"
            memory: 6Gi
          requests:
            cpu: "4"
            memory: 6Gi
