mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-23 15:39:02 +00:00
parent
28118894f7
commit
61028541f1
@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.2.1]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Made explicit that `service.port.targetPort` cannot be a named port.
|
||||||
|
|
||||||
## [2.2.0]
|
## [2.2.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@ -53,6 +59,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
This is the last version before starting this changelog. All sorts of cool stuff was changed, but only `git log` remembers what that was :slightly_frowning_face:
|
This is the last version before starting this changelog. All sorts of cool stuff was changed, but only `git log` remembers what that was :slightly_frowning_face:
|
||||||
|
|
||||||
|
[2.2.1]: https://github.com/k8s-at-home/charts/tree/common-2.2.1/charts/common
|
||||||
|
|
||||||
[2.2.0]: https://github.com/k8s-at-home/charts/tree/common-2.2.0/charts/common
|
[2.2.0]: https://github.com/k8s-at-home/charts/tree/common-2.2.0/charts/common
|
||||||
|
|
||||||
[2.1.0]: https://github.com/k8s-at-home/charts/tree/common-2.1.0/charts/common
|
[2.1.0]: https://github.com/k8s-at-home/charts/tree/common-2.1.0/charts/common
|
||||||
|
@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
name: common
|
name: common
|
||||||
description: Function library for k8s-at-home charts
|
description: Function library for k8s-at-home charts
|
||||||
type: library
|
type: library
|
||||||
version: 2.2.0
|
version: 2.2.1
|
||||||
keywords:
|
keywords:
|
||||||
- k8s-at-home
|
- k8s-at-home
|
||||||
- common
|
- common
|
||||||
|
@ -32,6 +32,9 @@ Ports included by the controller.
|
|||||||
ports:
|
ports:
|
||||||
{{- range $_ := $ports }}
|
{{- range $_ := $ports }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
|
{{- if and .targetPort (kindIs "string" .targetPort) }}
|
||||||
|
{{- fail (printf "Our charts do not support named ports for targetPort. (port name %s, targetPort %s)" .name .targetPort) }}
|
||||||
|
{{- end }}
|
||||||
containerPort: {{ .targetPort | default .port }}
|
containerPort: {{ .targetPort | default .port }}
|
||||||
protocol: {{ .protocol | default "TCP" }}
|
protocol: {{ .protocol | default "TCP" }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -107,8 +107,9 @@ service:
|
|||||||
## name defaults to http
|
## name defaults to http
|
||||||
name:
|
name:
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
## targetPort defaults to the service name. If targetPort is specified, this port number
|
## Specify a service targetPort if you wish to differ the service port from the application port.
|
||||||
## is used in the container definition instead of service.port.port.
|
## If targetPort is specified, this port number is used in the container definition instead of
|
||||||
|
## service.port.port. Therefore named ports are not supported for this field.
|
||||||
targetPort:
|
targetPort:
|
||||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||||
|
@ -81,6 +81,21 @@ class Test < ChartTest
|
|||||||
jq('.spec.template.spec.containers[0].ports[0].containerPort', resource('Deployment')).must_equal values[:service][:port][:targetPort]
|
jq('.spec.template.spec.containers[0].ports[0].containerPort', resource('Deployment')).must_equal values[:service][:port][:targetPort]
|
||||||
jq('.spec.template.spec.containers[0].ports[0].name', resource('Deployment')).must_equal default_name
|
jq('.spec.template.spec.containers[0].ports[0].name', resource('Deployment')).must_equal default_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'targetPort cannot be a named port' do
|
||||||
|
values = {
|
||||||
|
service: {
|
||||||
|
port: {
|
||||||
|
targetPort: 'test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chart.value values
|
||||||
|
exception = assert_raises HelmCompileError do
|
||||||
|
chart.execute_helm_template!
|
||||||
|
end
|
||||||
|
assert_match("Our charts do not support named ports for targetPort. (port name #{default_name}, targetPort #{values[:service][:port][:targetPort]})", exception.message)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user