Skip to content

Commit

Permalink
Label per-workspace PVCs with DevWorkspace ID.
Browse files Browse the repository at this point in the history
Signed-off-by: Angel Misevski <[email protected]>
  • Loading branch information
amisevsk committed Sep 8, 2023
1 parent 58ada48 commit 870fbe2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/provision/storage/perWorkspaceStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ func syncPerWorkspacePVC(workspace *common.DevWorkspaceWithConfig, clusterAPI sy
if err != nil {
return nil, err
}
if pvc.Labels == nil {
pvc.Labels = map[string]string{}
}
pvc.Labels[constants.DevWorkspaceIDLabel] = workspace.Status.DevWorkspaceId

if err := controllerutil.SetControllerReference(workspace.DevWorkspace, pvc, clusterAPI.Scheme); err != nil {
return nil, err
Expand Down

0 comments on commit 870fbe2

Please sign in to comment.