Skip to content

🐛 (applyconfiguration): Add year option to generator to ensure consistency behaviour#1379

Open
camilamacedo86 wants to merge 1 commit into
kubernetes-sigs:mainfrom
camilamacedo86:add-year-backwords
Open

🐛 (applyconfiguration): Add year option to generator to ensure consistency behaviour#1379
camilamacedo86 wants to merge 1 commit into
kubernetes-sigs:mainfrom
camilamacedo86:add-year-backwords

Conversation

@camilamacedo86
Copy link
Copy Markdown
Member

@camilamacedo86 camilamacedo86 commented Apr 18, 2026

Adds optional year parameter to applyconfiguration generator to match behavior of other generators (CRD, webhook, rbac, deepcopy). When specified, replaces " YEAR" placeholder in header file with given year.

More importantly, this creates inconsistency with controller-gen, which causes problems for users.

.PHONY: generate
generate: controller-gen
	"$(CONTROLLER_GEN)" object:headerFile="hack/boilerplate.go.txt",year=$(YEAR) \
	applyconfiguration:headerFile="hack/boilerplate.go.txt" paths="./..."

With this setup, some outputs, such as CRDs, behave differently from others, such as SSA. The result is inconsistent generated files. Be aware that a project can have both scenarios, CRDs with or not SSA annotations.

Then, this should be consistent across all generators. Otherwise, it is confusing for users and is a bug.

Fixes #1371

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: camilamacedo86
Once this PR has been reviewed and has the lgtm label, please assign joelanford for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 18, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 18, 2026
@camilamacedo86
Copy link
Copy Markdown
Member Author

@JoelSpeed I think this one is your baby :-)

@k8s-triage-robot
Copy link
Copy Markdown

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.

/check-cla
/easycla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 18, 2026
Copy link
Copy Markdown
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

For the discussion in #1371

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 18, 2026
@camilamacedo86
Copy link
Copy Markdown
Member Author

camilamacedo86 commented Apr 19, 2026

Hi @alvaroaleman

Thank you for looking on this one.
But it is problematic, I added in the header and in the issue why it is problematic
The problem is in a project we can have both scenarios, with SSA and not then it does not work well.

Consistent behaviour is a key and expected.
So, I do see only 2 options here:

  • a) Fix and ensure consistency
  • b) No longer support pass the YEAR in any. (but that would be breaking change and besides k8s no longer care about the YEAR anymore, many end users and projects care so I would not go in this direction)

@camilamacedo86 camilamacedo86 changed the title 🐛 Add year option to applyconfiguration generator to ensure consistency behaviour 🐛 (applyconfiguration): Add year option to generator to ensure consistency behaviour Apr 20, 2026
@Vaishnav88sk
Copy link
Copy Markdown

I see this has a do-not-merge/hold on it, is there an open question this is blocked on, or just waiting for review? Happy to take a closer look once the hold is resolved.

@camilamacedo86
Copy link
Copy Markdown
Member Author

Hi @Vaishnav88sk

I see this has a do-not-merge/hold on it, is there an open question this is blocked on, or just waiting for review? Happy to take a closer look once the hold is resolved.

@alvaroaleman blocked it for discussion: #1379 (review)

As I described in #1379 (comment) IMO it is a bug and must be done or we should not support the YEAR at all.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent handling of YEAR substitution across generators

5 participants