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

🐛 Fix testdata imports in pkg/webhook/conversion #843

Merged
merged 1 commit into from
Mar 7, 2020

Conversation

munnerz
Copy link
Member

@munnerz munnerz commented Mar 6, 2020

The import path used here is incorrect, and there is no go.mod included in the root of this testdata directory to indicate its module name is testdata.kb.io (and I'm not actually certain this is a valid module path as it does not contain a /.

Additionally, the api/v1 package itself imports v2 as sigs.k8s.io/controller-runtime/pkg/webhook/conversion/testdata/api/v2: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/webhook/conversion/testdata/api/v1/externaljob_types.go#L23

I noticed this because Bazel attempts to resolve this import path in my project, and fails to resolve it to a real repository, leading to confusing log output when analysing our dependencies 😅

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 6, 2020
@munnerz
Copy link
Member Author

munnerz commented Mar 6, 2020

/retest

Copy link
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.

Noticed this some time ago as well, what mostly confuses me is why this works 🤔

Copy link
Contributor

@djzager djzager left a comment

Choose a reason for hiding this comment

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

I have no power here, just like reviewing PRs. 😎

pkg/webhook/conversion/testdata/main.go Show resolved Hide resolved
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz, vincepri

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

The pull request process is described here

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 6, 2020
@vincepri vincepri added this to the v0.5.x milestone Mar 6, 2020
@munnerz
Copy link
Member Author

munnerz commented Mar 6, 2020

Addressed feedback - can someone add a lgtm? 😄

@munnerz
Copy link
Member Author

munnerz commented Mar 6, 2020

Noticed this some time ago as well, what mostly confuses me is why this works 🤔

Anything in a testdata directory or a directory beginning with _ will be ignored by the go tool, and I think this main.go is not actually used by test cases (or at least, not built 😅)

Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2020
@k8s-ci-robot k8s-ci-robot merged commit d0de78d into kubernetes-sigs:master Mar 7, 2020
@munnerz munnerz deleted the patch-1 branch March 9, 2020 15:15
munnerz added a commit to munnerz/cert-manager that referenced this pull request Mar 9, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants