Add option for forced direct SSH connection

 - Added --ssh-direct option
 - Added 2019.2.14 package versions
 - Updated kaas package versions
 - --tag option forces update if build repos set
 - Rebuilt tags archive to hold only active versions

Change-Id: I69886f960eb385fc1647d8c1080344ea2508712c
Related-PROD: PROD-35903
diff --git a/cfg_checker/cli/arguments.py b/cfg_checker/cli/arguments.py
index 4442324..28f3a04 100644
--- a/cfg_checker/cli/arguments.py
+++ b/cfg_checker/cli/arguments.py
@@ -26,9 +26,15 @@
         help="Use sudo for getting salt creds"
     )
     parser.add_argument(
+        '--ssh-direct',
+        action='store_true', default=False,
+        help="Force SSH to do direct connection instead of port forwarding"
+    )
+
+    parser.add_argument(
         '--force-no-key',
         action='store_true', default=False,
-        help="Use sudo for getting salt creds"
+        help="Force SSH to login with no key"
     )
     parser.add_argument(
         '--skip-nodes',
diff --git a/cfg_checker/common/const.py b/cfg_checker/common/const.py
index d17db08..a16011f 100644
--- a/cfg_checker/common/const.py
+++ b/cfg_checker/common/const.py
@@ -81,6 +81,21 @@
 }
 
 ubuntu_releases = ["trusty", "xenial", "ubuntu", "bionic", "focal"]
+kaas_ubuntu_active = [
+    "ubuntu-0.0.8",
+    "ubuntu-0.0.7",
+    "ubuntu-2020-07-30-013349",
+    "ubuntu-2020-12-14-013755",
+    "ubuntu-2021-05-27-013023"
+]
+mcp_active_tags = [
+    "2019.2.0",
+    "2019.2.10",
+    "2019.2.11",
+    "2019.2.12",
+    "2019.2.13",
+    "2019.2.14",
+]
 all_arch = ["amd64"]
 repo_types = {
     "main": "Officially supported software",
diff --git a/cfg_checker/common/settings.py b/cfg_checker/common/settings.py
index 4b7b3f5..c681114 100644
--- a/cfg_checker/common/settings.py
+++ b/cfg_checker/common/settings.py
@@ -328,6 +328,7 @@
         """Base configuration class. Only values that are common for all scripts
         """
         self.ssh_uses_sudo = args.sudo
+        self.ssh_direct = args.ssh_direct
         self.kube_config_path = args.kube_config
         self.debug = args.debug
         self.insecure = args.insecure
diff --git a/cfg_checker/modules/packages/repos.py b/cfg_checker/modules/packages/repos.py
index 1a040ff..6853a8f 100644
--- a/cfg_checker/modules/packages/repos.py
+++ b/cfg_checker/modules/packages/repos.py
@@ -12,6 +12,8 @@
 from cfg_checker.common.const import _repos_info_archive
 from cfg_checker.common.const import _repos_versions_archive
 from cfg_checker.common.const import ubuntu_releases
+from cfg_checker.common.const import kaas_ubuntu_active
+from cfg_checker.common.const import mcp_active_tags as active_tags
 from cfg_checker.common.file_utils import ensure_folder_exists
 from cfg_checker.common.file_utils import get_gzipped_file
 from cfg_checker.common.settings import pkg_dir
@@ -218,14 +220,27 @@
                 _tags.remove('hotfix')
             if "update" in _tags:
                 _tags.remove('update')
+            # Filter out not active tags
+            logger_cli.info("Active tags for mcp: {}".format(
+                ", ".join(active_tags)
+            ))
+            logger_cli.info("Active kaas ubuntu repos: {}".format(
+                ", ".join(kaas_ubuntu_active)
+            ))
+            _active_tags = [t for t in _tags if t in active_tags]
+
             # search tags in subfolders
             _h_tags, _ = self._ls_repo_page(base_url + 'hotfix')
             _u_tags, _ = self._ls_repo_page(base_url + 'update')
-            _tags.extend([t for t in _h_tags if t not in _tags])
-            _tags.extend([t for t in _u_tags if t not in _tags])
-            _progress = Progress(len(_tags))
+            _active_tags.extend(
+                [t for t in _h_tags if t not in _tags and t in active_tags]
+            )
+            _active_tags.extend(
+                [t for t in _u_tags if t not in _tags and t in active_tags]
+            )
+            _progress = Progress(len(_active_tags))
             _index = 0
-            for _tag in _tags:
+            for _tag in _active_tags:
                 _repos.update(self._find_tag(_tag, base_url))
                 _repos.update(self._find_tag(_tag, base_url, label="hotfix"))
                 _repos.update(self._find_tag(_tag, base_url, label="update"))
@@ -237,7 +252,7 @@
         for _label in _repos.keys():
             logger_cli.info("-> processing tag '{}'".format(_label))
             _name = _label + ".json"
-            if _repotgz.has_file(_name):
+            if _repotgz.has_file(_name) and not tag:
                 logger_cli.info(
                     "-> skipping, '{}' already has '{}'".format(
                         _repos_info_archive,
@@ -271,7 +286,7 @@
                 )
 
                 # Searching Package collections
-                if _stag in ubuntu_releases or _stag.startswith("ubuntu-2020"):
+                if _stag in ubuntu_releases or _stag in kaas_ubuntu_active:
                     # if stag is the release, this is all packages
                     _repo["all"][_stag] = []
                     _repo["all"]["url"] = _n_url(_u)
@@ -572,7 +587,7 @@
         _other_repos = 0
         for _c, _d in _info.items():
             for _ur, _l in _d.items():
-                if _ur in ubuntu_releases or _ur.startswith("ubuntu-2020"):
+                if _ur in ubuntu_releases or _ur in kaas_ubuntu_active:
                     _ubuntu_package_repos += len(_l)
                 elif _ur != 'url':
                     _other_repos += len(_l)
diff --git a/cfg_checker/nodes.py b/cfg_checker/nodes.py
index e6943a6..1780b60 100644
--- a/cfg_checker/nodes.py
+++ b/cfg_checker/nodes.py
@@ -198,7 +198,6 @@
             )
             # TODO: Use domain with biggest node count by default
             # or force it via config option
-            
         else:
             self.domain = _domains[0]
         logger_cli.info("-> {} nodes inactive".format(len(self.skip_list)))
@@ -652,7 +651,7 @@
         _k = self.env_config.kube_node_keypath
         _h = self.nodes[node]['internalip']
         _p = 22
-        if self.kube.is_local:
+        if self.kube.is_local or self.kube.config.ssh_direct:
             return None, self._get_ssh_shell(_h, _u, _k, _p, silent, piped)
         else:
             _fh = "localhost"
diff --git a/versions/repo.info.tgz b/versions/repo.info.tgz
index 8ea2f84..2bbc28d 100644
--- a/versions/repo.info.tgz
+++ b/versions/repo.info.tgz
Binary files differ
diff --git a/versions/repo.versions.tgz b/versions/repo.versions.tgz
index 56206fd..39f188d 100644
--- a/versions/repo.versions.tgz
+++ b/versions/repo.versions.tgz
Binary files differ