@@ -101,7 +101,7 @@ func (s *webhookScaffolder) Scaffold() error {
101
101
kustomizeFilePath := "config/default/kustomization.yaml"
102
102
err = pluginutil .UncommentCode (kustomizeFilePath , "#- ../webhook" , `#` )
103
103
if err != nil {
104
- hasWebHookUncommented , err := pluginutil .HasFragment (kustomizeFilePath , "- ../webhook" )
104
+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (kustomizeFilePath , "- ../webhook" )
105
105
if ! hasWebHookUncommented || err != nil {
106
106
log .Errorf ("Unable to find the target #- ../webhook to uncomment in the file " +
107
107
"%s." , kustomizeFilePath )
@@ -110,7 +110,7 @@ func (s *webhookScaffolder) Scaffold() error {
110
110
111
111
err = pluginutil .UncommentCode (kustomizeFilePath , "#patches:" , `#` )
112
112
if err != nil {
113
- hasWebHookUncommented , err := pluginutil .HasFragment (kustomizeFilePath , "patches:" )
113
+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (kustomizeFilePath , "patches:" )
114
114
if ! hasWebHookUncommented || err != nil {
115
115
log .Errorf ("Unable to find the line '#patches:' to uncomment in the file " +
116
116
"%s." , kustomizeFilePath )
@@ -119,7 +119,7 @@ func (s *webhookScaffolder) Scaffold() error {
119
119
120
120
err = pluginutil .UncommentCode (kustomizeFilePath , "#- path: manager_webhook_patch.yaml" , `#` )
121
121
if err != nil {
122
- hasWebHookUncommented , err := pluginutil .HasFragment (kustomizeFilePath , "- path: manager_webhook_patch.yaml" )
122
+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (kustomizeFilePath , "- path: manager_webhook_patch.yaml" )
123
123
if ! hasWebHookUncommented || err != nil {
124
124
log .Errorf ("Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file " +
125
125
"%s." , kustomizeFilePath )
@@ -129,7 +129,7 @@ func (s *webhookScaffolder) Scaffold() error {
129
129
crdKustomizationsFilePath := "config/crd/kustomization.yaml"
130
130
err = pluginutil .UncommentCode (crdKustomizationsFilePath , "#- path: patches/webhook" , `#` )
131
131
if err != nil {
132
- hasWebHookUncommented , err := pluginutil .HasFragment (crdKustomizationsFilePath , "- path: patches/webhook" )
132
+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (crdKustomizationsFilePath , "- path: patches/webhook" )
133
133
if ! hasWebHookUncommented || err != nil {
134
134
log .Errorf ("Unable to find the target(s) #- path: patches/webhook/* to uncomment in the file " +
135
135
"%s." , crdKustomizationsFilePath )
@@ -138,7 +138,7 @@ func (s *webhookScaffolder) Scaffold() error {
138
138
139
139
err = pluginutil .UncommentCode (crdKustomizationsFilePath , "#configurations:\n #- kustomizeconfig.yaml" , `#` )
140
140
if err != nil {
141
- hasWebHookUncommented , err := pluginutil .HasFragment (crdKustomizationsFilePath , "- kustomizeconfig.yaml" )
141
+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (crdKustomizationsFilePath , "- kustomizeconfig.yaml" )
142
142
if ! hasWebHookUncommented || err != nil {
143
143
log .Errorf ("Unable to find the target(s) #configurations:\n #- kustomizeconfig.yaml to uncomment in the file " +
144
144
"%s." , crdKustomizationsFilePath )
0 commit comments