GoogleContainerTools / GoogleContainerTools/skaffold

Prebuild hook always run

Open
#8,654 2 comments 0 reactions 0 assignees View on GitHub
area/hooks needs-reproduction priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

The pre/post build hooks created from https://github.com/GoogleContainerTools/skaffold/issues/1441 are a great addition. I would like to improve upon this further to always run certain hooks or add another hook.

Example:
I am building Docker images. As far as I know, the build phase parses all the contents of the docker image and generates a hash. We are building Golang apps that run within a docker container. If the Go code has changed, it will not rebuild. We can issue a go build for each command before running skaffold build. This is fine for a small project with only one service or a couple services. This becomes an issue for 20+ services in a monorepo. An optimization we are using is building all binaries at the same time. This speeds up generation of all the binaries using Go's internal cache by loading all the modules. Example here: https://github.com/ko-build/ko/issues/314

### Expected behavior

Always run the prebuild hook or define a new hook that always runs. This would run prior to the build phase that checks the hash.

### Actual behavior

The prebuild hook only runs if the build needs to run

### Information

- Skaffold version: v2.3.0
- Operating system: Mac
- Installed via: brew

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.