mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
fix(common): Release 3.6.1 (#369)
This commit is contained in:
parent
ec94fd49f7
commit
5fdc9e940e
11 changed files with 116 additions and 47 deletions
|
@ -110,7 +110,11 @@ tests:
|
|||
- it: with defaultBackend should pass
|
||||
set:
|
||||
ingress.main:
|
||||
defaultBackend: test
|
||||
defaultBackend:
|
||||
resource:
|
||||
apiGroup: k8s.example.com
|
||||
kind: StorageBucket
|
||||
name: static-assets
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
|
@ -118,7 +122,11 @@ tests:
|
|||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.defaultBackend
|
||||
value: test
|
||||
value:
|
||||
resource:
|
||||
apiGroup: k8s.example.com
|
||||
kind: StorageBucket
|
||||
name: static-assets
|
||||
- documentIndex: *IngressDocument
|
||||
notExists:
|
||||
path: spec.rules
|
||||
|
|
|
@ -9,50 +9,51 @@ capabilities:
|
|||
majorVersion: 1
|
||||
minorVersion: 29
|
||||
tests:
|
||||
- it: default should pass for kubernetes < 1.28
|
||||
- it: should not be present by default for kubernetes < 1.28
|
||||
capabilities:
|
||||
majorVersion: 1
|
||||
minorVersion: 28
|
||||
documentSelector: &DeploymentSelector
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.hostUsers
|
||||
|
||||
- it: default should pass for kubernetes >= 1.29
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.hostUsers
|
||||
value: true
|
||||
|
||||
- it: hostUsers disabled should pass
|
||||
- it: should not be present even if specified for kubernetes < 1.28
|
||||
capabilities:
|
||||
majorVersion: 1
|
||||
minorVersion: 28
|
||||
set:
|
||||
defaultPodOptions:
|
||||
hostUsers: false
|
||||
documentSelector: *DeploymentSelector
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- notExists:
|
||||
path: spec.template.spec.hostUsers
|
||||
|
||||
- it: should not be present by default for kubernetes >= 1.29
|
||||
documentSelector: *DeploymentSelector
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.hostUsers
|
||||
|
||||
- it: hostUsers disabled should set for kubernetes >= 1.29
|
||||
set:
|
||||
defaultPodOptions:
|
||||
hostUsers: false
|
||||
documentSelector: *DeploymentSelector
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.hostUsers
|
||||
value: false
|
||||
|
||||
- it: hostUsers enabled should pass
|
||||
- it: hostUsers enabled should be set for kubernetes >= 1.29
|
||||
set:
|
||||
defaultPodOptions:
|
||||
hostUsers: true
|
||||
documentSelector: *DeploymentSelector
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.hostUsers
|
||||
value: true
|
||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: v2
|
|||
name: common
|
||||
description: Function library for Helm charts
|
||||
type: library
|
||||
version: 3.6.0
|
||||
version: 3.6.1
|
||||
kubeVersion: ">=1.22.0-0"
|
||||
keywords:
|
||||
- common
|
||||
|
@ -14,9 +14,12 @@ maintainers:
|
|||
email: me@bjw-s.dev
|
||||
annotations:
|
||||
artifacthub.io/changes: |-
|
||||
- kind: added
|
||||
- kind: fixed
|
||||
description: |-
|
||||
Add hostUsers field to pod spec for k8s clusters >= 1.29
|
||||
- kind: added
|
||||
Only add hostUsers when explicitly configured
|
||||
- kind: fixed
|
||||
description: |-
|
||||
Allow propagating global labels and annotations to Pod metadata
|
||||
`hosts` should be an optional field for Ingress resources
|
||||
- kind: fixed
|
||||
description: |-
|
||||
`defaultBackend` should be an object for Ingress resources
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# common
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Function library for Helm charts
|
||||
|
||||
|
@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
|
|||
# Chart.yaml
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 3.6.0
|
||||
version: 3.6.1
|
||||
repository: https://bjw-s.github.io/helm-charts/
|
||||
```
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
|
||||
"defaultBackend": {
|
||||
"type": "string"
|
||||
"$ref": "k8s-api.json#/networking.v1.ingressBackend"
|
||||
},
|
||||
|
||||
"hosts": {
|
||||
|
@ -42,8 +42,7 @@
|
|||
"$ref": "#/tlsEntry"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["hosts"]
|
||||
}
|
||||
},
|
||||
|
||||
"hostEntry": {
|
||||
|
|
|
@ -967,5 +967,62 @@
|
|||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
|
||||
"networking.v1.ingressBackend": {
|
||||
"description": "IngressBackend describes all endpoints for a given service and port.",
|
||||
"properties": {
|
||||
"resource": {
|
||||
"description": "resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. This is a mutually exclusive setting with \"Service\".",
|
||||
"properties": {
|
||||
"apiGroup": {
|
||||
"description": "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"description": "Kind is the type of resource being referenced",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name is the name of resource being referenced",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"name"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"service": {
|
||||
"description": "service references a service as a backend. This is a mutually exclusive setting with \"Resource\".",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "name is the referenced service. The service must exist in the same namespace as the Ingress object.",
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"description": "port of the referenced service. A port name or port number is required for a IngressServiceBackend.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "name is the name of the port on the Service. This is a mutually exclusive setting with \"Number\".",
|
||||
"type": "string"
|
||||
},
|
||||
"number": {
|
||||
"description": "number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with \"Name\".",
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,15 +37,14 @@
|
|||
},
|
||||
"hostNetwork": {
|
||||
"type": "boolean",
|
||||
"default": "false"
|
||||
"default": false
|
||||
},
|
||||
"hostPID": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"hostUsers": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
"type": ["boolean", "null"]
|
||||
},
|
||||
"hostname": {
|
||||
"type": "string"
|
||||
|
|
|
@ -50,7 +50,7 @@ spec:
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $ingressObject.defaultBackend }}
|
||||
defaultBackend: {{ $ingressObject.defaultBackend }}
|
||||
defaultBackend: {{ $ingressObject.defaultBackend | toYaml | nindent 4 }}
|
||||
{{- else }}
|
||||
rules:
|
||||
{{- range $ingressObject.hosts }}
|
||||
|
|
|
@ -28,7 +28,9 @@ hostIPC: {{ include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "
|
|||
hostNetwork: {{ include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostNetwork" "default" false) }}
|
||||
hostPID: {{ include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostPID" "default" false) }}
|
||||
{{- if ge ($rootContext.Capabilities.KubeVersion.Minor | int) 29 }}
|
||||
hostUsers: {{ include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostUsers" "default" true) }}
|
||||
{{- with (include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostUsers")) }}
|
||||
hostUsers: {{ . | trim }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
dnsPolicy: {{ include "bjw-s.common.lib.pod.field.dnsPolicy" (dict "ctx" $ctx) | trim }}
|
||||
{{- with (include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "dnsConfig")) }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.6.0/charts/library/common/values.schema.json",
|
||||
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.6.1/charts/library/common/values.schema.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"global": {
|
||||
|
|
|
@ -51,7 +51,7 @@ defaultPodOptions:
|
|||
hostPID: false
|
||||
|
||||
# -- Use the host's user namespace (requires 1.29 or newer)
|
||||
hostUsers: true
|
||||
hostUsers:
|
||||
|
||||
# -- Set image pull secrets
|
||||
imagePullSecrets: []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue