suite: postgres credentials generation # Passwords are always chart-generated (no plaintext input) and preserved across # reconciles by the lookup in init-script.yaml. This suite renders without a # kubernetesProvider, so lookup() returns nothing and every render generates fresh # passwords; the lookup-backed preserve path is covered in credentials_lookup_test.yaml. release: name: pg-test namespace: tenant-test templates: - templates/init-script.yaml tests: - it: generates a 16-char alphanumeric password for each defined user set: users: testuser: {} documentSelector: path: metadata.name value: pg-test-credentials asserts: - matchRegex: path: stringData.testuser pattern: ^[a-zA-Z0-9]{16}$ - it: ignores a value-supplied password and generates one instead # Pins the breaking-change contract: the schema no longer declares # `password`, but nothing rejects a leftover key, so prove it is dropped # rather than honoured. set: users: testuser: password: value-supplied-secret documentSelector: path: metadata.name value: pg-test-credentials asserts: - matchRegex: path: stringData.testuser pattern: ^[a-zA-Z0-9]{16}$ - notMatchRegex: path: stringData.testuser pattern: value-supplied-secret - it: flags the credentials Secret as pending during a restore set: users: testuser: {} bootstrap: enabled: true oldName: pg-old documentSelector: path: metadata.name value: pg-test-credentials asserts: - equal: path: metadata.annotations["postgres.cozystack.io/credentials-pending"] value: "true" - it: does not flag the credentials Secret as pending outside a restore set: users: testuser: {} documentSelector: path: metadata.name value: pg-test-credentials asserts: - notExists: path: metadata.annotations["postgres.cozystack.io/credentials-pending"]