Add go mod vendor to atc.dev.sh #7180
Conversation
zrhoffman
left a comment
There was a problem hiding this comment.
The thing about adding go mod vendor to the t3c service is that the trafficops and trafficmonitor services also fail to build binaries and run i go mod vendor is not run for them.
So maybe the trafficops and trafficmonitor services could add a check to see if vendor/golang.org/x and vendor/modules.txt (which indicates that vendoring is complete) exist, and if not, wait until it does before continuing?
| if [ ! -d "vendor/golang/x" ]; then | ||
| go mod vendor | ||
| fi | ||
| docker-compose up -d --build |
There was a problem hiding this comment.
If atc-build is run before docker-compose up, go mod vendor can be run in a container so the user doesn't need go (or the latest go version)
There was a problem hiding this comment.
So run go mod vendor in the traffic ops Dockerfile?
There was a problem hiding this comment.
Nah, running go mod vendor from one of the docker-compose services using docker-compose run
There was a problem hiding this comment.
so, go mod vendor would go between docker-compose build and docker-compose up
There was a problem hiding this comment.
Not sure I understand, but if you want to just add it to your open PR: #7142 I can close this and review that.
Adds the
go mod vendorcommand to the t3crun.shfile, for when a user has a clean repo t3c won't fail to start up due to missing packagesWhich Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Have a clean repo or delete /vendor/golang.org/x/
Should find that t3c starts correctly and you will see /vendor/golang.org/x/ has been created and contains packages
PR submission checklist