fix: allow tag removal in provisioner upsert (#14187)

This commit is contained in:
Garrett Delfosse
2024-08-06 11:38:55 -04:00
committed by GitHub
parent 49feb12a7f
commit fab196043e
7 changed files with 50 additions and 11 deletions

View File

@ -5011,16 +5011,13 @@ VALUES (
$6,
$7,
$8
) ON CONFLICT("name", LOWER(COALESCE(tags ->> 'owner'::text, ''::text))) DO UPDATE SET
) ON CONFLICT("organization_id", "name", LOWER(COALESCE(tags ->> 'owner'::text, ''::text))) DO UPDATE SET
provisioners = $3,
tags = $4,
last_seen_at = $5,
"version" = $6,
api_version = $8,
organization_id = $7
WHERE
-- Only ones with the same tags are allowed clobber
provisioner_daemons.tags <@ $4 :: jsonb
RETURNING id, created_at, name, provisioners, replica_id, tags, last_seen_at, version, api_version, organization_id
`