diff --git a/charts/library/common-test/Chart.yaml b/charts/library/common-test/Chart.yaml index e2e3229f027..6a637ad39c2 100644 --- a/charts/library/common-test/Chart.yaml +++ b/charts/library/common-test/Chart.yaml @@ -22,4 +22,4 @@ name: common-test sources: - https://github.com/truecharts/apps/tree/master/charts/library/common-test type: application -version: 3.1.3 +version: 3.1.4 diff --git a/charts/library/common-test/ci/basic-values-storage.yaml b/charts/library/common-test/ci/basic-values-storage.yaml deleted file mode 100644 index b6ca5fd37d7..00000000000 --- a/charts/library/common-test/ci/basic-values-storage.yaml +++ /dev/null @@ -1,64 +0,0 @@ -image: - repository: b4bz/homer - tag: latest - pullPolicy: IfNotPresent - -service: - main: - ports: - main: - port: 8080 - -ingress: - main: - enabled: true - - -persistence: - config: - enabled: true - mountPath: /config - type: emptyDir - accessMode: ReadWriteOnce - size: 1Gi - skipuninstall: false - - - -hostPathMounts: - - name: "hpmmountempty" - enabled: true - type: emptyDir - mountPath: "/test1" - hostPath: "" - readOnly: false - - name: "hpmmountnonempty" - enabled: true - emptyDir: - enabled: false - mountPath: "/test2" - hostPath: "/tmp" - readOnly: false - - name: "hpmmountpermissions" - enabled: true - setPermissions: true - emptyDir: - enabled: false - mountPath: "/test3" - hostPath: "/tmp" - readOnly: false - - enabled: true - setPermissions: true - emptyDir: - enabled: false - mountPath: "/test4" - hostPath: "/tmp" - readOnly: false - -probes: - liveness: - enabled: true - readiness: - enabled: true - startup: - enabled: true diff --git a/charts/library/common-test/ci/basic-values.yaml b/charts/library/common-test/ci/basic-values.yaml index c49a8db5008..801c5af3272 100644 --- a/charts/library/common-test/ci/basic-values.yaml +++ b/charts/library/common-test/ci/basic-values.yaml @@ -1,7 +1,7 @@ image: - repository: b4bz/homer - tag: latest@sha256:0f59f17700daccb51632372bcc20623f32b47f6cd0945c8c0b1f13608abc0045 + repository: traefik/whoami pullPolicy: IfNotPresent + tag: v1.6.1@sha256:16012fe4680ce69348d98627c7d42c1ea5ffde7bc4d66aaae426bd8d05af0d84 service: main: diff --git a/charts/library/common-test/values.yaml b/charts/library/common-test/values.yaml index df38299c949..04870f77a94 100644 --- a/charts/library/common-test/values.yaml +++ b/charts/library/common-test/values.yaml @@ -1,4 +1,14 @@ image: - repository: ghcr.io/truecharts/homer - tag: latest@sha256:afa37f010ca951421e688b81a7ff3ef3bd58afe3d839c3f0f0870fccac17dfe7 + repository: traefik/whoami pullPolicy: IfNotPresent + tag: v1.6.1@sha256:16012fe4680ce69348d98627c7d42c1ea5ffde7bc4d66aaae426bd8d05af0d84 + +args: + - --port + - '8080' + +service: + main: + ports: + main: + port: 8080 diff --git a/charts/library/common/templates/lib/controller/_autopermissions.yaml b/charts/library/common/templates/lib/controller/_autopermissions.yaml index b1925f897b5..5f1f364baf0 100644 --- a/charts/library/common/templates/lib/controller/_autopermissions.yaml +++ b/charts/library/common/templates/lib/controller/_autopermissions.yaml @@ -27,9 +27,9 @@ before chart installation. command: - "/bin/sh" - "-c" - - "echo 'Automatically correcting permissions...';{{ if .Values.addons.vpn.configFile }}chown -R 568:568 /vpn/vpn.conf; chmod -R g+w /vpn/vpn.conf;{{ end }}{{ range $_, $hpm := $hostPathMounts }}chown -R :{{ $group }} {{ $hpm.mountPath | squote }}; chmod -R g+w {{ $hpm.mountPath | squote }};{{ end }}" + - "echo 'Automatically correcting permissions...';{{ if and ( .Values.addons.vpn.configFile.enabled ) ( not ( eq .Values.addons.vpn.type "disabled" )) }}chown -R 568:568 /vpn/vpn.conf; chmod -R g+w /vpn/vpn.conf;{{ end }}{{ range $_, $hpm := $hostPathMounts }}chown -R :{{ $group }} {{ $hpm.mountPath | squote }}; chmod -R g+w {{ $hpm.mountPath | squote }};{{ end }}" volumeMounts: - {{- if .Values.addons.vpn.configFile }} + {{- if and ( .Values.addons.vpn.configFile.enabled ) ( not ( eq .Values.addons.vpn.type "disabled" )) }} - name: vpnconfig mountPath: /vpn/vpn.conf {{- end }} diff --git a/charts/library/common/tests/container_test.go b/charts/library/common/tests/container_test.go index f6893099e3e..bc3799ea17d 100644 --- a/charts/library/common/tests/container_test.go +++ b/charts/library/common/tests/container_test.go @@ -63,7 +63,7 @@ func (suite *ContainerTestSuite) TestArgs() { values []string expectedArgs []string }{ - "Default": {values: nil, expectedArgs: nil}, + "Default": {values: nil, expectedArgs: []string{"--port","8080"}}, "SingleString": {values: []string{"args=sleep infinity"}, expectedArgs: []string{"sleep infinity"}}, "StringList": {values: []string{"args={sleep,infinity}"}, expectedArgs: []string{"sleep", "infinity"}}, } @@ -115,7 +115,7 @@ func (suite *ContainerTestSuite) TestEnv() { }, expectedEnv: map[string]string{ "DYN_ENV": "common-test-admin", - "S6_READ_ONLY_ROOT": "1", " + "S6_READ_ONLY_ROOT": "1", "STATIC_ENV": "value_of_env", "STATIC_EXPLICIT_ENV_FROM": "spec.nodeName", "STATIC_IMPLICIT_ENV_FROM": "spec.nodeName", @@ -201,11 +201,11 @@ func (suite *ContainerTestSuite) TestPorts() { expectedPort int expectedProtocol string }{ - "Default": {values: nil, expectedPortName: "main", expectedPort: 0, expectedProtocol: "TCP"}, + "Default": {values: nil, expectedPortName: "main", expectedPort: 8080, expectedProtocol: "TCP"}, "CustomName": {values: []string{"service.main.ports.main.enabled=false", "service.main.ports.server.enabled=true", "service.main.ports.server.port=8080"}, expectedPortName: "server", expectedPort: 8080, expectedProtocol: "TCP"}, - "ProtocolHTTP": {values: []string{"service.main.ports.main.protocol=HTTP"}, expectedPortName: "main", expectedPort: 0, expectedProtocol: "TCP"}, - "ProtocolHTTPS": {values: []string{"service.main.ports.main.protocol=HTTP"}, expectedPortName: "main", expectedPort: 0, expectedProtocol: "TCP"}, - "ProtocolUDP": {values: []string{"service.main.ports.main.protocol=UDP"}, expectedPortName: "main", expectedPort: 0, expectedProtocol: "UDP"}, + "ProtocolHTTP": {values: []string{"service.main.ports.main.protocol=HTTP"}, expectedPortName: "main", expectedPort: 8080, expectedProtocol: "TCP"}, + "ProtocolHTTPS": {values: []string{"service.main.ports.main.protocol=HTTP"}, expectedPortName: "main", expectedPort: 8080, expectedProtocol: "TCP"}, + "ProtocolUDP": {values: []string{"service.main.ports.main.protocol=UDP"}, expectedPortName: "main", expectedPort: 8080, expectedProtocol: "UDP"}, } for name, tc := range tests { suite.Suite.Run(name, func() { @@ -223,7 +223,7 @@ func (suite *ContainerTestSuite) TestPorts() { suite.Assertions.EqualValues(tc.expectedProtocol, containerPorts[0].Path("protocol").Data()) if tc.expectedPort == 0 { - suite.Assertions.Empty(containerPorts[0].Path("containerPort").Data()) + suite.Assertions.Empty(containerPorts[8080].Path("containerPort").Data()) } else { suite.Assertions.EqualValues(tc.expectedPort, containerPorts[0].Path("containerPort").Data()) } diff --git a/charts/library/common/tests/ingress_test.go b/charts/library/common/tests/ingress_test.go index 1bde938e096..88ce4d0a97e 100644 --- a/charts/library/common/tests/ingress_test.go +++ b/charts/library/common/tests/ingress_test.go @@ -110,6 +110,7 @@ func (suite *IngressTestSuite) TestPathServices() { "Default": { values: []string{"ingress.main.enabled=true"}, expectedServiceName: "common-test", + expectedServicePort: 8080, }, "CustomService": { values: []string{ diff --git a/charts/library/common/tests/persistentvolumeclaim_test.go b/charts/library/common/tests/persistentvolumeclaim_test.go index 0b1d8696c08..9060d07ec84 100644 --- a/charts/library/common/tests/persistentvolumeclaim_test.go +++ b/charts/library/common/tests/persistentvolumeclaim_test.go @@ -81,7 +81,7 @@ func (suite *PersistenceVolumeClaimTestSuite) TestMetaData() { "app.kubernetes.io/managed-by": "Helm", "app.kubernetes.io/name": "common-test", "app.kubernetes.io/version":"latest", - "helm.sh/chart": "common-test-3.1.3", + "helm.sh/chart": "common-test-3.1.4", } tests := map[string]struct {