Skip to content

Commit

Permalink
Use legal Helm chart names in the test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Jurrie Overgoor <[email protected]>
  • Loading branch information
Jurrie authored and manusa committed Mar 4, 2024
1 parent 24cbc99 commit 4afc8e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ void k8sHelm() throws Exception {
final InvocationResult invocationResult = maven("k8s:helm");
// Then
assertInvocation(invocationResult);
assertThat(new File(String.format("../%s/target/jkube/helm/This is the chart name/kubernetes/This is the chart name-1.0-KUBERNETES.tar", getProject()))
assertThat(new File(String.format("../%s/target/jkube/helm/the-chart-name/kubernetes/the-chart-name-1.0-KUBERNETES.tar", getProject()))
.exists(), equalTo(true));
final File helmDirectory = new File(
String.format("../%s/target/jkube/helm/This is the chart name/kubernetes", getProject()));
String.format("../%s/target/jkube/helm/the-chart-name/kubernetes", getProject()));
assertThat(new File(helmDirectory, "Chart.yaml"), yaml(allOf(
aMapWithSize(10),
hasEntry("apiVersion", "v1"),
hasEntry("name", "This is the chart name"),
hasEntry("name", "the-chart-name"),
hasEntry("version", "1.0-KUBERNETES"),
hasEntry("description", "Description different to that in the pom.xml"),
hasEntry("home", "https://www.home.example.com"),
Expand Down Expand Up @@ -173,7 +173,6 @@ void ocHelm() throws Exception {
void k8sHelmPush() throws Exception {
// Given
final Properties properties = properties(
"jkube.helm.chart", "the-chart-name",
"jkube.helm.stableRepository.type", "OCI",
"jkube.helm.stableRepository.name", "docker",
"jkube.helm.stableRepository.url", "oci://" + registry,
Expand All @@ -196,8 +195,7 @@ void k8sHelmPush() throws Exception {
void ocHelmPush() throws Exception {
// Given
final Properties properties = properties(
"jkube.helm.chart", "the-chart-name",
"jkube.helm.stableRepository.type", "OCI",
"jkube.helm.stableRepository.type", "OCI",
"jkube.helm.stableRepository.name", "docker",
"jkube.helm.stableRepository.url", "oci://" + registry,
"jkube.helm.stableRepository.username", "ignored",
Expand All @@ -207,7 +205,7 @@ void ocHelmPush() throws Exception {
final InvocationResult invocationResult = maven("oc:helm-push", properties);
// Then
assertInvocation(invocationResult);
assertThat(httpGet("http://" + registry + "/v2/the-chart-name/tags/list").body(),
containsString("{\"name\":\"the-chart-name\",\"tags\":[\"0.1-OC\"]}"));
assertThat(httpGet("http://" + registry + "/v2/different-name-for-oc/tags/list").body(),
containsString("{\"name\":\"different-name-for-oc\",\"tags\":[\"0.1-OC\"]}"));
}
}
2 changes: 1 addition & 1 deletion projects-to-be-tested/maven/spring/helm-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<artifactId>kubernetes-maven-plugin</artifactId>
<configuration>
<helm>
<chart>This is the chart name</chart>
<chart>the-chart-name</chart>
<chartExtension>tar</chartExtension>
<version>1.0-KUBERNETES</version>
<description>Description different to that in the pom.xml</description>
Expand Down

0 comments on commit 4afc8e6

Please sign in to comment.