diff --git a/ansible/playbooks/roles/repository/files/download-requirements/requirements/aarch64/files.yml b/ansible/playbooks/roles/repository/files/download-requirements/requirements/aarch64/files.yml index 3270a882a7..d15eb814e8 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/requirements/aarch64/files.yml +++ b/ansible/playbooks/roles/repository/files/download-requirements/requirements/aarch64/files.yml @@ -41,11 +41,11 @@ files: # --- Helm charts --- 'https://charts.bitnami.com/bitnami/node-exporter-2.3.17.tgz': sha256: ec586fabb775a4f05510386899cf348391523c89ff5a1d4097b0592e675ade7f - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] 'https://helm.elastic.co/helm/filebeat/filebeat-7.12.1.tgz': sha256: 5838058fe06372390dc335900a7707109cc7287a84164ca245d395af1f9c0a79 - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] # --- OpenSearch Bundle --- 'https://artifacts.opensearch.org/releases/bundle/opensearch/1.2.4/opensearch-1.2.4-linux-arm64.tar.gz': diff --git a/ansible/playbooks/roles/repository/files/download-requirements/requirements/x86_64/files.yml b/ansible/playbooks/roles/repository/files/download-requirements/requirements/x86_64/files.yml index 09583356a1..4b4df4decf 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/requirements/x86_64/files.yml +++ b/ansible/playbooks/roles/repository/files/download-requirements/requirements/x86_64/files.yml @@ -41,11 +41,11 @@ files: # --- Helm charts --- 'https://charts.bitnami.com/bitnami/node-exporter-2.3.17.tgz': sha256: ec586fabb775a4f05510386899cf348391523c89ff5a1d4097b0592e675ade7f - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] 'https://helm.elastic.co/helm/filebeat/filebeat-7.12.1.tgz': sha256: 5838058fe06372390dc335900a7707109cc7287a84164ca245d395af1f9c0a79 - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] 'https://charts.rook.io/release/rook-ceph-v1.8.8.tgz': sha256: f67e474dedffd4004f3a0b7b40112694a7f1c2b1a0048b03b3083d0a01e86b14 diff --git a/ansible/playbooks/roles/repository/files/download-requirements/src/config/config.py b/ansible/playbooks/roles/repository/files/download-requirements/src/config/config.py index c4f29ba97c..4a15dfdefc 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/src/config/config.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/src/config/config.py @@ -258,8 +258,7 @@ def __print_parsed_manifest_data(self, requirements: Dict[str, Any], manifest: D logging.info('\n'.join(lines)) def __filter_files(self, requirements: Dict[str, Any], - manifest: Dict[str, Any], - is_k8s_as_cloud_service: bool): + manifest: Dict[str, Any]): """ See :func:`~config.Config.__filter_manifest` """ @@ -270,9 +269,6 @@ def __filter_files(self, requirements: Dict[str, Any], if all(dep not in manifest['requested-features'] for dep in deps) and deps != 'default': files_to_exclude.append(file) - if is_k8s_as_cloud_service: - files_to_exclude = [file for file in files if 'kubernetes-master' not in files[file]['deps']] - if files_to_exclude: requirements['files'] = {url: data for url, data in files.items() if url not in files_to_exclude} @@ -301,19 +297,17 @@ def __filter_images(self, requirements: Dict[str, Any], manifest: Dict[str, Any] requirements['images'] = images_to_download def __filter_manifest(self, requirements: Dict[str, Any], - manifest: Dict[str, Any], - is_k8s_as_cloud_service: bool): + manifest: Dict[str, Any]): """ Filter entries in the `requirements` based on the parsed `manifest` documents. :param requirements: parsed requirements which will be filtered based on the `manifest` content :param manifest: parsed documents which will be used to filter `requirements` - :param is_k8s_as_cloud_service: whether to download kubernetes files if service is not present """ if 'grafana' not in manifest['requested-features']: requirements['grafana-dashboards'] = [] - self.__filter_files(requirements, manifest, is_k8s_as_cloud_service) + self.__filter_files(requirements, manifest) self.__filter_images(requirements, manifest) def read_manifest(self, requirements: Dict[str, Any]): @@ -333,7 +327,7 @@ def read_manifest(self, requirements: Dict[str, Any]): mreader = ManifestReader(self.dest_manifest, self.os_arch) try: manifest = mreader.parse_manifest() - self.__filter_manifest(requirements, manifest, mreader.is_k8s_as_cloud_service) + self.__filter_manifest(requirements, manifest) if self.verbose_mode: self.__print_parsed_manifest_data(requirements, manifest) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py b/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py index a0d8af6e6a..3276aec6be 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py @@ -38,10 +38,6 @@ def __init__(self, dest_manifest: Path, arch: OSArch): self.__requested_features: Set = set() self.__requested_images: Set = set() - @property - def is_k8s_as_cloud_service(self) -> bool: - return self.__k8s_as_cloud_service - def __parse_cluster_doc(self, cluster_doc: Dict): """ Parse `epiphany-cluster` document and extract only used components. @@ -74,6 +70,9 @@ def __parse_feature_mappings_doc(self, feature_mappings_doc: Dict): for feature in mappings[mapping]: self.__requested_features.add(feature) + if self.__k8s_as_cloud_service: + self.__requested_features.add('k8s-as-cloud-service') + def __parse_image_registry_doc(self, image_registry_doc: Dict): """ Parse `configuration/image-registry` document and extract only used images. diff --git a/ansible/playbooks/roles/repository/files/download-requirements/tests/data/config.py b/ansible/playbooks/roles/repository/files/download-requirements/tests/data/config.py index d2d3492027..9f10f61975 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/tests/data/config.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/tests/data/config.py @@ -41,11 +41,11 @@ # --- Helm charts --- 'https://charts.bitnami.com/bitnami/node-exporter-2.3.17.tgz': sha256: ec586fabb775a4f05510386899cf348391523c89ff5a1d4097b0592e675ade7f - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] 'https://helm.elastic.co/helm/filebeat/filebeat-7.12.1.tgz': sha256: 5838058fe06372390dc335900a7707109cc7287a84164ca245d395af1f9c0a79 - deps: [kubernetes-master] + deps: [kubernetes-master, k8s-as-cloud-service] 'https://charts.rook.io/release/rook-ceph-v1.8.8.tgz': sha256: f67e474dedffd4004f3a0b7b40112694a7f1c2b1a0048b03b3083d0a01e86b14 @@ -463,13 +463,13 @@ - filebeat - firewall - image-registry +- k8s-as-cloud-service - node-exporter - repository Files to download: - https://charts.bitnami.com/bitnami/node-exporter-2.3.17.tgz -- https://charts.rook.io/release/rook-ceph-cluster-v1.8.8.tgz -- https://charts.rook.io/release/rook-ceph-v1.8.8.tgz +- https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz - https://helm.elastic.co/helm/filebeat/filebeat-7.12.1.tgz -------------------------------------------------- """