Skip to content

Commit fe57ef9

Browse files
authored
Merge pull request #5257 from BadisLaffet1/docs-fix-webhook-config-collapse-main
📖 (docs): Show webhook configuration in cronjob tutorial
2 parents a0708da + 1e6d613 commit fe57ef9

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,3 @@ func main() {
240240
os.Exit(1)
241241
}
242242
}
243-
244-
// +kubebuilder:docs-gen:collapse=Remaining code from main.go

hack/docs/internal/cronjob-tutorial/generate_cronjob.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,6 @@ CronJob controller's`+" `"+`SetupWithManager`+"`"+` method.
367367
os.Exit(1)
368368
}`, mainEnableWebhook)
369369
hackutils.CheckError("fixing main.go", err)
370-
371-
err = pluginutil.InsertCode(
372-
filepath.Join(sp.ctx.Dir, "cmd/main.go"),
373-
`setupLog.Error(err, "problem running manager")
374-
os.Exit(1)
375-
}
376-
}`, `
377-
// +kubebuilder:docs-gen:collapse=Remaining code from main.go`)
378-
hackutils.CheckError("fixing main.go", err)
379370
}
380371

381372
func (sp *Sample) updateMakefile() {

hack/docs/internal/multiversion-tutorial/generate_multiversion.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -682,24 +682,6 @@ CronJob controller's `+"`SetupWithManager`"+` method.
682682
*/`,
683683
)
684684
hackutils.CheckError("replace webhook setup explanation main.go", err)
685-
686-
err = pluginutil.InsertCode(
687-
filepath.Join(sp.ctx.Dir, path),
688-
`setupLog.Error(err, "problem running manager")
689-
os.Exit(1)
690-
}
691-
}`, `
692-
// +kubebuilder:docs-gen:collapse=Remaining code from main.go`,
693-
)
694-
hackutils.CheckError("update main.go with final collapse marker", err)
695-
696-
err = pluginutil.ReplaceInFile(
697-
filepath.Join(sp.ctx.Dir, path),
698-
`// +kubebuilder:docs-gen:collapse=Remaining code from main.go
699-
700-
// +kubebuilder:docs-gen:collapse=Remaining code from main.go`, ``,
701-
)
702-
hackutils.CheckError("update main.go to remove final collapses", err)
703685
}
704686

705687
func (sp *Sample) updateAPIV2() {

0 commit comments

Comments
 (0)