SAP-archive / karydia

Kubernetes Security Walnut
Other
77 stars 10 forks source link

Dependency management: (try to) use 'go mod' as replacement for 'go dep' #125

Open ionysos opened 5 years ago

ionysos commented 5 years ago

Description

Starting in Go 1.13, module mode will be the default for all development.

I think we should try to port our solution with the current use of dep to mod as dependency management.

User Story

As Go(Lang) developer I want to use Go internals in order to discard third-party extensions.

Implementation idea

Try to delete dep dependent files and to create mod required files.

ionysos commented 5 years ago

go-mod branch shows the PoC but, unfortunately, this will lead to a tremendously increased docker image build time because go modules cache need to be warmed up each & every time. This was already discussed at https://github.com/golang/go/issues/26610. If we want to use the discussed go mod download command solution we have to re-think our current build process. Otherwise, this won't lead to better results.

ialidzhikov commented 5 years ago

You can use -mod=vendor which will use the vendor/, not the go modules cache.

ionysos commented 5 years ago

@ialidzhikov Thanks for your comment. Unfortunately, this only works for building the sources but not for (unit) testing them. And the problem which results and which is mentioned here is the result from using it with -mod=vendor.