Skip to content

Commit ef7f789

Browse files
✨ add default conversion review versions
The conversion webhook client config requires a list of conversion review versions. This change scaffolds the conversion webhook patch with default conversion review version of v1.
1 parent 2b857cb commit ef7f789

File tree

19 files changed

+24
-0
lines changed

19 files changed

+24
-0
lines changed

pkg/cli/alpha/config-gen/cert-generation-filter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ func (c CertFilter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error) {
107107
if err != nil {
108108
return nil, err
109109
}
110+
err = matches[i].PipeE(yaml.LookupCreate(
111+
yaml.ScalarNode, "spec", "conversion", "webhookClientConfig", "conversionReviewVersions"),
112+
yaml.FieldSetter{StringValue: "v1"})
113+
if err != nil {
114+
return nil, err
115+
}
110116
err = matches[i].PipeE(yaml.LookupCreate(
111117
yaml.ScalarNode, "spec", "conversion", "webhookClientConfig", "service", "name"),
112118
yaml.FieldSetter{StringValue: "webhook-service"})

pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/crd/patches/enablewebhook_patch.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ spec:
6666
namespace: system
6767
name: webhook-service
6868
path: /convert
69+
conversionReviewVersions: v1
6970
{{- end }}
7071
`

testdata/project-v3-addon/config/crd/patches/webhook_in_admirals.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-addon/config/crd/patches/webhook_in_captains.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-addon/config/crd/patches/webhook_in_firstmates.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-config/config/crd/patches/webhook_in_admirals.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-config/config/crd/patches/webhook_in_captains.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-config/config/crd/patches/webhook_in_firstmates.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-multigroup/config/crd/patches/webhook_in_captains.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

testdata/project-v3-multigroup/config/crd/patches/webhook_in_cruisers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ spec:
1212
namespace: system
1313
name: webhook-service
1414
path: /convert
15+
conversionReviewVersions: v1

0 commit comments

Comments
 (0)