Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions webhook/workspace/mutating_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
package workspace

import (
"fmt"

admregv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -155,6 +157,9 @@ func BuildMutateWebhookCfg(namespace string) *admregv1.MutatingWebhookConfigurat
ObjectMeta: metav1.ObjectMeta{
Name: MutateWebhookCfgName,
Labels: server.WebhookServerAppLabels(),
Annotations: map[string]string{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it fixes issue with Kubernetes infrastructure.
For OpenShift it has to be service.beta.openshift.io/inject-cabundle: "true"
Please correct me, if I am wrong.

"cert-manager.io/inject-ca-from": fmt.Sprintf("%s/devworkspace-controller-serving-cert", namespace),
},
},
Webhooks: []admregv1.MutatingWebhook{
workspaceMutateWebhook,
Expand Down
5 changes: 5 additions & 0 deletions webhook/workspace/validating_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
package workspace

import (
"fmt"

admregv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand All @@ -36,6 +38,9 @@ func buildValidatingWebhookCfg(namespace string) *admregv1.ValidatingWebhookConf
ObjectMeta: metav1.ObjectMeta{
Name: ValidateWebhookCfgName,
Labels: server.WebhookServerAppLabels(),
Annotations: map[string]string{
"cert-manager.io/inject-ca-from": fmt.Sprintf("%s/devworkspace-controller-serving-cert", namespace),
},
},
Webhooks: []admregv1.ValidatingWebhook{
{
Expand Down
Loading