Skip to content

Commit ade3794

Browse files
author
Mengqi Yu
committed
👻 fix a name changing issue and a missing scaffolding
1 parent 0e13ffa commit ade3794

File tree

9 files changed

+22
-2
lines changed

9 files changed

+22
-2
lines changed

pkg/scaffold/project.go

+1
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

+1-1
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

+3
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/crd/bases/crew.testproject.org_captains.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
---
23
apiVersion: apiextensions.k8s.io/v1beta1
34
kind: CustomResourceDefinition

testdata/project-v2/config/crd/bases/crew.testproject.org_firstmates.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
---
23
apiVersion: apiextensions.k8s.io/v1beta1
34
kind: CustomResourceDefinition

testdata/project-v2/config/rbac/role.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
---
23
apiVersion: rbac.authorization.k8s.io/v1
34
kind: ClusterRole

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

+1-1
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:
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)