Initial Commit
All checks were successful
Helm / helm-unittest (push) Successful in 13s
Helm / helm-lint (push) Successful in 17s
Release / publish-chart (push) Successful in 20s

This commit is contained in:
2025-07-23 18:14:01 +02:00
commit b726409caa
48 changed files with 6058 additions and 0 deletions

View File

@ -0,0 +1,447 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Deployment template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/deployment.yaml
tests:
- it: Rendering default
set: {}
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: apps/v1
kind: Deployment
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- equal:
path: spec.replicas
value: 1
- isSubset:
path: spec.selector.matchLabels
content:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite
- equal:
path: spec.strategy
value:
type: "RollingUpdate"
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
- notExists:
path: spec.template.metadata.annotations
value: sadsdf
- equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- notExists:
path: spec.template.spec.affinity
- notExists:
path: spec.template.spec.containers[0].args
- notExists:
path: spec.template.spec.containers[0].command
- contains:
path: spec.template.spec.containers[0].env
content:
name: JAVA_OPTS
value: "-Xmx64M"
- notExists:
path: spec.template.spec.containers[0].envFrom
- equal:
path: spec.template.spec.containers[0].image
value: docker.io/dzikoysk/reposilite:0.1.0
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: IfNotPresent
- isSubset:
path: spec.template.spec.containers[0].livenessProbe
content:
tcpSocket:
port: http
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 3
- equal:
path: spec.template.spec.containers[0].name
value: reposilite
- contains:
path: spec.template.spec.containers[0].ports
content:
name: http
containerPort: 8080
protocol: TCP
- isSubset:
path: spec.template.spec.containers[0].readinessProbe
content:
tcpSocket:
port: http
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 3
- notExists:
path: spec.template.spec.containers[0].resources
- notExists:
path: spec.template.spec.containers[0].securityContext
- notExists:
path: spec.template.spec.containers[0].volumeMounts
- notExists:
path: spec.template.spec.dnsConfig
- notExists:
path: spec.template.spec.dnsPolicy
- notExists:
path: spec.template.spec.hostname
- equal:
path: spec.template.spec.hostNetwork
value: false
- notExists:
path: spec.template.spec.imagePullSecrets
- notExists:
path: spec.template.spec.initContainers
- notExists:
path: spec.template.spec.nodeSelector
- notExists:
path: spec.template.spec.priorityClassName
- notExists:
path: spec.template.spec.restartPolicy
- notExists:
path: spec.template.spec.subdomain
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 60
- notExists:
path: spec.template.spec.tolerations
- notExists:
path: spec.template.spec.topologySpreadConstraints
- notExists:
path: spec.template.spec.volumes
- it: Test custom replicas
set:
deployment.replicas: 3
asserts:
- equal:
path: spec.replicas
value: 3
- it: Test custom strategy
set:
deployment.strategy:
type: "RollingUpdate"
rollingUpdate:
maxSurge: 10
maxUnavailable: 5
asserts:
- equal:
path: spec.strategy
value:
type: "RollingUpdate"
rollingUpdate:
maxSurge: 10
maxUnavailable: 5
- it: Test custom affinity
set:
deployment.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- antarctica-east1
- antarctica-west1
- it: Test additional arguments
set:
deployment.reposilite.args:
- "--foo=bar"
- "--bar=foo"
asserts:
- equal:
path: spec.template.spec.containers[0].args
value:
- --foo=bar
- --bar=foo
- it: Test additional commands
set:
deployment.reposilite.command:
- "/bin/bash"
asserts:
- equal:
path: spec.template.spec.containers[0].command
value:
- /bin/bash
- it: Test custom imageRegistry and imageRepository
set:
deployment.reposilite.image.registry: registry.example.local
deployment.reposilite.image.repository: path/special/reposilite
deployment.reposilite.image.tag: 2.0.0
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.example.local/path/special/reposilite:2.0.0
- it: Test custom imagePullPolicy
set:
deployment.reposilite.image.pullPolicy: Always
asserts:
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: Always
- it: Test custom port
set:
service.port: 8443
asserts:
- contains:
path: spec.template.spec.containers[0].ports
content:
name: http
containerPort: 8443
protocol: TCP
- it: Test custom resources
set:
deployment.reposilite.resources:
limits:
cpu: 100m
memory: 250MB
requests:
cpu: 25m
memory: 100MB
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
limits:
cpu: 100m
memory: 250MB
requests:
cpu: 25m
memory: 100MB
- it: Test custom securityContext
set:
deployment.reposilite.securityContext:
capabilities:
add:
- NET_RAW
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext
value:
capabilities:
add:
- NET_RAW
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
- it: Test custom volumeMounts
set:
deployment.reposilite.volumeMounts:
- name: data
mountPath: /usr/lib/data
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: data
mountPath: /usr/lib/data
- it: Test dnsConfig
set:
deployment.dnsConfig:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
asserts:
- equal:
path: spec.template.spec.dnsConfig
value:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
- it: Test dnsPolicy
set:
deployment.dnsPolicy: ClusterFirst
asserts:
- equal:
path: spec.template.spec.dnsPolicy
value: ClusterFirst
- it: Test hostNetwork, hostname, subdomain
set:
deployment.hostNetwork: true
deployment.hostname: pg-exporter
deployment.subdomain: exporters.internal
asserts:
- equal:
path: spec.template.spec.hostNetwork
value: true
- equal:
path: spec.template.spec.hostname
value: pg-exporter
- equal:
path: spec.template.spec.subdomain
value: exporters.internal
- it: Test imagePullSecrets
set:
deployment.imagePullSecrets:
- name: my-pull-secret
- name: my-special-secret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets
value:
- name: my-pull-secret
- name: my-special-secret
- it: Test nodeSelector
set:
deployment.nodeSelector:
foo: bar
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
foo: bar
- it: Test priorityClassName
set:
deployment.priorityClassName: my-priority
asserts:
- equal:
path: spec.template.spec.priorityClassName
value: my-priority
- it: Test restartPolicy
set:
deployment.restartPolicy: Always
asserts:
- equal:
path: spec.template.spec.restartPolicy
value: Always
- it: Test custom securityContext
set:
deployment.securityContext:
fsGroup: 1000
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
asserts:
- equal:
path: spec.template.spec.securityContext
value:
fsGroup: 1000
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
- it: Test terminationGracePeriodSeconds
set:
deployment.terminationGracePeriodSeconds: 120
asserts:
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 120
- it: Test tolerations
set:
deployment.tolerations:
- key: hdd/type
operator: Equal
value: ssd
effect: NoSchedule
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: hdd/type
operator: Equal
value: ssd
effect: NoSchedule
- it: Test topologySpreadConstraints
set:
deployment.topologySpreadConstraints:
- topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: reposilite
asserts:
- equal:
path: spec.template.spec.topologySpreadConstraints
value:
- topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: reposilite
- it: Test additional volumes
set:
deployment.volumes:
- name: data
hostPath:
path: /usr/lib/data
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: data
hostPath:
path: /usr/lib/data

