Skip to content

Enable go multi-module workspace#4035

Merged
kubevirt-bot merged 3 commits into
kubevirt:mainfrom
awels:go-workspace
Mar 13, 2026
Merged

Enable go multi-module workspace#4035
kubevirt-bot merged 3 commits into
kubevirt:mainfrom
awels:go-workspace

Conversation

@awels
Copy link
Copy Markdown
Member

@awels awels commented Feb 10, 2026

What this PR does / why we need it:
Similar to KubeVirt kubevirt/kubevirt#14485 set up go workspace so we don't have the symlink to staging anymore. This will ensure hermeto no longer complains about changes to the modules.txt

Fixes https://issues.redhat.com/browse/CNV-60075

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Feb 10, 2026
@awels awels force-pushed the go-workspace branch 2 times, most recently from 7250fe2 to 1b4fe7f Compare February 11, 2026 14:37
@awels
Copy link
Copy Markdown
Member Author

awels commented Feb 11, 2026

/test pull-containerized-data-importer-fossa

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 11, 2026

Coverage Status

coverage: 49.337% (+0.04%) from 49.3%
when pulling ab6a282 on awels:go-workspace
into 2acfe66 on kubevirt:main.

@awels
Copy link
Copy Markdown
Member Author

awels commented Feb 11, 2026

/test pull-containerized-data-importer-fossa

@awels
Copy link
Copy Markdown
Member Author

awels commented Feb 18, 2026

/cc @akalenyu

Copy link
Copy Markdown
Collaborator

@akalenyu akalenyu left a comment

Choose a reason for hiding this comment

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

in general looks fine just worried about the sed dance around the group name

Comment thread hack/update-codegen.sh Outdated
${SCRIPT_ROOT}/bin/openapi-spec-generator >${SCRIPT_ROOT}/api/openapi-spec/swagger.json

echo "************* running controller-gen to generate schema yaml ********************"
# controller-gen fails on vendored k8s.io/api/core/v1/doc.go due to empty +groupName= marker (see https://github.com/kubernetes/kubernetes/issues)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this was supposed to be a link to a particular issue or just the landing page?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in any case how come we hit this here? api version bump? why not bump controller-gen in that case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah you are right, I updated codegen and the marker issue went away.

Comment thread go.work
@@ -0,0 +1,7 @@
go 1.24.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I picked this line randomly to start the discussion. I noticed we are missing 2 things from the kubevirt referenced PR:

I just want to make sure this is fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So the bazel file changes are related to client-go which we don't use, we use the runtime controller library instead which doesn't have the issue that is being solved. As for the symlink, I think that is fixing a specific kubevirt issue, that I don't think CDI has, so it didn't make sense to do that.

@akalenyu
Copy link
Copy Markdown
Collaborator

@Acedus I think you had a PR to kubevirt saving it from some go work consequence?

@Acedus
Copy link
Copy Markdown
Contributor

Acedus commented Feb 18, 2026

@Acedus I think you had a PR to kubevirt saving it from some go work consequence?

Yeah it was a bug in go cmd that I fixed at the time: golang/go@1ebebf1 but I see that it only made it in 1.26, might be worth to see if my workaround applies here: kubevirt/kubevirt#14951

@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 6, 2026

I just tried make clean with this PR and it worked without issues, maybe I am missing something, but everything appears to work as expected.

Comment thread Makefile Outdated
Comment on lines +96 to +97
revert-deps-replace:
git checkout -- ${PWD}/vendor/k8s.io/api/core/v1/doc.go
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we don't need this anymore right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right

Copy link
Copy Markdown
Collaborator

@akalenyu akalenyu left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 8, 2026
@kubevirt-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akalenyu

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

The pull request process is described 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2026
Comment thread vendor/k8s.io/api/core/v1/doc.go Outdated
// +k8s:protobuf-gen=package
// +k8s:prerelease-lifecycle-gen=true
// +groupName=
// +groupName=core
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

guess you also want this reverted

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes....

@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2026
@akalenyu
Copy link
Copy Markdown
Collaborator

akalenyu commented Mar 9, 2026

@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 9, 2026

Maybe, I guess I am making a new PR that bumps to controller gen version in the builder.

@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 9, 2026

Create a PR to update the builder #4051

awels added 2 commits March 11, 2026 09:26
Similar to KubeVirt kubevirt/kubevirt#14485
set up go workspace so we don't have the symlink
to staging anymore. This will ensure hermeto no
longer complains about changes to the modules.txt

Signed-off-by: Alexander Wels <[email protected]>
@akalenyu
Copy link
Copy Markdown
Collaborator

I think were missing a make generate and otherwise should be good to go

controller gen

Signed-off-by: Alexander Wels <[email protected]>
@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 12, 2026

yeah, ran the make generate, should be good now.

@akalenyu
Copy link
Copy Markdown
Collaborator

/lgtm
/retest

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2026
@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 13, 2026

/test pull-containerized-data-importer-fossa

@kubevirt-bot kubevirt-bot merged commit 047a824 into kubevirt:main Mar 13, 2026
21 checks passed
@awels
Copy link
Copy Markdown
Member Author

awels commented Mar 24, 2026

/cherry-pick release-v1.64

@kubevirt-bot
Copy link
Copy Markdown
Contributor

@awels: #4035 failed to apply on top of branch "release-v1.64":

Applying: Enable go multi-module workspace
Using index info to reconstruct a base tree...
M	Makefile
M	hack/update-codegen.sh
M	pkg/operator/resources/crds_generated.go
M	staging/src/kubevirt.io/containerized-data-importer-api/go.mod
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Removing vendor/kubevirt.io/containerized-data-importer-api
Auto-merging staging/src/kubevirt.io/containerized-data-importer-api/go.mod
Auto-merging pkg/operator/resources/crds_generated.go
Auto-merging hack/update-codegen.sh
Auto-merging Makefile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Enable go multi-module workspace

Details

In response to this:

/cherry-pick release-v1.64

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.

awels added a commit to awels/containerized-data-importer that referenced this pull request Apr 2, 2026
* Enable go multi-module workspace

Similar to KubeVirt kubevirt/kubevirt#14485
set up go workspace so we don't have the symlink
to staging anymore. This will ensure hermeto no
longer complains about changes to the modules.txt

Signed-off-by: Alexander Wels <[email protected]>

* Re-add vendoring in containerized-data-importer-api

Signed-off-by: Alexander Wels <[email protected]>

* Updated the cdi builder to include the new
controller gen

Signed-off-by: Alexander Wels <[email protected]>

---------

Signed-off-by: Alexander Wels <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants