Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying custom build tags for the generated deepcopy files #871

Open
irbekrm opened this issue Dec 24, 2023 · 5 comments
Open

Allow specifying custom build tags for the generated deepcopy files #871

irbekrm opened this issue Dec 24, 2023 · 5 comments
Assignees

Comments

@irbekrm
Copy link

irbekrm commented Dec 24, 2023

It would be great if it was possible to specify custom Go build tags to be passed to deep copy generation, in the same way as it is currently possible to pass a custom header to be used, i.e

go run  sigs.k8s.io/controller-tools/cmd/controller-gen  \
	object:headerFile=<header-file-path> \
        object:buildTags="!plan9,!windows" \
        paths=./k8s-operator/apis/...

For the context - our Kubernetes custom resources live in a monorepo with our main application codebase, which is not Kubernetes specific. We build and run tests for various platforms, including plan9.

In our Kubernetes-specific code we need to import apimachinery library, but that contains code that cannot be built on plan9, i.e syscall.Errno here, so we exclude the Kubernetes-specific code from plan9 builds/tests with a !plan9 Go build tag.

Currently there is no way how to pass build tags to the generated deepcopy files, so we end up using a sed script to modify these files after they have been generated- this is a bit hacky and also prevents us from being able to generate deepcopy files using go generate which would be our preferred way.

I would be happy to PR a new flag to deepcopy generator for this.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 23, 2024
@sbueringer
Copy link
Member

Sounds reasonable if it's doable without adding too much additional complexity (I'm not familiar with the current implementation)

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 3, 2024
@irbekrm
Copy link
Author

irbekrm commented May 3, 2024

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 3, 2024
@irbekrm
Copy link
Author

irbekrm commented May 3, 2024

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants