File tree Expand file tree Collapse file tree 8 files changed +13
-50
lines changed
pkg/plugins/golang/v3/scaffolds
internal/templates/config/certmanager
testdata/project-v3-addon/config/certmanager Expand file tree Collapse file tree 8 files changed +13
-50
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import (
2525 "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
2626 "sigs.k8s.io/kubebuilder/v3/pkg/plugins"
2727 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates"
28- "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/certmanager"
2928 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/kdefault"
3029 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/manager"
3130 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/prometheus"
@@ -132,8 +131,5 @@ func (s *initScaffolder) Scaffold() error {
132131 & kdefault.ManagerConfigPatch {},
133132 & prometheus.Kustomization {},
134133 & prometheus.Monitor {},
135- & certmanager.Certificate {},
136- & certmanager.Kustomization {},
137- & certmanager.KustomizeConfig {},
138134 )
139135}
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ func (f *Certificate) SetTemplateDefaults() error {
3737
3838 f .TemplateBody = certManagerTemplate
3939
40+ // If file exists (ex. because a webhook was already created), skip creation.
41+ f .IfExistsAction = machinery .SkipFile
42+
4043 return nil
4144}
4245
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ func (f *Kustomization) SetTemplateDefaults() error {
3737
3838 f .TemplateBody = kustomizationTemplate
3939
40+ // If file exists (ex. because a webhook was already created), skip creation.
41+ f .IfExistsAction = machinery .SkipFile
42+
4043 return nil
4144}
4245
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ func (f *KustomizeConfig) SetTemplateDefaults() error {
3737
3838 f .TemplateBody = kustomizeConfigTemplate
3939
40+ // If file exists (ex. because a webhook was already created), skip creation.
41+ f .IfExistsAction = machinery .SkipFile
42+
4043 return nil
4144}
4245
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "sigs.k8s.io/kubebuilder/v3/pkg/plugins"
2828 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates"
2929 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/api"
30+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/certmanager"
3031 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/kdefault"
3132 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/config/webhook"
3233 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3/scaffolds/internal/templates/hack"
@@ -93,6 +94,9 @@ func (s *webhookScaffolder) Scaffold() error {
9394 & webhook.Kustomization {Force : s .force },
9495 & webhook.KustomizeConfig {},
9596 & webhook.Service {},
97+ & certmanager.Certificate {},
98+ & certmanager.Kustomization {},
99+ & certmanager.KustomizeConfig {},
96100 ); err != nil {
97101 return err
98102 }
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments