mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release library 3.7.0 (#377)
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com> Co-authored-by: Patrick Collins <Patricol@users.noreply.github.com> Co-authored-by: Patrick Collins <patrick.collins@gainbridge.io> Co-authored-by: Lawrence Gil <larrywtf609@gmail.com> Co-authored-by: solidDoWant <fred.heinecke@yahoo.com>
This commit is contained in:
parent
aee0d999ba
commit
8b33237e27
32 changed files with 793 additions and 655 deletions
|
@ -6,18 +6,16 @@ templates:
|
|||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
- it: default metadata
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
documentSelector: &ServiceSelector
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
notExists:
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
|
@ -26,7 +24,7 @@ tests:
|
|||
app.kubernetes.io/service: RELEASE-NAME
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
- it: custom metadata
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -36,17 +34,13 @@ tests:
|
|||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
|
@ -56,7 +50,7 @@ tests:
|
|||
helm.sh/chart: common-test-1.0.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
- it: custom metadata with global metadata
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -71,18 +65,14 @@ tests:
|
|||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
|
|
|
@ -6,49 +6,42 @@ templates:
|
|||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
- it: default name
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME
|
||||
|
||||
- it: custom name suffix should pass
|
||||
- it: custom name suffix
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.nameOverride: http
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME-http
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- exists:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-http
|
||||
|
||||
- it: custom name suffix with template should pass
|
||||
- it: custom name suffix with template
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.nameOverride: "{{ .Release.Name }}"
|
||||
service.main.nameOverride: "{{ .Chart.Name }}"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- exists:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME
|
||||
|
||||
- it: multiple should pass
|
||||
- it: multiple services
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -59,19 +52,13 @@ tests:
|
|||
ui:
|
||||
port: 8082
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &ServiceDocumentFirst 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocumentFirst
|
||||
equal:
|
||||
path: metadata.name
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME-main
|
||||
- documentIndex: &ServiceDocumentSecond 2
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocumentSecond
|
||||
equal:
|
||||
exists:
|
||||
path: metadata.name
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME-second
|
||||
exists:
|
||||
path: metadata.name
|
||||
|
|
|
@ -6,89 +6,91 @@ templates:
|
|||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
- it: default should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
documentSelector: &ServiceSelector
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
|
||||
- it: explicit TCP should pass
|
||||
- it: explicit TCP should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.http.protocol: TCP
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
|
||||
- it: explicit UDP should pass
|
||||
- it: explicit UDP should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.http.protocol: UDP
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: UDP
|
||||
|
||||
- it: explicit HTTP should pass
|
||||
- it: explicit HTTP should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.http.protocol: HTTP
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
- documentIndex: *ServiceDocument
|
||||
notExists:
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
|
||||
- it: explicit HTTPS should pass
|
||||
- it: explicit HTTPS should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.http.protocol: HTTPS
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
|
||||
- it: explicit appProtocol should pass
|
||||
- it: explicit appProtocol should render
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.http.appProtocol: kubernetes.io/h2c
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0].appProtocol
|
||||
value: kubernetes.io/h2c
|
||||
|
||||
- it: mixed protocols can be configured on the same port number
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service.main.ports.udptest:
|
||||
port: 8081
|
||||
protocol: UDP
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ports
|
||||
value:
|
||||
- name: http
|
||||
port: 8081
|
||||
protocol: TCP
|
||||
targetPort: 8081
|
||||
- name: udptest
|
||||
port: 8081
|
||||
protocol: UDP
|
||||
targetPort: 8081
|
||||
|
|
|
@ -9,14 +9,11 @@ tests:
|
|||
- it: default should pass
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
documentSelector: &ServiceSelector
|
||||
path: $[?(@.kind == "Service")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: http
|
||||
|
@ -36,12 +33,9 @@ tests:
|
|||
server:
|
||||
enabled: true
|
||||
port: 8080
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: server
|
||||
|
@ -59,12 +53,9 @@ tests:
|
|||
http:
|
||||
enabled: true
|
||||
targetPort: 80
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: http
|
||||
|
|
|
@ -15,17 +15,16 @@ tests:
|
|||
ports:
|
||||
first:
|
||||
port: 80
|
||||
documentSelector: &ServiceSelector
|
||||
path: kind
|
||||
value: Service
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &FirstServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *FirstServiceDocument
|
||||
notExists:
|
||||
path: spec.allocateLoadBalancerNodePorts
|
||||
- containsDocument:
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
name: RELEASE-NAME
|
||||
|
||||
- it: services can be disabled
|
||||
- it: service not present when disabled
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -33,13 +32,13 @@ tests:
|
|||
main:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- not: true
|
||||
containsDocument:
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
name: RELEASE-NAME
|
||||
|
||||
- it: externalTrafficPolicy should pass for NodePort service
|
||||
- it: externalTrafficPolicy can be configured for NodePort service
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -47,32 +46,26 @@ tests:
|
|||
main:
|
||||
type: NodePort
|
||||
externalTrafficPolicy: Local
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.externalTrafficPolicy
|
||||
value: Local
|
||||
|
||||
- it: internalTrafficPolicy should pass
|
||||
- it: internalTrafficPolicy can be configured
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
internalTrafficPolicy: Local
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.internalTrafficPolicy
|
||||
value: Local
|
||||
|
||||
- it: externalTrafficPolicy should pass for LoadBalancer service
|
||||
- it: externalTrafficPolicy can be configured for LoadBalancer service
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -80,12 +73,9 @@ tests:
|
|||
main:
|
||||
type: LoadBalancer
|
||||
externalTrafficPolicy: Local
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.externalTrafficPolicy
|
||||
value: Local
|
||||
|
||||
|
@ -97,12 +87,9 @@ tests:
|
|||
main:
|
||||
type: LoadBalancer
|
||||
allocateLoadBalancerNodePorts: true
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.allocateLoadBalancerNodePorts
|
||||
value: true
|
||||
|
||||
|
@ -114,16 +101,13 @@ tests:
|
|||
main:
|
||||
type: LoadBalancer
|
||||
allocateLoadBalancerNodePorts: false
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.allocateLoadBalancerNodePorts
|
||||
value: false
|
||||
|
||||
- it: externalName should pass for ExternalName service
|
||||
- it: externalName can be configured for ExternalName service
|
||||
values:
|
||||
- ../_values/service_main_default.yaml
|
||||
set:
|
||||
|
@ -131,11 +115,8 @@ tests:
|
|||
main:
|
||||
type: ExternalName
|
||||
externalName: my.database.example.com
|
||||
documentSelector: *ServiceSelector
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.externalName
|
||||
value: my.database.example.com
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue