Skip to content

Commit

Permalink
🐛 Fix the webhookcainjection_patch.yaml file creation from init proje…
Browse files Browse the repository at this point in the history
…ct to webhook creation
  • Loading branch information
prafull01 committed Oct 19, 2020
1 parent c993a2a commit ab3f59d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func (f *InjectCAPatch) SetTemplateDefaults() error {

f.TemplateBody = injectCAPatchTemplate

f.IfExistsAction = file.Error
// If file webhookcainjection_patch.yaml exist, skip its creation
f.IfExistsAction = file.Skip

return nil
}
Expand Down
1 change: 0 additions & 1 deletion pkg/plugin/v3/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func (s *initScaffolder) scaffold() error {
&webhook.Kustomization{},
&webhook.KustomizeConfigWebhook{},
&webhook.Service{},
&kdefault.InjectCAPatch{},
&prometheus.Kustomization{},
&prometheus.ServiceMonitor{},
&certmanager.CertManager{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func (f *InjectCAPatch) SetTemplateDefaults() error {

f.TemplateBody = injectCAPatchTemplate

f.IfExistsAction = file.Error
// If file webhookcainjection_patch.yaml exist, skip its creation
f.IfExistsAction = file.Skip

return nil
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/v3/scaffolds/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package scaffolds
import (
"fmt"

"sigs.k8s.io/kubebuilder/pkg/plugin/v3/scaffolds/internal/templates/config/kdefault"

"sigs.k8s.io/kubebuilder/pkg/model"
"sigs.k8s.io/kubebuilder/pkg/model/config"
"sigs.k8s.io/kubebuilder/pkg/model/resource"
Expand Down Expand Up @@ -82,6 +84,7 @@ You need to implement the conversion.Hub and conversion.Convertible interfaces f
s.newUniverse(),
&api.Webhook{Defaulting: s.defaulting, Validating: s.validation},
&templates.MainUpdater{WireWebhook: true},
&kdefault.InjectCAPatch{},
); err != nil {
return err
}
Expand Down

This file was deleted.

0 comments on commit ab3f59d

Please sign in to comment.