test(hack): check chart output for arbitrary tenant values in unit-tests

hack/values-injection renders every chart under packages/apps and
packages/extra with generated values for each string field and map
key its schema allows, including the charts its HelmReleases install,
and fails when a value changes the structure of the output rather
than only its content. Fields multiline by design are listed in
hack/testdata/values-injection/allowlist.txt.

It runs as values-injection-check, a prerequisite of unit-tests, and
the Helm Charts conventions in docs/agents/overview.md gain the rule it
enforces.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
Myasnikov Daniil committed 2026-12-03 10:03:22 +00:00
1 parent 4b8eaffa53
commit fb00301f0b
31 files changed
+3562 -3

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
# Fields whose value is multi-line by design, one per line:
# <chart dir> <field> <reason>
# A field listed here may be breakable: the check reports it and does not fail.
# Injectable fails the check all the same, and so does an entry that no
# breakable field matches any more.
packages/apps/vm-instance cloudInit cloud-init user data is a multi-line document written whole, stored quoted as the userdata of the cloud-init Secret
+3
View File
@@ -0,0 +1,3 @@
profiles:
# machines[0].*: a machine renders its DHCP settings once per MAC address, so it needs at least one
- machines: [{hostname: machine1, mac: ["d6:fa:af:52:25:93"]}]
+3
View File
@@ -0,0 +1,3 @@
profiles:
# nodeGroups.*: supplied groups must include one ingress-nginx group that can scale to a node
- nodeGroups: {ingress: {minReplicas: 0, maxReplicas: 1, roles: [ingress-nginx]}}
+24
View File
@@ -0,0 +1,24 @@
profiles:
# Each provider's credentials block renders only when provider names it.
# The blocks are free-form objects in the schema, so only their default keys
# (accessKeyId, apiToken, ...) reach the output, never an arbitrary key.
# cloudflare.*: apiToken
- {provider: cloudflare}
# cloudflare.*: apiKey and apiEmail, which render only as a pair and only without apiToken
- {provider: cloudflare, cloudflare: {apiKey: key, apiEmail: dns@example.org}}
# aws.*: accessKeyId, secretAccessKey, region, zoneType
- {provider: aws}
# azure.*: tenantId, subscriptionId, resourceGroup, aadClientId, aadClientSecret
- {provider: azure}
# google.*: project, serviceAccountKey
- {provider: google}
# digitalocean.*: token
- {provider: digitalocean}
# linode.*: token
- {provider: linode}
# ovh.*: endpoint, applicationKey, applicationSecret, consumerKey
- {provider: ovh}
# exoscale.*: apiKey, apiSecret
- {provider: exoscale}
# godaddy.*: apiKey, apiSecret
- {provider: godaddy}
+5
View File
@@ -0,0 +1,5 @@
profiles:
# gatewayClassName: a tenant may select only a class the operator lists in gateway.tenantSelectableClasses
- _cluster: {gateway-tenant-classes: "$CANARY"}
# tlsPassthroughServices[0]: passthrough listeners render only on the publishing tenant, with the gateway on, for services it exposes
- _cluster: {expose-ingress: tenant-test, gateway-enabled: "true", expose-services: "$CANARY"}
+10
View File
@@ -0,0 +1,10 @@
profiles:
# kubelet.*ReservedCpu: an explicit reservation of a whole core needs a node large enough to hold it
- resources: {cpu: 8, memory: 16Gi}
# proxmox.*: the proxmox substrate needs a template, a bridge and DNS servers; a target storage needs a full clone
- substrate: proxmox
proxmox:
templateTags: [talos-v1.13.12]
full: true
network: {bridge: vmbr0}
dnsServers: [192.0.2.53]
+22
View File
@@ -0,0 +1,22 @@
profiles:
# addons.hami.*: HAMi runs on top of the GPU operator
- addons: {gpuOperator: {enabled: true}}
# addons.ouroboros.*: ouroboros fixes hairpin NAT for the tenant ingress-nginx
- addons: {ingressNginx: {enabled: true}}
# addons.verticalPodAutoscaler.*: the VPA is installed with the monitoring agents
- addons: {monitoringAgents: {enabled: true}}
# controlPlane.apiServer.extraVolumeMounts[0].*: a mount must name a volume declared in extraVolumes
- controlPlane:
apiServer:
extraVolumes: [{name: authn, configMap: {name: authn}}]
extraVolumeMounts: [{name: authn, mountPath: /etc/kubernetes/authn}]
# proxmox.*: the proxmox substrate with the settings its templates require
- substrate: proxmox
proxmox:
dnsServers: ["10.0.0.1"]
allowedNodes: ["pve1"]
ipv4Config: {addresses: ["10.0.0.10-10.0.0.20"], gateway: "10.0.0.1", prefix: 24}
ccm: {credentialsSecretName: pve}
csi: {credentialsSecretName: pve, storageClasses: [{name: fast, storage: local-lvm}]}
# oidc.customConfig.*, oidc.users[*]: a tenant-supplied issuer
- oidc: {mode: CustomConfig, customConfig: {secretRef: {name: authn}}}
+4
View File
@@ -0,0 +1,4 @@
profiles:
# users.<key>: a user renders only when a database role names it;
# fuzzkey is the key the fuzzer gives a map entry it creates
- databases: {db1: {roles: {admin: ["$CANARY", fuzzkey]}}}
+5
View File
@@ -0,0 +1,5 @@
profiles:
# seal.secretName, seal.keyId: the static seal needs both
- seal: {type: static, secretName: unseal-key, keyId: key-1}
# seal.previousSecretName, seal.previousKeyId: an n-1 key rotation of the static seal sets both, distinct from the current pair
- seal: {type: static, secretName: unseal-key, keyId: key-1, previousSecretName: unseal-key-old, previousKeyId: key-0}
+4
View File
@@ -0,0 +1,4 @@
profiles:
# bootstrap.*: a recovery from a legacy S3 backup needs inline S3 credentials and a source cluster name
- backup: {s3AccessKey: access, s3SecretKey: secret}
bootstrap: {enabled: true, oldName: source}
+3
View File
@@ -0,0 +1,3 @@
profiles:
# maxmemory: a gigabyte-sized maxmemory must fit in 90% of the pod's memory request
- resources: {cpu: 1, memory: 4Gi}
+3
View File
@@ -0,0 +1,3 @@
profiles:
# volume.zones.*: zones only render with the MultiZone topology, which needs no more replicas than zones
- {topology: MultiZone, replicationFactor: 1}
+3
View File
@@ -0,0 +1,3 @@
profiles:
# whitelist[0]: the HTTP/HTTPS frontends render the client whitelist only with whitelistHTTP on
- {whitelistHTTP: true, whitelist: [10.0.0.0/8]}
+3
View File
@@ -0,0 +1,3 @@
profiles:
# gatewayClass: read only when the tenant owns its Gateway
- {gateway: true}