View File

@ -0,0 +1,52 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Mount persistent volume claim
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/deployment.yaml
tests:
- it: Rendering default volumes and volumeMounts with persistent volume claim
set:
persistentVolumeClaim.enabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: REPOSILITE_DATA
value: /app/data
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: data
mountPath: /app/data
- contains:
path: spec.template.spec.volumes
content:
name: data
persistentVolumeClaim:
claimName: reposilite-unittest
- it: Rendering custom volumes and volumeMounts with persistent volume claim
set:
persistentVolumeClaim.enabled: true
persistentVolumeClaim.path: /usr/lib/reposilite/data
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: REPOSILITE_DATA
value: /usr/lib/reposilite/data
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: data
mountPath: /usr/lib/reposilite/data
- contains:
path: spec.template.spec.volumes
content:
name: data
persistentVolumeClaim:
claimName: reposilite-unittest

152
unittests/hpa/hpa.yaml Normal file
View File

@ -0,0 +1,152 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: HPA template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/hpa.yaml
tests:
- it: Skip rendering by default.
asserts:
- hasDocuments:
count: 0
- it: Rendering when enabled - default
set:
hpa.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- isSubset:
path: spec.behavior
content:
scaleDown:
policies:
- type: Pods
value: 1
periodSeconds: 60
stabilizationWindowSeconds: 300
- lengthEqual:
path: spec.metrics
count: 2
- contains:
path: spec.metrics
content:
resource:
name: cpu
target:
averageUtilization: 65
type: Utilization
type: Resource
- contains:
path: spec.metrics
content:
resource:
name: memory
target:
averageUtilization: 65
type: Utilization
type: Resource
- equal:
path: spec.maxReplicas
value: 10
- equal:
path: spec.minReplicas
value: 1
- equal:
path: spec.scaleTargetRef
value:
apiVersion: apps/v1
kind: Deployment
name: reposilite-unittest
- it: Rendering when enabled - custom values
set:
hpa.enabled: true
hpa.annotations:
foo: bar
hpa.labels:
bar: foo
hpa.maxReplicas: 25
hpa.minReplicas: 5
hpa.metrics:
- resource:
name: cpu
target:
averageUtilization: 60
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 60
type: Utilization
type: Resource
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: reposilite-unittest
namespace: testing
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
bar: foo
helm.sh/chart: reposilite-0.1.0
- contains:
path: spec.metrics
content:
resource:
name: cpu
target:
averageUtilization: 60
type: Utilization
type: Resource
- contains:
path: spec.metrics
content:
resource:
name: memory
target:
averageUtilization: 60
type: Utilization
type: Resource
- equal:
path: spec.maxReplicas
value: 25
- equal:
path: spec.minReplicas
value: 5
- equal:
path: spec.scaleTargetRef
value:
apiVersion: apps/v1
kind: Deployment
name: reposilite-unittest

110
unittests/ingress/http.yaml Normal file
View File

@ -0,0 +1,110 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Ingress HTTP template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/ingress.yaml
tests:
- it: Skip rendering when disabled
set:
ingress.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Rendering default values
set:
ingress.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: networking.k8s.io/v1
kind: Ingress
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- equal:
path: spec.ingressClassName
value: nginx
- isNullOrEmpty:
path: spec.rules
- notExists:
path: spec.tls
- it: Render custom annotations and labels
set:
ingress.annotations:
foo: bar
ingress.enabled: true
ingress.labels:
foo: bar
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
foo: bar
helm.sh/chart: reposilite-0.1.0
- it: Render custom HTTP path and TLS
set:
ingress.enabled: true
ingress.hosts:
- host: reposilite.example.local
paths:
- path: /
pathType: Prefix
ingress.tls:
- secretName: reposilite-http-tls
hosts:
- reposilite.example.local
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: networking.k8s.io/v1
kind: Ingress
name: reposilite-unittest
namespace: testing
- equal:
path: spec.ingressClassName
value: nginx
- contains:
path: spec.rules
content:
host: reposilite.example.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: reposilite-unittest
port:
number: 8080
- contains:
path: spec.tls
content:
hosts:
- reposilite.example.local
secretName: reposilite-http-tls

View File

@ -0,0 +1,98 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: NetworkPolicy template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/networkPolicy.yaml
tests:
- it: Skip rendering networkPolicy
set:
networkPolicy.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Render default networkPolicy
set:
networkPolicy.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- equal:
path: spec.podSelector.matchLabels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite
- notExists:
path: spec.policyTypes
- notExists:
path: spec.egress
- notExists:
path: spec.ingress
- it: Template networkPolicy with policyTypes, egress and ingress configuration
set:
networkPolicy.enabled: true
networkPolicy.policyTypes:
- Egress
- Ingress
networkPolicy.ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
networkPolicy.egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: ingress-nginx
podSelector:
matchLabels:
app.kubernetes.io/name: ingress-nginx
asserts:
- equal:
path: spec.policyTypes
value:
- Egress
- Ingress
- equal:
path: spec.egress
value:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: ingress-nginx
podSelector:
matchLabels:
app.kubernetes.io/name: ingress-nginx
- equal:
path: spec.ingress
value:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus

View File

@ -0,0 +1,97 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: PersistentVolumeClaim template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/persistentVolumeClaim.yaml
tests:
- it: Skip rendering persistentVolumeClaim, when it's disabled in general
set:
persistentVolumeClaim.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Skip rendering persistentVolumeClaim, when using an existing persistentVolumeClaim
set:
persistentVolumeClaim.enabled: true
persistentVolumeClaim.existing.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Render default persistentVolumeClaim
set:
persistentVolumeClaim.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: v1
kind: PersistentVolumeClaim
name: reposilite-unittest
namespace: testing
- equal:
path: metadata.annotations
value:
helm.sh/resource-policy: keep
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- contains:
path: spec.accessModes
content:
ReadWriteOnce
- equal:
path: spec.resources.requests.storage
value: 10Gi
- it: Test custom annotations and labels
set:
persistentVolumeClaim.enabled: true
persistentVolumeClaim.new.annotations:
foo: bar
persistentVolumeClaim.new.labels:
foo: bar
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
helm.sh/resource-policy: keep
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
foo: bar
helm.sh/chart: reposilite-0.1.0
- it: Test custom access mode
set:
persistentVolumeClaim.enabled: true
persistentVolumeClaim.new.accessMode: ReadWriteMany
asserts:
- contains:
path: spec.accessModes
content:
ReadWriteMany
- it: Test custom size
set:
persistentVolumeClaim.enabled: true
persistentVolumeClaim.new.size: 50Gi
asserts:
- equal:
path: spec.resources.requests.storage
value: 50Gi

