Thanks to visit codestin.com
Credit goes to github.com

Skip to content

deepcopy-gen: remove dead --bounding-dirs flag#137348

Open
Jefftree wants to merge 1 commit intokubernetes:masterfrom
Jefftree:deepcopy-fix
Open

deepcopy-gen: remove dead --bounding-dirs flag#137348
Jefftree wants to merge 1 commit intokubernetes:masterfrom
Jefftree:deepcopy-fix

Conversation

@Jefftree
Copy link
Member

@Jefftree Jefftree commented Mar 2, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Removes the dead --bounding-dirs flag and BoundingDirs field from deepcopy-gen.

This flag was added by @thockin back in 2016 (kubernetes/gengo@14ae879) to control which nested types deepcopy-gen could assume had generated DeepCopy functions. It got dropped when deepcopy-gen was rewritten for gengo v2 and moved to code-generator — the field and flag survived but g.boundingDirs is never actually read anywhere in the current code.

hack/update-codegen.sh still passed --bounding-dirs "k8s.io/kubernetes,k8s.io/api" but it had no effect.

Which issue(s) this PR is related to:

Discovered this while trying to use a similar bounding dir concept to address kubernetes/kube-openapi#571.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Removes the dead `--bounding-dirs` flag and `BoundingDirs` field from deepcopy-gen.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

The --bounding-dirs flag and BoundingDirs field in deepcopy-gen are dead
code. The field is stored on the genDeepCopy struct but never read by
any method.

The flag was introduced in gengo commit 14ae879 (2016) to control which
types deepcopy would generate for and which nested types it could assume
had generated deepcopy functions. Over time, as deepcopy-gen was
rewritten (gengo v2, moved to code-generator), the copyableAndInBounds /
isRootedUnder usage was dropped. The field and flag survived but
g.boundingDirs is never referenced in the current code.

hack/update-codegen.sh still passed --bounding-dirs but it had no
effect.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 2, 2026
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Mar 2, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Jefftree
Once this PR has been reviewed and has the lgtm label, please assign sttts 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/code-generation sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 2, 2026
@k8s-ci-robot k8s-ci-robot requested review from deads2k and pohly March 2, 2026 19:54
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 2, 2026
@Jefftree
Copy link
Member Author

Jefftree commented Mar 2, 2026

/assign @thockin @jpbetz

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

Labels

area/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants