Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 8250085

Browse files
authored
Merge pull request #55 from charleszheng44/bugfix/unset-webhook-ca
[VC] unset the VC validation webhook CABundle
2 parents 6f1e5b0 + b4bf09e commit 8250085

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

virtualcluster/pkg/webhook/virtualcluster/virtualcluster_webhook.go

-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"crypto/x509/pkix"
2626
"encoding/pem"
2727
"fmt"
28-
"io/ioutil"
2928
"net"
3029
"os"
3130
"path/filepath"
@@ -65,7 +64,6 @@ const (
6564
VCWebhookServiceName = "virtualcluster-webhook-service"
6665
DefaultVCWebhookServiceNs = "vc-manager"
6766
VCWebhookCfgName = "virtualcluster-validating-webhook-configuration"
68-
VCWebhookCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
6967
VCWebhookCSRName = "virtualcluster-webhook-csr"
7068
)
7169

@@ -145,11 +143,6 @@ func createValidatingWebhookConfiguration(client client.Client) error {
145143
svcPort := int32(constants.VirtualClusterWebhookPort)
146144
// reject request if the webhook doesn't work
147145
failPolicy := admv1beta1.Fail
148-
// use the serviceaccount ca file as the authority
149-
CAPemByts, err := ioutil.ReadFile(VCWebhookCAFile)
150-
if err != nil {
151-
return fmt.Errorf("fail to read ca file(%s): %s", VCWebhookCAFile, err)
152-
}
153146
vwhCfg := admv1beta1.ValidatingWebhookConfiguration{
154147
ObjectMeta: metav1.ObjectMeta{
155148
Name: VCWebhookCfgName,
@@ -167,7 +160,6 @@ func createValidatingWebhookConfiguration(client client.Client) error {
167160
Path: &validatePath,
168161
Port: &svcPort,
169162
},
170-
CABundle: CAPemByts,
171163
},
172164
FailurePolicy: &failPolicy,
173165
Rules: []admv1beta1.RuleWithOperations{

0 commit comments

Comments
 (0)