Fix periodic and keep upgrade clusterctl jjbs

Change-Id: Ic3c43a043e9b1d979cb1c1b9173b3c2bc0d904e3
diff --git a/jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests.yml b/jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests.yml
deleted file mode 100644
index 7a4e7d0..0000000
--- a/jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests.yml
+++ /dev/null
@@ -1,136 +0,0 @@
----
-#
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2021 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-# Description:
-# ============
-# This file contains job template definition for Cluster API Provider Metal3 (CAPM3) e2e clusterctl upgrade tests.
-# This job can be triggered manually or through a Github pull request. It creates a
-# pipeline job. The pipeline scripts are maintained in Metal3 CI project infra repository.
-
-- job-template:
-    id: capm3_e2e_clusterctl_upgrade_tests
-    name: '{job_prefix}_{proj}_{upgrade_from_release}_main_e2e_clusterctl_upgrade_test_{image_os}'
-    description: "CAPM3 e2e upgrade tests for {org}/{repo} on {image_os}."
-    project-type: pipeline
-    defaults: global
-    disabled: False
-    concurrent: True
-    parameters:
-    - string:
-        name: PROJECT_REPO_ORG
-        default: '{org}'
-        description: 'Project github repo org name'
-    - string:
-        name: PROJECT_REPO_NAME
-        default: '{repo}'
-        description: 'Project github repo name'
-    - string:
-        name: ghprbActualCommit
-        default: 'main'
-        description: 'CI Repo branch for triggering manual build'
-    - string:
-        name: ghprbAuthorRepoGitUrl
-        default: 'https://github.com/{org}/{repo}.git'
-        description: 'CI Repo URL for triggering manual build'
-    - string:
-        name: ghprbTargetBranch
-        default: 'main'
-        description: 'Target branch of the PR'
-    - string:
-        name: IMAGE_OS
-        default: '{image_os}'
-        description: 'Distribution to use for the target host as well as source and target cluster. Can be ubuntu or centos'
-    - string:
-        name: capm3_release_branch
-        default: 'main'
-        description: 'The target branch of CAPM3 to be used for this test'
-    - string:
-        name: bmo_release_branch
-        default: 'main'
-        description: 'The target branch of BMO to be used for this test'
-    - string:
-        name: CAPI_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API version. E.g. v1beta1.'
-    - string:
-        name: CAPM3_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API provider Metal3 version. E.g. v1beta1.'
-    - string:
-        name: TARGET_NODE_MEMORY
-        default: 4096
-        description: 'RAM size of the target host.'
-    - string:
-        name: TESTS_FOR
-        default: "e2e_tests"
-        description: 'Tests using the e2e framework.'
-    - string:
-        name: GINKGO_FOCUS
-        default: "clusterctl-upgrade"
-        description: 'Select the e2e upgrade test'
-    - string:
-        name: UPGRADE_FROM_RELEASE
-        default: '{upgrade_from}'
-        description: 'Release to upgrade from'
-
-    properties:
-    - build-discarder:
-        days-to-keep: 30
-        num-to-keep: 300
-        artifact-days-to-keep: -1
-        artifact-num-to-keep: -1
-    - github:
-        url: https://github.com/{org}/{repo}
-
-    triggers:
-    - github-pull-request:
-        admin-list:
-          - '{ci_github_admin_user}'
-        org-list: "{ci_github_whitelist_org}"
-        cron: 'H/5 * * * *'
-        auth-id: "{ci_ghprb_auth_id}"
-        trigger-phrase: '.*?/test-e2e-upgrade-main-{upgrade_from_release}.*?'
-        skip-build-phrase: '/skip-test'
-        only-trigger-phrase: True
-        github-hooks: True
-        permit-all: False
-        auto-close-on-fail: False
-        allow-whitelist-orgs-as-admins: True
-        white-list-target-branches:
-          - 'main'
-        status-context: "test-e2e-upgrade-main-{upgrade_from_release}"
-        success-status: "Passed"
-        failure-status: "Failed"
-        error-status: "Error"
-        cancel-builds-on-update: True
-    pipeline-scm:
-      scm:
-      - git:
-          url: "{ci_github_repo}"
-          credentials-id: "{ci_github_jenkins_credentials_id}"
-          branches:
-            - '{branch|main}'
-          name: 'origin'
-          refspec: '+refs/heads/*:refs/remotes/origin/*'
-          wipe-workspace: True
-          honor-refspec: True
-          shallow-clone: False
-      script-path: "{ci_github_pipeline}"
-      lightweight-checkout: False
diff --git a/jjb/metal3/job_capm3_clusterctl_upgrade_tests_prow.yml b/jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests_prow.yml
similarity index 96%
rename from jjb/metal3/job_capm3_clusterctl_upgrade_tests_prow.yml
rename to jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests_prow.yml
index ab7b780..a08edf0 100644
--- a/jjb/metal3/job_capm3_clusterctl_upgrade_tests_prow.yml
+++ b/jjb/metal3/job_capm3_e2e_clusterctl_upgrade_tests_prow.yml
@@ -25,8 +25,8 @@
 # pipeline job. The pipeline scripts are maintained in Metal3 CI project infra repository.
 
 - job-template:
