PUT /api/v2/remotes/{name} decodes into a fresh struct without seeding repo_type, so terraform updates wipe it to "" on every non-local remote. Virtual repos then redirect member downloads to `/api/v1//<remote>/...`, which 404s.
- keep the existing repo_type when the PUT omits it or sends "", default to `remote` only for a new row, reject invalid values
- require base_url on update when repo_type is `remote`, matching create
- add migration 0011 to repair empty repo_type rows as `local` (no base_url) or `remote`
- add TestRepoTypeKeptOnUpdate
Reviewed-on: #179
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #179.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE remotes SET repo_type = CASE WHEN COALESCE(base_url, '') = '' THEN 'local' ELSE 'remote' END WHERE repo_type = '' OR repo_type IS NULL;
|
||||
Reference in New Issue
Block a user