diff --git a/.github/workflows/main-pr.yaml b/.github/workflows/main-pr.yaml index fc40e20b5..73459f533 100644 --- a/.github/workflows/main-pr.yaml +++ b/.github/workflows/main-pr.yaml @@ -20,6 +20,11 @@ jobs: with: fetch-depth: 0 + - name: setup golang + uses: actions/setup-go@v3 + with: + go-version: '^1.20' + - name: Set up Helm uses: azure/setup-helm@v3 with: @@ -32,10 +37,8 @@ jobs: with: python-version: "3.11" - - name: Run kube-linter - uses: stackrox/kube-linter-action@v1 - with: - directory: charts/kong + - name: Run linters + run: make lint - name: Set up chart-testing uses: helm/chart-testing-action@v2.3.1 diff --git a/Makefile b/Makefile index c153a1c1f..b50bae5ae 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,3 @@ -# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) -ifeq (,$(shell go env GOBIN)) -GOBIN=$(shell go env GOPATH)/bin -else -GOBIN=$(shell go env GOBIN) -endif - PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) .PHONY: _download_tool @@ -21,8 +14,13 @@ kube-linter: @$(MAKE) _download_tool TOOL=kube-linter .PHONY: lint -lint: ./scripts/* +lint: tools lint.charts.kong lint.shellcheck + +.PHONY: lint.charts.kong +lint.charts.kong: + $(KUBE_LINTER) lint charts/kong + +lint.shellcheck: ./scripts/* @for script in $^ ; do \ shellcheck $${script} ; \ done - $(KUBE_LINTER) lint charts/kong diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index cd1ad58f0..b7cd466c6 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +### Under the hood + +* Add kube-linter to the CI pipeline to ensure produced manifests comply + with community best practices. + [#751](https://github.com/Kong/charts/pull/751) + +## 2.16.5 + +* Fix autoscaling version detection. + [#744](https://github.com/Kong/charts/pull/744) * Don't include a clear-stale-pid initContainer when kong gateway is not enabled in the deployment. [#744](https://github.com/Kong/charts/pull/744) diff --git a/charts/kong/Chart.yaml b/charts/kong/Chart.yaml index b0f824d96..0f3835c25 100644 --- a/charts/kong/Chart.yaml +++ b/charts/kong/Chart.yaml @@ -11,7 +11,7 @@ maintainers: name: kong sources: - https://github.com/Kong/charts/tree/main/charts/kong -version: 2.16.4 +version: 2.16.5 appVersion: "3.1" dependencies: - name: postgresql diff --git a/charts/kong/templates/hpa.yaml b/charts/kong/templates/hpa.yaml index 5350660d2..922ade82d 100644 --- a/charts/kong/templates/hpa.yaml +++ b/charts/kong/templates/hpa.yaml @@ -17,10 +17,10 @@ spec: behavior: {{- toYaml .Values.autoscaling.behavior | nindent 4 }} {{- end }} - {{- if not (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} - targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage | default 80 }} - {{- else }} + {{- if contains "autoscaling/v2" (include "kong.autoscalingVersion" . ) }} metrics: {{- toYaml .Values.autoscaling.metrics | nindent 4 }} + {{- else }} + targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage | default 80 }} {{- end }} {{- end }}