Description
Currently, all projects generated for documentation/tutorials are created automatically via commands and scripts under hack/docs
. This automation helps keep our documentation up to date without needing manual intervention.
When we run make generate
, it triggers make generate-docs
, which re-generates these example projects and syncs them with the documentation.
The Problem
We have a hardcoded version of controller-runtime
in the following line:
This causes make generate-docs
to fail when we bump the controller-runtime version in the scaffold logic. For example, updating this constant:
From:
ControllerRuntimeVersion = "v0.20.4"
To a newer version may result in errors like:
ERRO error fixing cronjob_controller.go: string // - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile not found in /* Copyright 2025 The Kubernetes authors.
What Needs to Be Done
We should improve the logic in hack/docs
so that it's not tied to a hardcoded controller-runtime version.
We could either:
- Remove the need for the manual replacement in the first place
- OR dynamically use the version from the
ControllerRuntimeVersion
constant in the scaffolding code
This would prevent future breakages when we upgrade dependencies and keep make generate-docs
stable and version-aware.