Skip to content

Add a background DB migration to populate the workspace_agentk_states table

MRs:

  1. Add files from RemoteDevelopment module for mig... (!199244 - merged)
  2. Validate only kubernetes objects using JSON schema (!200985 - merged)
  3. Update the duplicated logic to create desired c... (!202190 - merged)
  4. Remove bm_desired_config_array_validator_spec (!202551 - merged)
  5. Backfill workspace_agentk_states for all worksp... (!199102 - merged)

Description

Once that shadow deployment of the new logic for desired_config generator is successful. We can start preparing for the logic to be triggered at workspace creation step. This will require us to create a background migration that backfills all the workspaces in workspace_agentk_states so that when a workspace undergoes reconciliation it gets its desired_config from the database.

Acceptance criteria

  • Backfill workspace_agentk_states for all the workspaces where workspace_agentk_states.desired_config is empty.
  • Before merging the migration, run it on staging/production data through Teleport.
  • Add description in the changelog that all the workspaces which failed the migration will be orphaned and will be required to be cleaned up by the cluster admins.

Implementation plan

  • Create a background migration that creates desired_config for each workspace.
  • Run validation on each created desired_config before persisting. Validations are to be done via DesiredConfig value object created in this MR.
  • Write spec for this migration.
Edited by Ashvin Sharma