Skip to content

Commit e58403d

Browse files
committed
Prevent adding DevWorkspace(Template)s through kube components
Signed-off-by: Angel Misevski <[email protected]>
1 parent 1f767a9 commit e58403d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

webhook/workspace/handler/kubernetes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ func (h *WebhookHandler) validatePermissionsOnObject(ctx context.Context, req ad
8989
if kind == "Role" || kind == "Rolebinding" || kind == "ClusterRole" || kind == "ClusterRoleBinding" {
9090
return fmt.Errorf("kubernetes RBAC objects are not permitted within DevWorkspace components")
9191
}
92+
if kind == "DevWorkspace" || kind == "DevWorkspaceTemplate" {
93+
return fmt.Errorf("DevWorkspace objects are not permitted within DevWorkspace components")
94+
}
9295

9396
// Workaround to get the correct resource type for a given kind -- probably fragile
9497
// Convert e.g. Pod -> pods, Deployment -> deployments

0 commit comments

Comments
 (0)