Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/web/src/lib/server/config-file/__tests__/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ describe('parseQuackbackConfig', () => {
expect(result.success).toBe(true)
})

it('accepts the rebranded config kind', () => {
const result = parseQuackbackConfig({
apiVersion: 'quackback.io/v1',
kind: 'quackbackConfig',
spec: {},
})
expect(result.success).toBe(true)
})

it('rejects a missing apiVersion', () => {
const result = parseQuackbackConfig({ kind: 'QuackbackConfig', spec: {} })
expect(result.success).toBe(false)
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/lib/server/config-file/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ const authSchema = z
export const quackbackConfigSchema = z
.object({
apiVersion: z.literal('quackback.io/v1'),
kind: z.literal('QuackbackConfig'),
// Accept both the original public discriminator and the rebranded
// spelling so existing managed deployments continue to reconcile.
kind: z.enum(['QuackbackConfig', 'quackbackConfig']),
metadata: z.object({ source: z.string().optional() }).strict().optional(),
spec: z
.object({
Expand Down