camel-k
camel-k copied to clipboard
Use `go:embed` instead of vfsgen for embedded resources handling
It makes sense to use a feature from standard library instead of relying on a 3rd party library. Use of go:embed may also save us from periodical regens of resources.go and unexpected issues due to its inconsistency.
The challenges for using go:embed I identified so far are:
-
go:embedonly allows embedding resources under its current dir. It's not possible to load resources in an arbitrary dir frompkg/resources. That should require you to put aresources.gounder both/configand/resourcesdirs and then reference them frompkg/resources. - There is no easy way to ignore arbitrary files with
go:embed. You can only ignore.*and_*files automatically. We'd need to find a way to keep the embedded resources clean and as minimum as possible.- https://github.com/golang/go/issues/42328
- https://github.com/golang/go/issues/42325