Skip to content

Commit

Permalink
tests and releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ranchodeluxe committed Nov 22, 2023
1 parent b669ec2 commit 3b66fb0
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
release:
if: github.actor == 'ranchodeluxe' || github.actor == 'gcorradini'
if: github.actor == 'ranchodeluxe' || github.actor == 'gcorradini' || github.actor == 'sunu'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions helm-chart/eoapi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version numbers below correspond to helm chart `appVersion`: see `./helm-chart/eoapi/Chart.yaml`
---
### 0.2.10 (2023-11-22)

* give `ingress.className == "nginx"` the ability pass hosts and tls information
* more tests to give user feedback about the above functionality if the wrong `ingress.className` was given

### 0.2.9 (2023-10-25)

* removed `providerContext` and any support for minikube from the templates so this is a breaking change
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/eoapi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ kubeVersion: ">=1.23.0-0"
# 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.1.11"
version: "0.1.12"

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.9"
appVersion: "0.2.10"
25 changes: 21 additions & 4 deletions helm-chart/eoapi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,25 @@ values.schema.json doesn't play nice combined value checks
so we use this helper function to check autoscaling rules
*/}}
{{- define "eoapi.validateAutoscaleRules" -}}
{{- if and .Values.ingress.enabled (ne .Values.ingress.className "nginx") (or (.Values.raster.autoscaling.enabled) (.Values.stac.autoscaling.enabled) (.Values.vector.autoscaling.enabled)) }}
{{- fail "When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'requestRate' at this time b/c it's soley an nginx metric" }}
{{- end }}
{{- end -}}
{{- if and .Values.ingress.enabled (ne .Values.ingress.className "nginx") }}
{{/* "requestRate" cannot be enabled for any service if not "nginx" so give feedback and fail */}}
{{- if (or
(and .Values.raster.autoscaling.enabled (eq .Values.raster.autoscaling.type "requestRate"))
(and .Values.stac.autoscaling.enabled (eq .Values.stac.autoscaling.type "requestRate"))
(and .Values.vector.autoscaling.enabled (eq .Values.vector.autoscaling.type "requestRate"))
) }}
{{- fail "When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'requestRate' at this time b/c it's solely an nginx metric" }}
{{- end }}
{{/* "host" has to be empty if not "nginx" so give feedback and fail */}}
{{- if .Values.ingress.host }}
{{- fail "When using an 'ingress.className' other than 'nginx' you cannot provision a 'host' at this time" }}
{{- end }}
{{/* "tls" cannot be enabled if not "nginx" so give feedback and fail */}}
{{- if .Values.ingress.tls.enabled }}
{{- fail "When using an 'ingress.className' other than 'nginx' you cannot enable 'tls' at this time" }}
{{- end }}
{{- end }} {{/* if and .Values.ingress.enabled (ne .Values.ingress.className "nginx") /*}}
{{- end -}} {{/* define */}}
24 changes: 24 additions & 0 deletions helm-chart/eoapi/tests/autoscaling_feedback_alb_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
suite: autoscaling feedback when className is alb
templates:
- templates/services/ingress-alb.yaml
tests:
- it: "fail for ingress.host"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
ingress.className: "alb"
ingress.host: "abcd.eoapi.com"
asserts:
- failedTemplate:
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot provision a 'host' at this time
- it: "fail for ingress.tls.enabled"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
ingress.className: "alb"
ingress.tls.enabled: true
asserts:
- failedTemplate:
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot enable 'tls' at this time
24 changes: 24 additions & 0 deletions helm-chart/eoapi/tests/autoscaling_feedback_gce_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
suite: autoscaling feedback when className is gce
templates:
- templates/services/ingress-gce.yaml
tests:
- it: "fail for ingress.host"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
ingress.className: "gce"
ingress.host: "abcd.eoapi.com"
asserts:
- failedTemplate:
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot provision a 'host' at this time
- it: "fail for ingress.tls.enabled"
set:
raster.enabled: false
stac.enabled: false
vector.enabled: false
ingress.className: "gce"
ingress.tls.enabled: true
asserts:
- failedTemplate:
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot enable 'tls' at this time
7 changes: 4 additions & 3 deletions helm-chart/eoapi/tests/hpa_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
suite: service defaults deployment
suite: autoscaling feedback when className is not nginx
templates:
- templates/services/hpa.yaml
tests:
- it: "vector hpa fail state"
- it: "vector hpa fail for requestRate"
set:
raster.enabled: false
stac.enabled: false
Expand All @@ -11,4 +11,5 @@ tests:
vector.autoscaling.enabled: true
asserts:
- failedTemplate:
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'requestRate' at this time b/c it's soley an nginx metric
errorMessage: When using an 'ingress.className' other than 'nginx' you cannot enable autoscaling by 'requestRate' at this time b/c it's solely an nginx metric

0 comments on commit 3b66fb0

Please sign in to comment.