Skip to content

Commit bdf7cc3

Browse files
committed
fix: add v1beta1 to conversion config to work with 1.16+
1 parent 3aac020 commit bdf7cc3

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

examples/210-conversion-webhook/.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ templates
22
.helmignore
33
Chart.yaml
44
crontab*.yaml
5-
README.md
65
values.yaml

pkg/webhook/conversion/crd_client_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type CrdClientConfig struct {
2020
CABundle []byte
2121
}
2222

23-
var SupportedConversionReviewVersions = []string{"v1"}
23+
var SupportedConversionReviewVersions = []string{"v1", "v1beta1"}
2424

2525
func (c *CrdClientConfig) Update() error {
2626
client := c.KubeClient

pkg/webhook/conversion/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (h *WebhookHandler) ServeReviewRequest(w http.ResponseWriter, r *http.Reque
7070
}
7171

7272
// See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#write-a-conversion-webhook-server
73+
// This code always response with v1 ConversionReview: it works for 1.16+.
7374
func (h *WebhookHandler) HandleReviewRequest(path string, body []byte) (*v1.ConversionReview, error) {
7475
crdName := DetectCrdName(path)
7576
log.Infof("Got ConversionReview request for crd/%s", crdName)

0 commit comments

Comments
 (0)