Files
cozystack/packages/system/lineage-controller-webhook/tests/resources_test.yaml
T
Nikita Aboltin 8732dc96cf feat(api): add configurable resources and replicas for cozystack-engine components
- cozystack-api, cozystack-controller, lineage-controller-webhook: conditional
  resources block via `{{- with .Values.*.resources }}`, defaulting to `{}` so the
  default render stays unchanged
- cozystack-controller: replicas comes from values (was hardcoded 1); the chart
  now passes --leader-elect unconditionally and grants the Lease verbs through a
  namespaced Role and RoleBinding in cozy-system (the Lease lives in the manager's
  own namespace), so raising replicas adds a standby instead of a second active
  writer over the reconcilers that patch HelmReleases, Gateways, Certificates,
  ResourceQuotas and Secrets

Signed-off-by: Nikita Aboltin <aboltin.nikita@rwb.ru>
2026-09-28 15:19:45 +03:00

41 lines
1.1 KiB
YAML

suite: lineage-controller-webhook resources knob
templates:
- templates/workload.yaml
release:
name: lineage-controller-webhook
namespace: cozy-system
# Two replicas serve this webhook with no leader election, which is fine because
# its controller only refreshes an in-process cache and writes nothing. The
# resources knob follows the same contract as the other two engine charts: `{}`
# renders no key, a set value lands on the container.
tests:
- it: the shipped default renders no resources key
asserts:
- isKind:
of: Deployment
- notExists:
path: spec.template.spec.containers[0].resources
- it: a set value renders on the container, not the pod
set:
lineageControllerWebhook.resources:
requests:
cpu: 1m
memory: 48Mi
limits:
cpu: 500m
memory: 256Mi
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
cpu: 1m
memory: 48Mi
limits:
cpu: 500m
memory: 256Mi