fix indentation

This commit is contained in:
Stavros kois
2023-02-06 16:55:39 +02:00
parent 51d81f57ce
commit e6fcf345ca
12 changed files with 71 additions and 56 deletions

View File

@@ -37,14 +37,15 @@ tests:
value:
type: ClusterIP
publishNotReadyAddresses: false
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
targetPort: 12345
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload
- it: should pass with type ClusterIP and available options set
set:
@@ -110,10 +111,7 @@ tests:
sessionAffinityConfig:
clientIP:
timeoutSeconds: 100
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
@@ -122,3 +120,7 @@ tests:
port: 12344
protocol: TCP
targetPort: 12346
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload

View File

@@ -31,10 +31,7 @@ tests:
path: spec
value:
publishNotReadyAddresses: false
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
@@ -87,10 +84,7 @@ tests:
sessionAffinityConfig:
clientIP:
timeoutSeconds: 100
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP

View File

@@ -33,10 +33,7 @@ tests:
type: ExternalName
externalName: my-external-name
publishNotReadyAddresses: false
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
@@ -96,10 +93,7 @@ tests:
sessionAffinityConfig:
clientIP:
timeoutSeconds: 100
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP

View File

@@ -37,14 +37,15 @@ tests:
value:
type: LoadBalancer
publishNotReadyAddresses: false
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
targetPort: 12345
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload
- it: should pass with type LoadBalancer and available options set
set:
@@ -122,10 +123,7 @@ tests:
sessionAffinityConfig:
clientIP:
timeoutSeconds: 100
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
@@ -134,3 +132,7 @@ tests:
port: 12344
protocol: TCP
targetPort: 12346
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload

View File

@@ -122,7 +122,7 @@ tests:
of: Service
- documentIndex: *serviceDoc
equal:
path: selector
path: spec.selector
value:
pod.name: my-workload
app.kubernetes.io/name: common-test
@@ -155,7 +155,7 @@ tests:
of: Service
- documentIndex: *serviceDoc
equal:
path: selector
path: spec.selector
value:
pod.name: my-workload
app.kubernetes.io/name: common-test

View File

@@ -38,15 +38,16 @@ tests:
value:
type: NodePort
publishNotReadyAddresses: false
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
targetPort: 12345
nodePort: 30000
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload
- it: should pass with type NodePort and available options set
set:
@@ -117,10 +118,7 @@ tests:
sessionAffinityConfig:
clientIP:
timeoutSeconds: 100
- documentIndex: *serviceDoc
equal:
path: ports
value:
ports:
- name: port-name
port: 12345
protocol: TCP
@@ -131,3 +129,7 @@ tests:
protocol: TCP
targetPort: 12346
nodePort: 30001
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: common-test
pod.name: my-workload

View File

@@ -83,19 +83,12 @@ spec:
{{- include "ix.v1.common.lib.service.spec.externalName" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 2 -}}
{{- else if eq $svcType "ExternalIP" -}}
{{- include "ix.v1.common.lib.service.spec.externalIP" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 2 -}}
{{- end -}}
{{- /* Following apply to all service types */}}
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end -}}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 2 }}
ports:
{{- include "ix.v1.common.lib.service.ports" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 2 }}
{{- end }}
ports:
{{- include "ix.v1.common.lib.service.ports" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 4 }}
{{- if not (mustHas $svcType $specialTypes) }}
selector:
{{- include "ix.v1.common.lib.metadata.selectorLabels" (dict "rootCtx" $rootCtx "podName" $podValues.shortName) | trim | nindent 2 -}}
selector:
{{- include "ix.v1.common.lib.metadata.selectorLabels" (dict "rootCtx" $rootCtx "podName" $podValues.shortName) | trim | nindent 4 -}}
{{- end -}}
{{- if eq $svcType "ExternalIP" -}}
{{/* TODO: endpointsslice for externalIP */}}

View File

@@ -10,7 +10,12 @@ objectData: The service object data
{{- $objectData := .objectData }}
type: ClusterIP
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end -}}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.clusterIP" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.ipFamily" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- end -}}

View File

@@ -9,5 +9,11 @@ objectData: The service object data
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData }}
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end -}}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.externalTrafficPolicy" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- end -}}

View File

@@ -15,6 +15,12 @@ objectData: The service object data
type: ExternalName
externalName: {{ tpl $objectData.externalName $rootCtx }}
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end }}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.clusterIP" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.externalTrafficPolicy" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- end -}}

View File

@@ -10,6 +10,11 @@ objectData: The service object data
{{- $objectData := .objectData }}
type: LoadBalancer
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end -}}
{{- with $objectData.loadBalancerIP }}
loadBalancerIP: {{ tpl . $rootCtx }}
{{- end -}}
@@ -20,8 +25,8 @@ loadBalancerSourceRanges:
- {{ tpl . $rootCtx }}
{{- end -}}
{{- end -}}
{{- include "ix.v1.common.lib.service.clusterIP" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.ipFamily" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.externalTrafficPolicy" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- end -}}

View File

@@ -10,6 +10,12 @@ objectData: The service object data
{{- $objectData := .objectData }}
type: NodePort
publishNotReadyAddresses: {{ include "ix.v1.common.lib.service.publishNotReadyAddresses" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim }}
{{- with (include "ix.v1.common.lib.service.externalIPs" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim) }}
externalIPs:
{{- . | nindent 2 }}
{{- end -}}
{{- include "ix.v1.common.lib.service.sessionAffinity" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.clusterIP" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.ipFamily" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}
{{- include "ix.v1.common.lib.service.externalTrafficPolicy" (dict "rootCtx" $rootCtx "objectData" $objectData) | trim | nindent 0 }}