-    id: capm3_clusterctl_upgrade_tests_prow
-    name: '{job_prefix}-clusterctl-upgrade-test-{capm3_target_branch}'
+    id: capm3_e2e_clusterctl_upgrade_tests_prow
+    name: '{job_prefix}-e2e-clusterctl-upgrade-test-{capm3_target_branch}'
     description: "CAPM3 e2e clusterctl upgrade tests for on ubuntu."
     project-type: pipeline
     defaults: global
diff --git a/jjb/metal3/job_capm3_main_e2e_clusterctl_upgrade_tests_prow.yml b/jjb/metal3/job_capm3_main_e2e_clusterctl_upgrade_tests_prow.yml
index 269217e..7725ad1 100644
--- a/jjb/metal3/job_capm3_main_e2e_clusterctl_upgrade_tests_prow.yml
+++ b/jjb/metal3/job_capm3_main_e2e_clusterctl_upgrade_tests_prow.yml
@@ -26,7 +26,7 @@
 
 - job-template:
     id: capm3_main_e2e_clusterctl_upgrade_tests_prow
-    name: '{job_prefix}-daily-e2e-clusterctl-upgrade-{upgrade_from_release}'
+    name: '{job_prefix}-daily-e2e-clusterctl-upgrade-test-{capm3_target_branch}'
     description: "CAPM e2e clusterctl upgrade tests on ubuntu."
     project-type: pipeline
     defaults: global
@@ -73,14 +73,6 @@
         default: 'main'
         description: 'The target branch of BMO to be used for this test'
     - string:
-        name: CAPI_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API version. E.g. v1beta1.'
-    - string:
-        name: CAPM3_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API provider Metal3 version. E.g. v1beta1.'
-    - string:
         name: TARGET_NODE_MEMORY
         default: 4096
         description: 'RAM size of the target host.'
@@ -92,10 +84,6 @@
         name: GINKGO_FOCUS
         default: "clusterctl-upgrade"
         description: 'Select the e2e upgrade test'
-    - string:
-        name: UPGRADE_FROM_RELEASE
-        default: '{upgrade_from}'
-        description: 'Release to upgrade from'
 
     properties:
     - build-discarder:
@@ -119,5 +107,5 @@
           wipe-workspace: True
           honor-refspec: True
           shallow-clone: False
-      script-path: "jenkins/jobs/prow_integration_tests.pipeline"
+      script-path: "{e2e_feature_test_pipeline}"
       lightweight-checkout: False
diff --git a/jjb/metal3/job_keep_capm3_e2e_clusterctl_upgrade_tests_prow.yml b/jjb/metal3/job_keep_capm3_e2e_clusterctl_upgrade_tests_prow.yml
index 3ca02dd..2389586 100644
--- a/jjb/metal3/job_keep_capm3_e2e_clusterctl_upgrade_tests_prow.yml
+++ b/jjb/metal3/job_keep_capm3_e2e_clusterctl_upgrade_tests_prow.yml
@@ -26,7 +26,7 @@
 
 - job-template:
     id: keep_capm3_e2e_clusterctl_upgrade_tests_prow
-    name: '{job_prefix}-keep-e2e-clusterctl-upgrade-{upgrade_from_release}'
+    name: '{job_prefix}-keep-e2e-clusterctl-upgrade-test-{capm3_target_branch}'
     description: "Keep CAPM3 e2e upgrade tests on {image_os}."
     project-type: pipeline
     defaults: global
@@ -73,14 +73,6 @@
         default: 'main'
         description: 'The target branch of BMO to be used for this test'
     - string:
-        name: CAPI_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API version. E.g. v1beta1.'
-    - string:
-        name: CAPM3_VERSION
-        default: 'v1beta1'
-        description: 'Cluster API provider Metal3 version. E.g. v1beta1.'
-    - string:
         name: TARGET_NODE_MEMORY
         default: 4096
         description: 'RAM size of the target host.'
@@ -96,10 +88,6 @@
         name: GINKGO_FOCUS
         default: "clusterctl-upgrade"
         description: 'Select the e2e upgrade test'
-    - string:
-        name: UPGRADE_FROM_RELEASE
-        default: '{upgrade_from}'
-        description: 'Release to upgrade from'
 
     properties:
     - build-discarder:
@@ -122,5 +110,5 @@
           wipe-workspace: True
           honor-refspec: True
           shallow-clone: False
-      script-path: "jenkins/jobs/prow_integration_tests.pipeline"
+      script-path: "{e2e_feature_test_pipeline}"
       lightweight-checkout: False
diff --git a/jjb/metal3/projects.yml b/jjb/metal3/projects.yml
index d19e467..5a20c73 100644
--- a/jjb/metal3/projects.yml
+++ b/jjb/metal3/projects.yml
@@ -274,20 +274,6 @@
     - ubuntu
     - centos
     jobs:
-    - capm3_e2e_clusterctl_upgrade_tests:
-        upgrade_from_release:
-        - from-release-1-6:
-            upgrade_from: v1.6.
-        - from-release-1-5:
-            upgrade_from: v1.5.
-        - from-release-1-4:
-            upgrade_from: v1.4.
-        - from-release-1-3:
-            upgrade_from: v1.3.
-        - from-release-0-5:
-            upgrade_from: v0.5.
-        exclude:
-        - image_os: centos
     - capm3_e2e_k8s_upgrade_tests:
         k8s_versions:
         - 1-28-1-29:
@@ -629,35 +615,21 @@
             capm3_version: v1beta1
             capm3_release_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - release-1-6:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            target_branches:
-            - 'main'
-            - 'release-1.6'
-            - 'release-0.5'
         - release-1-5:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            target_branches:
-            - 'main'
-            - 'release-1.5'
-            - 'release-0.4'
         - release-1-4:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
-            target_branches:
-            - 'main'
-            - 'release-1.4'
-            - 'release-0.3'
     - capm3_main_e2e_integration_tests_prow:
         capm3_target_branch:
         - main:
@@ -679,35 +651,21 @@
             capm3_version: v1beta1
             capm3_release_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - release-1-6:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            target_branches:
-            - 'main'
-            - 'release-1.6'
-            - 'release-0.5'
         - release-1-5:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            target_branches:
-            - 'main'
-            - 'release-1.5'
-            - 'release-0.4'
         - release-1-4:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
-            target_branches:
-            - 'main'
-            - 'release-1.4'
-            - 'release-0.3'
     - capm3_e2e_feature_tests_prow:
         capm3_target_branch:
         - main:
@@ -715,32 +673,21 @@
             capm3_version: v1beta1
             capm3_release_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - release-1-6:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            target_branches:
-            - 'release-1.6'
-            - 'release-0.5'
         - release-1-5:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            target_branches:
-            - 'release-1.5'
-            - 'release-0.4'
         - release-1-4:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
-            target_branches:
-            - 'release-1.4'
-            - 'release-0.3'
     - capm3_main_e2e_feature_tests_prow:
         capm3_target_branch:
         - main:
@@ -778,65 +725,35 @@
             capm3_version: v1beta1
             capm3_release_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - release-1-6:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            target_branches:
-            - 'release-1.6'
-            - 'release-0.5'
         - release-1-5:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            target_branches:
-            - 'release-1.5'
-            - 'release-0.4'
         - release-1-4:
             capi_version: v1beta1
             capm3_version: v1beta1
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
-            target_branches:
-            - 'release-1.4'
-            - 'release-0.3'
-    - capm3_clusterctl_upgrade_tests_prow:
+    - capm3_e2e_clusterctl_upgrade_tests_prow:
         capm3_target_branch:
         - main:
-            capi_version: v1beta1
-            capm3_version: v1beta1
             capm3_release_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - release-1-6:
-            capi_version: v1beta1
-            capm3_version: v1beta1
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            target_branches:
-            - 'release-1.6'
-            - 'release-0.5'
         - release-1-5:
-            capi_version: v1beta1
-            capm3_version: v1beta1
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            target_branches:
-            - 'release-1.5'
-            - 'release-0.4'
         - release-1-4:
-            capi_version: v1beta1
-            capm3_version: v1beta1
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
-            target_branches:
-            - 'release-1.4'
-            - 'release-0.3'
         exclude:
         - image_os: centos
     - capm3_e2e_k8s_upgrade_tests_prow:
@@ -848,8 +765,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-27-1-28:
             k8s_version_upgrade_from: v1.27.4
             k8s_version_upgrade_to: v1.28.1
