Skip to content

Commit

Permalink
Set pod annotations to workspace pod
Browse files Browse the repository at this point in the history
Signed-off-by: dkwon17 <[email protected]>
  • Loading branch information
dkwon17 committed Jun 4, 2024
1 parent 0be47d2 commit a6709fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/config/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,15 @@ func mergeConfig(from, to *controller.OperatorConfiguration) {
}
to.Workspace.DefaultContainerResources = mergeResources(from.Workspace.DefaultContainerResources, to.Workspace.DefaultContainerResources)
}

if from.Workspace.Annotations != nil {
if to.Workspace.Annotations == nil {
to.Workspace.Annotations = make(map[string]string)
}
for key, value := range from.Workspace.Annotations {
to.Workspace.Annotations[key] = value
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/provision/workspace/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func getSpecDeployment(
constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId,
constants.DevWorkspaceNameLabel: workspace.Name,
},
Annotations: workspace.Config.Workspace.Annotations,
},
Spec: corev1.PodSpec{
InitContainers: podAdditions.InitContainers,
Expand Down

0 comments on commit a6709fc

Please sign in to comment.