Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mozcloud-ingress/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.1
version: 0.5.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -25,5 +25,5 @@ appVersion: 0.4.2

dependencies:
- name: mozcloud-ingress-lib
version: 0.6.1
version: 0.6.2
repository: file://../library
6 changes: 3 additions & 3 deletions mozcloud-ingress/application/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mozcloud-ingress

![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart that creates ingress and supporting resources

Expand All @@ -19,7 +19,7 @@ version: 0.1.0
type: application
dependencies:
- name: mozcloud-ingress
version: ~0.5.1
version: ~0.5.2
repository: oci://us-west1-docker.pkg.dev/moz-fx-platform-artifacts/mozcloud-charts
```

Expand All @@ -35,7 +35,7 @@ Next, update your tenant's values. Shared charts are meant to be self-documented

| Repository | Name | Version |
|------------|------|---------|
| file://../library | mozcloud-ingress-lib | 0.6.1 |
| file://../library | mozcloud-ingress-lib | 0.6.2 |

## Values

Expand Down
2 changes: 1 addition & 1 deletion mozcloud-ingress/library/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.1
version: 0.6.2

dependencies:
- name: mozcloud-labels-lib
Expand Down
4 changes: 2 additions & 2 deletions mozcloud-ingress/library/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mozcloud-ingress-lib

![Version: 0.6.1](https://img.shields.io/badge/Version-0.6.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
![Version: 0.6.2](https://img.shields.io/badge/Version-0.6.2-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

A library chart that creates ingress and supporting resources

Expand All @@ -19,7 +19,7 @@ version: 0.1.0
type: application
dependencies:
- name: mozcloud-ingress-lib
version: ~0.6.1
version: ~0.6.2
repository: oci://us-west1-docker.pkg.dev/moz-fx-platform-artifacts/mozcloud-charts
```

Expand Down
6 changes: 3 additions & 3 deletions mozcloud-ingress/library/templates/_ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ metadata:
networking.gke.io/v1beta1.FrontendConfig: {{ $ingress.name }}
{{- end }}
spec:
{{- if and (eq (len $ingress.hosts) 1) (eq (len (first $ingress.hosts).paths) 1) }}
{{- if and (eq $provider "gke") (eq (len $ingress.hosts) 1) (eq (len (first $ingress.hosts).paths) 1) }}
{{- range $host := $ingress.hosts }}
{{- range $path := $host.paths }}
{{- $backend := mergeOverwrite $backend_defaults (default (dict) $path.backend.config) }}
Expand Down Expand Up @@ -65,11 +65,11 @@ spec:
pathType: {{ $path.pathType }}
backend:
service:
{{- $params := dict "backendConfig" $backend "backendService" $backend_service "ingressConfig" }}
{{- $params := dict "backendConfig" $backend "backendService" $backend_service "ingressConfig" $ingress }}
{{- if $name_override }}
{{- $_ := set $params "nameOverride" $name_override }}
{{- end }}
name: {{ include "mozcloud-ingress-lib.config.service.name" $params }}
name: {{ include "mozcloud-ingress-lib.config.backend.name" $params }}
port:
number: {{ $backend_service.port }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions mozcloud/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v2
name: mozcloud
description: Opinionated application chart used to deploy MozCloud Kubernetes
resources supporting resources
version: 0.13.2
version: 0.13.3
type: application
dependencies:
- name: mozcloud-gateway-lib
version: 0.5.0
repository: file://../../mozcloud-gateway/library
- name: mozcloud-ingress-lib
version: 0.6.1
version: 0.6.2
repository: file://../../mozcloud-ingress/library
- name: mozcloud-labels-lib
version: 0.3.16
Expand Down
6 changes: 3 additions & 3 deletions mozcloud/application/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mozcloud

![Version: 0.13.2](https://img.shields.io/badge/Version-0.13.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.13.3](https://img.shields.io/badge/Version-0.13.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Opinionated application chart used to deploy MozCloud Kubernetes resources supporting resources

Expand All @@ -19,7 +19,7 @@ version: 0.1.0
type: application
dependencies:
- name: mozcloud
version: ~0.13.2
version: ~0.13.3
repository: oci://us-west1-docker.pkg.dev/moz-fx-platform-artifacts/mozcloud-charts
```

Expand All @@ -36,7 +36,7 @@ Next, update your tenant's values. Shared charts are meant to be self-documented
| Repository | Name | Version |
|------------|------|---------|
| file://../../mozcloud-gateway/library | mozcloud-gateway-lib | 0.5.0 |
| file://../../mozcloud-ingress/library | mozcloud-ingress-lib | 0.6.1 |
| file://../../mozcloud-ingress/library | mozcloud-ingress-lib | 0.6.2 |
| file://../../mozcloud-labels/library | mozcloud-labels-lib | 0.3.16 |

## Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ Configuration matches entire snapshot:
realm: nonprod
name: test-service
spec:
defaultBackend:
service:
name: test-service
port:
number: 8080
rules:
- host: test-service.dev.test-domain.com
http:
paths:
- backend:
service:
name: test-service
port:
number: 8080
path: /
pathType: Prefix
2: |
apiVersion: v1
kind: Service
Expand Down
39 changes: 26 additions & 13 deletions mozcloud/application/tests/preview-all-resources_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ tests:
- it: Top-level ConfigMap is prefixed with PR number
template: configmap/configmap.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-config")]
path: metadata.name
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing for me locally unless it was set like this. No idea.

value: pr789-app-config
asserts:
- equal:
path: metadata.name
Expand All @@ -41,7 +42,8 @@ tests:
- it: Top-level ServiceAccount is prefixed with PR number
template: serviceaccount/serviceaccount.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-service-account")]
path: metadata.name
value: pr789-app-service-account
asserts:
- equal:
path: metadata.name
Expand All @@ -51,7 +53,8 @@ tests:
- it: Default ServiceAccount is prefixed with PR number
template: serviceaccount/serviceaccount.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-mozcloud-test")]
path: metadata.name
value: pr789-mozcloud-test
asserts:
- equal:
path: metadata.name
Expand All @@ -61,7 +64,8 @@ tests:
- it: Top-level ExternalSecret is prefixed with PR number
template: externalsecret/externalsecret.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-external-secret")]
path: metadata.name
value: pr789-app-external-secret
asserts:
- equal:
path: metadata.name
Expand All @@ -71,7 +75,8 @@ tests:
- it: Default ExternalSecret is prefixed with PR number
template: externalsecret/externalsecret.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-test-chart-secrets")]
path: metadata.name
value: pr789-test-chart-secrets
asserts:
- equal:
path: metadata.name
Expand Down Expand Up @@ -113,7 +118,8 @@ tests:
- it: Deployment is prefixed with PR number
template: workload/deployment.yaml
documentSelector:
path: $[?(@.kind == "Deployment")]
path: $[?(@.kind == "Deployment")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: metadata.name
Expand All @@ -123,7 +129,8 @@ tests:
- it: Service is prefixed with PR number
template: gateway/backend.yaml
documentSelector:
path: $[?(@.kind == "Service")]
path: $[?(@.kind == "Service")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: metadata.name
Expand All @@ -133,7 +140,8 @@ tests:
- it: HTTPRoute has correct preview hostname
template: preview/httpRoute.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-api-host")]
path: metadata.name
value: pr789-api-host
asserts:
- contains:
path: spec.hostnames
Expand All @@ -143,7 +151,8 @@ tests:
- it: HTTPRoute routes to prefixed service
template: preview/httpRoute.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-api-host")]
path: metadata.name
value: pr789-api-host
asserts:
- equal:
path: spec.rules[0].backendRefs[0].name
Expand Down Expand Up @@ -171,7 +180,8 @@ tests:
- it: Workload container secretRef should reference prefixed secret
template: workload/deployment.yaml
documentSelector:
path: $[?(@.kind == "Deployment")]
path: $[?(@.kind == "Deployment")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: spec.template.spec.containers[?(@.name=="app")].envFrom[1].secretRef.name
Expand All @@ -181,7 +191,8 @@ tests:
- it: Workload container configMapRef should reference prefixed ConfigMap
template: workload/deployment.yaml
documentSelector:
path: $[?(@.kind == "Deployment")]
path: $[?(@.kind == "Deployment")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: spec.template.spec.containers[?(@.name=="app")].envFrom[0].configMapRef.name
Expand All @@ -191,7 +202,8 @@ tests:
- it: Workload container user-defined secretRef should reference prefixed ExternalSecret
template: workload/deployment.yaml
documentSelector:
path: $[?(@.kind == "Deployment")]
path: $[?(@.kind == "Deployment")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: spec.template.spec.containers[?(@.name=="app")].envFrom[2].secretRef.name
Expand All @@ -201,7 +213,8 @@ tests:
- it: Workload serviceAccountName should reference prefixed ServiceAccount
template: workload/deployment.yaml
documentSelector:
path: $[?(@.kind == "Deployment")]
path: $[?(@.kind == "Deployment")].metadata.name
value: pr789-api-service
asserts:
- equal:
path: spec.template.spec.serviceAccountName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ tests:
- it: URLBASE is transformed when empty and explicitly listed
template: configmap/configmap.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-config")]
path: metadata.name
value: pr789-app-config
asserts:
- equal:
path: data.URLBASE
Expand All @@ -31,7 +32,8 @@ tests:
- it: ATTACHMENT_BASE is transformed when empty and explicitly listed
template: configmap/configmap.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-config")]
path: metadata.name
value: pr789-app-config
asserts:
- equal:
path: data.ATTACHMENT_BASE
Expand All @@ -41,7 +43,8 @@ tests:
- it: URL_BASE is not transformed when not in urlTransformKeys list
template: configmap/configmap.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-config")]
path: metadata.name
value: pr789-app-config
asserts:
- equal:
path: data.URL_BASE
Expand All @@ -51,7 +54,8 @@ tests:
- it: Non-empty values are not overwritten
template: configmap/configmap.yaml
documentSelector:
path: $[?(@.metadata.name == "pr789-app-config")]
path: metadata.name
value: pr789-app-config
asserts:
- equal:
path: data.OTHER_VAR
Expand Down
Loading
Loading