Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Go modules for apis/cni and apis/cpi #2216

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

akutz
Copy link
Contributor

@akutz akutz commented Apr 21, 2022

What this PR does / why we need it

This patch adds support for treating the API packages for CNI and CPI as distinct Go modules so remote repositories can import these modules without inheriting the entire tanzu-framework dependency graph.

Which issue(s) this PR fixes

Fixes NA

Describe testing done for PR

I built all of the project's Go modules:

$ find . -name go.mod -print0 | \
  xargs -0 dirname | \
  xargs -I% -n1 bash -c 'cd %; echo; echo "building $(pwd)"; time go build ./...; cd - 2>&1 >/dev/null'

building /Users/akutz/Projects/tanzu-framework

real	0m55.398s
user	8m0.626s
sys	1m41.372s

building /Users/akutz/Projects/tanzu-framework/apis/cpi

real	0m1.892s
user	0m1.939s
sys	0m3.881s

building /Users/akutz/Projects/tanzu-framework/apis/cni

real	0m4.307s
user	0m4.804s
sys	0m8.457s

building /Users/akutz/Projects/tanzu-framework/addons

real	0m12.477s
user	0m14.798s
sys	0m13.605s

building /Users/akutz/Projects/tanzu-framework/addons/pinniped/post-deploy

real	0m10.863s
user	0m10.646s
sys	0m9.936s

building /Users/akutz/Projects/tanzu-framework/addons/pinniped/config-controller

real	0m8.444s
user	0m9.629s
sys	0m9.122s

building /Users/akutz/Projects/tanzu-framework/hack/tools
go: warning: "./..." matched no packages

real	0m0.033s
user	0m0.012s
sys	0m0.015s

building /Users/akutz/Projects/tanzu-framework/hack/packages/kbld-image-replace

real	0m2.972s
user	0m3.043s
sys	0m3.320s

building /Users/akutz/Projects/tanzu-framework/hack/packages/package-tools

real	0m1.644s
user	0m1.476s
sys	0m1.893s

building /Users/akutz/Projects/tanzu-framework/pkg/v1/providers/tests

real	0m1.231s
user	0m1.235s
sys	0m2.322s

Release note

package-based-lcm: Changed the apis/cni and apis/cpi packages to be their own Go modules so other projects can import those APIs without pulling in this project's entire dependency graph.

PR Checklist

  • Squash the commits into one or a small number of logical commits
  • Use good commit messages
  • Ensure PR contains terms all contributors can understand and links all contributors can access

Additional information

cc @vijaykatam @sidharthsurana @jmoroski

Special notes for your reviewer

@github-actions
Copy link

Hi @akutz! And thank you for opening your first Pull Request. Someone will review it soon. Thank you for committing to making Tanzu Framework better.

@akutz
Copy link
Contributor Author

akutz commented Apr 21, 2022

Hi @jmoroski / @vijaykatam / @ankeesler,

One odd thing I noticed is the Pinniped config-controller does not reference the parent module by relative path but by a pinned version. Is this on purpose? Ex.

github.com/vmware-tanzu/tanzu-framework v0.18.0

This is anachronistic to how other modules in this repository reference the parent module, ex.

github.com/vmware-tanzu/tanzu-framework => ../

cc @sidharthsurana @mayankbh @ankeesler

Copy link
Contributor

@vijaykatam vijaykatam left a comment

Choose a reason for hiding this comment

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

Thanks for making this change. I think pinniped could refer to relative path as well. Will ping @ankeesler

go.mod Outdated Show resolved Hide resolved
@akutz
Copy link
Contributor Author

akutz commented Apr 21, 2022

Thanks for making this change. I think pinniped could refer to relative path as well. Will ping @ankeesler

Thanks. I already pinged him in the comment up above, but this way he'll definitely see it.

This patch adds support for treating the API packages for CNI
and CPI as distinct Go modules so remote repositories can import
these modules without inheriting the entire tanzu-framework
dependency graph.
Copy link
Contributor

@vijaykatam vijaykatam left a comment

Choose a reason for hiding this comment

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

LGTM.

@vijaykatam vijaykatam added the ok-to-merge PRs should be labelled with this before merging label Apr 21, 2022
@akutz
Copy link
Contributor Author

akutz commented Apr 21, 2022

Thanks for making this change. I think pinniped could refer to relative path as well. Will ping @ankeesler

Thanks. I already pinged him in the comment up above, but this way he'll definitely see it.

FWIW, we resolved offline to separate the changes.

@sidharthsurana
Copy link

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants