Skip to content

Commit

Permalink
Update webhooks to not reject DevWorkspaces with URI kube components
Browse files Browse the repository at this point in the history
Update the webhook server to ignore Kubernetes and OpenShift components
that use URIs with deployByDefault: true. Instead these components
will be ignored by DWO and a warning should be added to the workspace.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
  • Loading branch information
amisevsk committed May 19, 2023
1 parent 16928bb commit 0319e70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webhook/workspace/handler/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (h *WebhookHandler) validateKubernetesObjectPermissionsOnCreate(ctx context
continue
}
if component.Uri != "" {
return fmt.Errorf("kubenetes components specified via URI are unsupported")
// We're going to ignore URI components for now
continue
}
if component.Inlined == "" {
return fmt.Errorf("kubernetes component does not define inlined content")
Expand All @@ -66,7 +67,8 @@ func (h *WebhookHandler) validateKubernetesObjectPermissionsOnUpdate(ctx context
}

if newComponent.Uri != "" {
return fmt.Errorf("kubenetes components specified via URI are unsupported")
// We're going to ignore URI components for now
continue
}
if newComponent.Inlined == "" {
return fmt.Errorf("kubernetes component does not define inlined content")
Expand Down

0 comments on commit 0319e70

Please sign in to comment.