@@ -857,8 +772,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
@@ -866,8 +779,6 @@
             capm3_release_branch: main
             capm3_target_branch: main
             bmo_release_branch: main
-            target_branches:
-            - 'main'
         - 1-28-1-29:
             k8s_version_upgrade_from: v1.28.1
             k8s_version_upgrade_to: v1.29.0
@@ -875,9 +786,6 @@
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
             capm3_target_branch: release-1-6
-            target_branches:
-            - 'release-1.6'
-            - 'release-0.5'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
@@ -885,9 +793,6 @@
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
             capm3_target_branch: release-1-5
-            target_branches:
-            - 'release-1.5'
-            - 'release-0.4'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             kubectl_sha256: 636ac0eaa467dbceda4b2c4e33662adc9709f5ce40341c9fc1a687fc276ac02d # v1.26.4
@@ -895,23 +800,22 @@
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
             capm3_target_branch: release-1-4
-            target_branches:
-            - 'release-1.4'
-            - 'release-0.3'
         exclude:
         - image_os: centos
     - capm3_main_e2e_clusterctl_upgrade_tests_prow:
-        upgrade_from_release:
-        - from-release-1-6:
-            upgrade_from: v1.6.
-        - from-release-1-5:
-            upgrade_from: v1.5.
-        - from-release-1-4:
-            upgrade_from: v1.4.
-        - from-release-1-3:
-            upgrade_from: v1.3.
-        - from-release-0-5:
-            upgrade_from: v0.5.
+        capm3_target_branch:
+        - main:
+            capm3_release_branch: main
+            bmo_release_branch: main
+        - release-1-6:
+            capm3_release_branch: release-1.6
+            bmo_release_branch: release-0.5
+        - release-1-5:
+            capm3_release_branch: release-1.5
+            bmo_release_branch: release-0.4
+        - release-1-4:
+            capm3_release_branch: release-1.4
+            bmo_release_branch: release-0.3
         exclude:
         - image_os: centos
     - capm3_main_e2e_k8s_upgrade_tests_prow:
@@ -923,8 +827,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-27-1-28:
             k8s_version_upgrade_from: v1.27.4
             k8s_version_upgrade_to: v1.28.1
@@ -932,8 +834,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
@@ -965,17 +865,19 @@
         exclude:
         - image_os: centos
     - keep_capm3_e2e_clusterctl_upgrade_tests_prow:
-        upgrade_from_release:
-        - from-release-1-6:
-            upgrade_from: v1.6.
-        - from-release-1-5:
-            upgrade_from: v1.5.
-        - from-release-1-4:
-            upgrade_from: v1.4.
-        - from-release-1-3:
-            upgrade_from: v1.3.
-        - from-release-0-5:
-            upgrade_from: v0.5.
+        capm3_target_branch:
+        - main:
+            capm3_release_branch: main
+            bmo_release_branch: main
+        - release-1-6:
+            capm3_release_branch: release-1.6
+            bmo_release_branch: release-0.5
+        - release-1-5:
+            capm3_release_branch: release-1.5
+            bmo_release_branch: release-0.4
+        - release-1-4:
+            capm3_release_branch: release-1.4
+            bmo_release_branch: release-0.3
         exclude:
         - image_os: centos
     - keep_capm3_e2e_k8s_upgrade_tests_prow:
@@ -987,8 +889,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-27-1-28:
             k8s_version_upgrade_from: v1.27.4
             k8s_version_upgrade_to: v1.28.1
@@ -996,8 +896,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
@@ -1005,8 +903,6 @@
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            target_branches:
-            - 'main'
         - 1-28-1-29:
             k8s_version_upgrade_from: v1.28.1
             k8s_version_upgrade_to: v1.29.0
@@ -1014,9 +910,6 @@
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
             capm3_target_branch: release-1-6
-            target_branches:
-            - 'release-1.6'
-            - 'release-0.5'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
@@ -1024,9 +917,6 @@
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
             capm3_target_branch: release-1-5
-            target_branches:
-            - 'release-1.5'
-            - 'release-0.4'
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             kubectl_sha256: 636ac0eaa467dbceda4b2c4e33662adc9709f5ce40341c9fc1a687fc276ac02d # v1.26.4
@@ -1034,9 +924,6 @@
             capm3_release_branch: release-1.4
             bmo_release_branch: release-0.3
             capm3_target_branch: release-1-4
-            target_branches:
-            - 'release-1.4'
-            - 'release-0.3'
         exclude:
         - image_os: centos