-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
skaffold ko builder does not detect changes to go:embed files #7836
Comments
Digging into this a bit, it seems that by default
The information about embedded files is readily available via
So a potential solution here would be to introspect the packages and automatically add embed patterns to the dependencies list? |
Thanks for raising this, and for the repro repo. The dependencies defaults were chosen to be conservative and not fail builds due to patterns that don't match any files. However, if embedded files are not present, then We'll look into this, and also whether it should apply to other builders - e.g., buildpacks when building Go apps. |
Also, @jsok, since you're in Sydney - feel free to drop by here and say hi 😄 https://www.meetup.com/devops-sydney/events/287892691/ |
@halvards, I just found this Github issue because of a similar problem I faced with static assets. I'd appreciate if you could discuss considering them as well. |
Static assets as well as embedded files should be maintained as dependencies for Skaffold, so that every time such a file changes the image is re-built accordingly. See GoogleContainerTools/skaffold#7836.
Static assets as well as embedded files should be maintained as dependencies for Skaffold, so that every time such a file changes the image is re-built accordingly. See GoogleContainerTools/skaffold#7836.
Thanks for the comment @timuthy. To watch static assets you can specify |
Currently, the ko builder does not detect changes to `go:embed` files (see GoogleContainerTools/skaffold#7836). This makes impossible the development of some scripts that are used later by `go:embed`. This PR inspires from gardener/gardener#6735 and gardener/gardener#6781 and does the same setup for the registry-cache extension.
Currently, the ko builder does not detect changes to `go:embed` files (see GoogleContainerTools/skaffold#7836). This makes impossible the development of some scripts that are used later by `go:embed`. This PR inspires from gardener/gardener#6735 and gardener/gardener#6781 and does the same setup for the registry-cache extension.
Currently, the ko builder does not detect changes to `go:embed` files (see GoogleContainerTools/skaffold#7836). This makes impossible the development of some scripts that are used later by `go:embed`. This PR inspires from gardener/gardener#6735 and gardener/gardener#6781 and does the same setup for the registry-cache extension.
* skaffold: Rebuild when there are changes to `go:embed` files Currently, the ko builder does not detect changes to `go:embed` files (see GoogleContainerTools/skaffold#7836). This makes impossible the development of some scripts that are used later by `go:embed`. This PR inspires from gardener/gardener#6735 and gardener/gardener#6781 and does the same setup for the registry-cache extension. * Add skaffold dependency --------- Co-authored-by: Dimitar Kostadinov <[email protected]>
Expected behavior
Making a change to a file embedded by the
embed
package should cause skaffold to produce a new image.Actual behavior
skaffold build
instead logs:and no new image is produced.
Information
Steps to reproduce the behavior
go run github.com/google/go-containerregistry/cmd/registry@latest -port 1338
skaffold build -d localhost:1338
hello.txt
(the embedded file)skaffold build -d localhost:1338
Fixes considered
Adding dependencies to the
skaffold.yaml
like:Does fix the problem, but this is tedious to maintain for larger projects.
ko
natively does not exhibit this behaviour, it picks up embedded file changes and produces new images correctly.The text was updated successfully, but these errors were encountered: