Skip to content

Commit a26e3d1

Browse files
Merge branch 'main' into add-pod-disruption-budget
2 parents 2485b44 + 9bdd63f commit a26e3d1

File tree

7 files changed

+54
-16
lines changed

7 files changed

+54
-16
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"charts/platform": "0.7.0"
2+
"charts/platform": "0.7.1"
33
}

charts/platform/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.7.1](https://github.com/opentdf/charts/compare/platform-0.7.0...platform-v0.7.1) (2024-10-16)
4+
5+
6+
### Bug Fixes
7+
8+
* **ci:** Add public_client_id to server.auth config ([#89](https://github.com/opentdf/charts/issues/89)) ([6829c87](https://github.com/opentdf/charts/commit/6829c8783566a955bb76287bdd640a7b2507ebc8))
9+
* **core:** deprecate keycloak-from-config ([#81](https://github.com/opentdf/charts/issues/81)) ([da5a685](https://github.com/opentdf/charts/commit/da5a6856a0b14fcc6eab5810d4cf5a9518d68abe)), closes [#80](https://github.com/opentdf/charts/issues/80)
10+
* port naming/app protocol tls.enabled ([#90](https://github.com/opentdf/charts/issues/90)) ([613f67e](https://github.com/opentdf/charts/commit/613f67e860972dc8d27bf0fc6fb55daa89bf8b7a))
11+
312
## [0.7.0](https://github.com/opentdf/charts/compare/platform-0.6.2...platform-v0.7.0) (2024-08-20)
413

514

charts/platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.7.0
18+
version: 0.7.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/platform/templates/_helpers.tpl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,17 @@ This takes an array of three values:
132132
{{- end -}}
133133
{{- end -}}
134134

135-
{{- define "determine.appProtocol" -}}
135+
{{- define "platform.portName" -}}
136136
{{- if .Values.server.tls.enabled -}}
137+
https
138+
{{- else -}}
137139
http2
140+
{{- end -}}
141+
{{- end -}}
142+
143+
{{- define "determine.appProtocol" -}}
144+
{{- if .Values.server.tls.enabled -}}
145+
https
138146
{{- else -}}
139147
{{- if (include "isOpenshift" .) -}}
140148
h2c

charts/platform/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ spec:
4747
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4848
imagePullPolicy: {{ .Values.image.pullPolicy }}
4949
ports:
50-
- name: http2
50+
- name: {{ include "platform.portName" . }}
5151
containerPort: {{ .Values.server.port }}
5252
protocol: TCP
5353
{{ if not .Values.server.disableHealthChecks }}
5454
livenessProbe:
5555
httpGet:
5656
scheme: {{ if .Values.server.tls.enabled }}HTTPS{{ else }}HTTP{{ end }}
5757
path: /healthz
58-
port: http2
58+
port: {{ include "platform.portName" . }}
5959
readinessProbe:
6060
httpGet:
6161
scheme: {{ if .Values.server.tls.enabled }}HTTPS{{ else }}HTTP{{ end }}
6262
path: /healthz?service=all
63-
port: http2
63+
port: {{ include "platform.portName" . }}
6464
{{ end }}
6565
resources:
6666
{{- toYaml .Values.resources | nindent 12 }}

charts/platform/templates/service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ spec:
1010
type: {{ .Values.service.type }}
1111
ports:
1212
- port: {{ .Values.service.port }}
13-
targetPort: http2
13+
targetPort: {{ include "platform.portName" . }}
1414
appProtocol: {{ include "determine.appProtocol" . }}
1515
protocol: TCP
16-
name: http2
16+
name: {{ include "platform.portName" . }}
1717
selector:
1818
{{- include "chart.selectorLabels" . | nindent 4 }}

tests/chart_platform_template_test.go

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
package test
22

33
import (
4-
"path/filepath"
5-
"strings"
6-
"testing"
7-
84
"github.com/gruntwork-io/terratest/modules/helm"
95
"github.com/gruntwork-io/terratest/modules/k8s"
106
"github.com/gruntwork-io/terratest/modules/random"
117
"github.com/stretchr/testify/suite"
12-
"gopkg.in/yaml.v3"
8+
yaml3 "gopkg.in/yaml.v3"
139
appv1 "k8s.io/api/apps/v1"
1410
policyv1 "k8s.io/api/policy/v1"
1511
corev1 "k8s.io/api/core/v1"
1612
"k8s.io/apimachinery/pkg/util/intstr"
13+
"path/filepath"
14+
"strings"
15+
"testing"
1716
)
1817

1918
type PlatformChartTemplateSuite struct {
@@ -515,7 +514,7 @@ func (s *PlatformChartTemplateSuite) Test_Custom_Config_Template_Services_Merged
515514
helm.UnmarshalK8SYaml(s.T(), output, &cm)
516515

517516
var config map[string]interface{}
518-
s.Require().NoError(yaml.Unmarshal([]byte(cm.Data["opentdf.yaml"]), &config))
517+
s.Require().NoError(yaml3.Unmarshal([]byte(cm.Data["opentdf.yaml"]), &config))
519518

520519
s.Require().Equal(releaseName+"-platform", cm.Name)
521520

@@ -532,7 +531,7 @@ func (s *PlatformChartTemplateSuite) Test_Custom_Config_Template_Services_Merged
532531
s.Require().True(testServiceKeyFound)
533532
}
534533

535-
func (s *PlatformChartTemplateSuite) Test_TLS_Enabled_Expect_HTTP2_AppProtocol() {
534+
func (s *PlatformChartTemplateSuite) Test_TLS_Enabled_Expect_HTTPS_AppProtocol() {
536535
releaseName := "basic"
537536

538537
namespaceName := "opentdf-" + strings.ToLower(random.UniqueId())
@@ -549,7 +548,18 @@ func (s *PlatformChartTemplateSuite) Test_TLS_Enabled_Expect_HTTP2_AppProtocol()
549548
helm.UnmarshalK8SYaml(s.T(), output, &svc)
550549

551550
for _, port := range svc.Spec.Ports {
552-
s.Require().Equal("http2", *port.AppProtocol)
551+
s.Require().Equal("https", *port.AppProtocol)
552+
}
553+
554+
output = helm.RenderTemplate(s.T(), options, s.chartPath, releaseName, []string{"templates/deployment.yaml"})
555+
var deployment appv1.Deployment
556+
helm.UnmarshalK8SYaml(s.T(), output, &deployment)
557+
for _, container := range deployment.Spec.Template.Spec.Containers {
558+
for _, port := range container.Ports {
559+
s.Require().Equal("https", port.Name)
560+
}
561+
s.Require().Equal("https", container.ReadinessProbe.HTTPGet.Port.String())
562+
s.Require().Equal("https", container.LivenessProbe.HTTPGet.Port.String())
553563
}
554564
}
555565

@@ -569,6 +579,17 @@ func (s *PlatformChartTemplateSuite) Test_TLS_Disabled_Generic_K8S_Expect_K8S_H2
569579
for _, port := range svc.Spec.Ports {
570580
s.Require().Equal("kubernetes.io/h2c", *port.AppProtocol)
571581
}
582+
583+
output = helm.RenderTemplate(s.T(), options, s.chartPath, releaseName, []string{"templates/deployment.yaml"})
584+
var deployment appv1.Deployment
585+
helm.UnmarshalK8SYaml(s.T(), output, &deployment)
586+
for _, container := range deployment.Spec.Template.Spec.Containers {
587+
for _, port := range container.Ports {
588+
s.Require().Equal("http2", port.Name)
589+
}
590+
s.Require().Equal("http2", container.ReadinessProbe.HTTPGet.Port.String())
591+
s.Require().Equal("http2", container.LivenessProbe.HTTPGet.Port.String())
592+
}
572593
}
573594

574595
func (s *PlatformChartTemplateSuite) Test_TLS_Disabled_Openshift_Expect_H2C_AppProtocol() {

0 commit comments

Comments
 (0)