Skip to content

Use YEAR in hack/boilerplate.go.txt as a literal for the current year#272

Open
felix-kaestner wants to merge 1 commit intomainfrom
license-header
Open

Use YEAR in hack/boilerplate.go.txt as a literal for the current year#272
felix-kaestner wants to merge 1 commit intomainfrom
license-header

Conversation

@felix-kaestner
Copy link
Copy Markdown
Contributor

@felix-kaestner felix-kaestner commented Mar 31, 2026

The YEAR string in the boilerplate header file will be replaced by
controller-gen1 and kubebuilder2.

This change also requires to define a YEAR variable in the Makefile
(holding the current year) which is passed as year=$(YEAR) to the
controller-gen crd generation. The applyconfiguration generator of
controller-gen handles this substitution automatically by using
kubernetes/gengo3 and does not need the explicit parameter.

This change is possible through a recent addition in
go-makefile-maker4.

Footnotes

  1. https://github.com/kubernetes-sigs/controller-tools/commit/54a2e9f1ac63927545179bb8cd82aff15540a418

  2. https://github.com/kubernetes-sigs/kubebuilder/commit/890b11808e0d932de4dcc92a742e5b7f0c532298

  3. https://github.com/kubernetes/gengo/blob/5ee0d033ba5bcb073f0e69c32057520b82d75ccb/v2/execute.go#L59

  4. https://github.com/sapcc/go-makefile-maker/pull/477

@felix-kaestner felix-kaestner requested a review from a team as a code owner March 31, 2026 10:44
@felix-kaestner felix-kaestner marked this pull request as draft March 31, 2026 10:45
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Apr 1, 2026
@hardikdr hardikdr added this to Roadmap Apr 1, 2026
@felix-kaestner felix-kaestner force-pushed the license-header branch 2 times, most recently from 69f8246 to b7fc096 Compare May 5, 2026 13:26
@felix-kaestner felix-kaestner marked this pull request as ready for review May 5, 2026 13:27
@github-actions github-actions Bot added size/L and removed size/S labels May 5, 2026
The YEAR string in the boilerplate header file will be replaced by
controller-gen[^1] and kubebuilder[^2].

This change also requires to define a YEAR variable in the Makefile
(holding the current year) which is passed as year=$(YEAR) to the
controller-gen crd generation. The applyconfiguration generator of
controller-gen handles this substitution automatically by using
kubernetes/gengo[^3] and does not need the explicit parameter.

This change is possible through a recent addition in
go-makefile-maker[^4].

[^1]: kubernetes-sigs/controller-tools@54a2e9f
[^2]: kubernetes-sigs/kubebuilder@890b118
[^3]: https://github.com/kubernetes/gengo/blob/5ee0d033ba5bcb073f0e69c32057520b82d75ccb/v2/execute.go#L59
[^4]: sapcc/go-makefile-maker#477

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/api/core/v1alpha1 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/core/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/S

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants