-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,16 @@ | |
import fr.insee.onyxia.api.configuration.CatalogWrapper; | ||
import fr.insee.onyxia.api.configuration.CustomObjectMapper; | ||
import fr.insee.onyxia.api.util.TestUtils; | ||
import fr.insee.onyxia.model.helm.Chart; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
import org.springframework.util.CollectionUtils; | ||
|
||
@ExtendWith(SpringExtension.class) | ||
@SpringBootTest(classes = {CatalogLoader.class, CustomObjectMapper.class}) | ||
|
@@ -49,6 +52,27 @@ public void excludeChartTest() { | |
.noneMatch(p -> p.getName().equalsIgnoreCase("excludeme"))); | ||
} | ||
|
||
@Test | ||
public void loadMaintainers() { | ||
CatalogWrapper cw = new CatalogWrapper(); | ||
cw.setType("helm"); | ||
cw.setLocation("classpath:/catalog-loader-test"); | ||
cw.setExcludedCharts(List.of("excludemetoo", "excludeme")); | ||
catalogLoader.updateCatalog(cw); | ||
List<List<Chart.Maintainer>> maintainers = | ||
cw.getCatalog().getPackages().stream() | ||
.map(p -> ((Chart) p).getMaintainers()) | ||
.collect(Collectors.toList()); | ||
assertThat( | ||
"Maintainers have been loaded", | ||
maintainers.stream() | ||
.filter(l -> !CollectionUtils.isEmpty(l)) | ||
.anyMatch( | ||
l -> | ||
l.get(0).getName().equals("test") | ||
&& l.get(0).getEmail().equals("[email protected]"))); | ||
} | ||
|
||
@DisplayName( | ||
"Given a helm catalog wrapper with local charts and excluded charts, " | ||
+ "when we update the catalog, " | ||
|
179 changes: 91 additions & 88 deletions
179
onyxia-api/src/test/resources/catalog-loader-test/index.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,96 @@ | ||
apiVersion: v1 | ||
entries: | ||
keepme: | ||
- apiVersion: v2 | ||
appVersion: "1" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: keepme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- keepeme1.gz | ||
version: 2.4.0 | ||
- apiVersion: v2 | ||
appVersion: "2" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: keepme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- keepeme2.gz | ||
version: 2.4.0 | ||
- apiVersion: v2 | ||
appVersion: "1" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: keepme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- keepeme1.gz | ||
version: 2.4.0 | ||
maintainers: | ||
- email: [email protected] | ||
name: test | ||
- apiVersion: v2 | ||
appVersion: "2" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: keepme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- keepeme2.gz | ||
version: 2.4.0 | ||
excludeme: | ||
- apiVersion: v2 | ||
appVersion: "1" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: excludeme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- excludeme1.gz | ||
version: 2.4.0 | ||
- apiVersion: v2 | ||
appVersion: "2" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: excludeme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- excludeme2.gz | ||
version: 2.4.0 | ||
- apiVersion: v2 | ||
appVersion: "1" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: excludeme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- excludeme1.gz | ||
version: 2.4.0 | ||
- apiVersion: v2 | ||
appVersion: "2" | ||
created: "2022-10-03T11:53:20.589754116Z" | ||
dependencies: | ||
- name: argo-cd | ||
repository: https://argoproj.github.io/argo-helm | ||
version: 4.9.11 | ||
- name: library-chart | ||
repository: https://inseefrlab.github.io/helm-charts-datascience | ||
version: 2.0.21 | ||
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. | ||
digest: beedc71c7f5730cf68000b5665dd4da636e72a026edd9b12c1d048398d4166dd | ||
home: https://argo-cd.readthedocs.io/en/stable/ | ||
icon: https://minio.lab.sspcloud.fr/projet-onyxia/assets/servicesImg/argo.png | ||
name: excludeme | ||
sources: | ||
- https://github.com/InseeFrLab/helm-charts-datascience/tree/master/charts/argo-cd | ||
- https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd | ||
type: application | ||
urls: | ||
- excludeme2.gz | ||
version: 2.4.0 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters