Skip to content

DB: Add fields to support private container registries

MR: Support adding image-pull-secrets to workspaces (!166343 - merged)

Description

As per the plan in Provide support to use images from private cont... (&14664 - closed) , add DB fields to support private container registries.

remote_development:
  image_pull_secrets:
    - name: example-image-pull-secrets
      namespace: default

As a user who has already configured this for 1 registry and workspaces are created from it, if I were to update the agent config to add a new image pull secret pointing to a different registry, it would surprise me if the existing workspaces restarted. Thus, updating this field should only affect newly created workspaces.

NOTE - This issue is currently refined based on the assumption that there will be versioning in the agent config table and that any updates would only affect new workspaces - Backend Design Discussion: versioning Agent Con... (#474184 - closed) . If there are any chances in that decision, this issue would have to be relooked at for refinement(maybe de-normalize these values to the workspaces table).

Acceptance Criteria

For the remote_development_agent_configs table,

  • A new field image_pull_secrets of type jsonb is added. Default value is [].
  • Add JSON Validator and/or Custom Validator for the field in the model - For every element of the array, both name and namespace are required. If the validation fails, do not save the DB record(since that is how we indicate agent config error for now). All the name in the array should be unique because we will create secrets with the same name in the namespace of the workspace. If there are two records in the array with the same name, do not save the DB record.
Edited by Safwan Ahmed