Skip to content

Commit a411224

Browse files
authored
Merge pull request #708 from mengqiy/fixscaffolding
fix a name changing issue and a missing scaffolding
2 parents 6695d90 + ade3794 commit a411224

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

pkg/scaffold/project.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ func (p *V2Project) Scaffold() error {
197197
&managerv2.Kustomization{},
198198
&webhook.Kustomization{},
199199
&webhook.KustomizeConfigWebhook{},
200+
&webhook.Service{},
200201
&webhook.InjectCAPatch{},
201202
&certmanager.CertManager{},
202203
&certmanager.Kustomization{},

pkg/scaffold/v2/webhook/kustomization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (c *Kustomization) GetInput() (input.Input, error) {
4040
}
4141

4242
var KustomizeWebhookTemplate = `resources:
43-
- webhookmanifests.yaml
43+
- manifests.yaml
4444
- service.yaml
4545
4646
configurations:

pkg/scaffold/v2/webhook/service.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ spec:
4949
ports:
5050
- port: 443
5151
targetPort: 443
52+
selector:
53+
control-plane: controller-manager
54+
controller-tools.k8s.io: "1.0"
5255
`

testdata/project-v2/config/webhook/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resources:
2-
- webhookmanifests.yaml
2+
- manifests.yaml
33
- service.yaml
44

55
configurations:

testdata/project-v2/config/webhook/manifests.yaml

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: webhook-service
6+
namespace: system
7+
spec:
8+
ports:
9+
- port: 443
10+
targetPort: 443
11+
selector:
12+
control-plane: controller-manager
13+
controller-tools.k8s.io: "1.0"

0 commit comments

Comments
 (0)