View File

@ -0,0 +1,79 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: ServiceAccount reposilite template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/serviceAccount.yaml
tests:
- it: Skip rendering.
set:
serviceAccount.existing.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Rendering serviceAccount with default values.
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: v1
kind: ServiceAccount
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- notExists:
path: metadata.labels
- equal:
path: automountServiceAccountToken
value: true
- notExists:
path: imagePullSecrets
- notExists:
path: secrets
- it: Rendering serviceAccount with custom values.
set:
serviceAccount.new.annotations:
foo: bar
serviceAccount.new.labels:
bar: foo
serviceAccount.new.automountServiceAccountToken: false
serviceAccount.new.imagePullSecrets:
- name: "my-pull-secret"
serviceAccount.new.secrets:
- name: "my-secret"
namespace: "my-namespace"
fieldPath: "my-path"
asserts:
- hasDocuments:
count: 1
- exists:
path: metadata.annotations
value:
foo: bar
- exists:
path: metadata.labels
value:
bar: foo
- equal:
path: metadata.name
value: reposilite-unittest
- equal:
path: automountServiceAccountToken
value: false
- equal:
path: imagePullSecrets
value:
- name: "my-pull-secret"
- equal:
path: secrets
value:
- name: "my-secret"
namespace: "my-namespace"
fieldPath: "my-path"

View File

@ -0,0 +1,172 @@
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Service http template
release:
name: reposilite-unittest
namespace: testing
templates:
- templates/service.yaml
tests:
- it: Skip service when disabled.
set:
service.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Rendering service with default values.
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: v1
kind: Service
name: reposilite-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
- notExists:
path: spec.externalIPs
- notExists:
path: spec.externalTrafficPolicy
- equal:
path: spec.internalTrafficPolicy
value: Cluster
- notExists:
path: spec.ipFamilies
- notExists:
path: spec.loadBalancerClass
- notExists:
path: spec.loadBalancerIP
- notExists:
path: spec.loadBalancerSourceRanges
- equal:
path: spec.ports[0].name
value: http
- equal:
path: spec.ports[0].protocol
value: TCP
- equal:
path: spec.ports[0].port
value: 8080
- equal:
path: spec.selector
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/name: reposilite
- equal:
path: spec.sessionAffinity
value: None
- notExists:
path: spec.sessionAffinityConfig
- equal:
path: spec.type
value: ClusterIP
- it: Require internalTrafficPolicy.
set:
service.internalTrafficPolicy: ""
asserts:
- failedTemplate:
errorMessage: No internal traffic policy defined!
- it: Require port.
set:
service.port: ""
asserts:
- failedTemplate:
errorMessage: No service port defined!
- it: Require sessionAffinity.
set:
service.sessionAffinity: ""
asserts:
- failedTemplate:
errorMessage: No session affinity defined!
- it: Require service type.
set:
service.type: ""
asserts:
- failedTemplate:
errorMessage: No service type defined!
- it: Render service with custom annotations and labels.
set:
service.annotations:
foo: bar
service.labels:
bar: foo
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: reposilite-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: reposilite
app.kubernetes.io/version: 0.1.0
helm.sh/chart: reposilite-0.1.0
bar: foo
- it: Change defaults
set:
service.externalIPs:
- "10.11.12.13/32"
service.externalTrafficPolicy: Local
service.internalTrafficPolicy: Local
service.ipFamilies:
- IPv4
service.loadBalancerClass: aws
service.loadBalancerIP: "11.12.13.14"
service.loadBalancerSourceRanges:
- "11.12.0.0/17"
service.port: 10443
service.sessionAffinity: ClientIP
service.type: LoadBalancer
asserts:
- equal:
path: spec.externalIPs
value:
- 10.11.12.13/32
- equal:
path: spec.externalTrafficPolicy
value: Local
- equal:
path: spec.internalTrafficPolicy
value: Local
- equal:
path: spec.ipFamilies
value:
- IPv4
- equal:
path: spec.loadBalancerClass
value: aws
- equal:
path: spec.loadBalancerIP
value: "11.12.13.14"
- equal:
path: spec.loadBalancerSourceRanges
value:
- "11.12.0.0/17"
- equal:
path: spec.ports[0].port
value: 10443
- equal:
path: spec.sessionAffinity
value: ClientIP
- equal:
path: spec.type
value: LoadBalancer