@@ -101,7 +101,7 @@ func (s *webhookScaffolder) Scaffold() error {
101101 kustomizeFilePath := "config/default/kustomization.yaml"
102102 err = pluginutil .UncommentCode (kustomizeFilePath , "#- ../webhook" , `#` )
103103 if err != nil {
104- hasWebHookUncommented , err := pluginutil .HasFragment (kustomizeFilePath , "- ../webhook" )
104+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (kustomizeFilePath , "- ../webhook" )
105105 if ! hasWebHookUncommented || err != nil {
106106 log .Errorf ("Unable to find the target #- ../webhook to uncomment in the file " +
107107 "%s." , kustomizeFilePath )
@@ -110,7 +110,7 @@ func (s *webhookScaffolder) Scaffold() error {
110110
111111 err = pluginutil .UncommentCode (kustomizeFilePath , "#patches:" , `#` )
112112 if err != nil {
113- hasWebHookUncommented , err := pluginutil .HasFragment (kustomizeFilePath , "patches:" )
113+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (kustomizeFilePath , "patches:" )
114114 if ! hasWebHookUncommented || err != nil {
115115 log .Errorf ("Unable to find the line '#patches:' to uncomment in the file " +
116116 "%s." , kustomizeFilePath )
@@ -119,7 +119,7 @@ func (s *webhookScaffolder) Scaffold() error {
119119
120120 err = pluginutil .UncommentCode (kustomizeFilePath , "#- path: manager_webhook_patch.yaml" , `#` )
121121 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" )
123123 if ! hasWebHookUncommented || err != nil {
124124 log .Errorf ("Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file " +
125125 "%s." , kustomizeFilePath )
@@ -129,7 +129,7 @@ func (s *webhookScaffolder) Scaffold() error {
129129 crdKustomizationsFilePath := "config/crd/kustomization.yaml"
130130 err = pluginutil .UncommentCode (crdKustomizationsFilePath , "#- path: patches/webhook" , `#` )
131131 if err != nil {
132- hasWebHookUncommented , err := pluginutil .HasFragment (crdKustomizationsFilePath , "- path: patches/webhook" )
132+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (crdKustomizationsFilePath , "- path: patches/webhook" )
133133 if ! hasWebHookUncommented || err != nil {
134134 log .Errorf ("Unable to find the target(s) #- path: patches/webhook/* to uncomment in the file " +
135135 "%s." , crdKustomizationsFilePath )
@@ -138,7 +138,7 @@ func (s *webhookScaffolder) Scaffold() error {
138138
139139 err = pluginutil .UncommentCode (crdKustomizationsFilePath , "#configurations:\n #- kustomizeconfig.yaml" , `#` )
140140 if err != nil {
141- hasWebHookUncommented , err := pluginutil .HasFragment (crdKustomizationsFilePath , "- kustomizeconfig.yaml" )
141+ hasWebHookUncommented , err := pluginutil .HasFileContentWith (crdKustomizationsFilePath , "- kustomizeconfig.yaml" )
142142 if ! hasWebHookUncommented || err != nil {
143143 log .Errorf ("Unable to find the target(s) #configurations:\n #- kustomizeconfig.yaml to uncomment in the file " +
144144 "%s." , crdKustomizationsFilePath )
0 commit comments