Make the hot-reload example more exemplary #1680
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While investigating #1668 I found myself modifying the hot-reload example to actually test how sync works in 0.22, and doesn't in 0.23/master. The example is a little too succinct to understand how hot-reload works:
First off the example syncs exactly one source file. The Dockerfile does copy a glob, but the destination isn't a folder, so adding a second source file sibling crashes the build.
Secondly I was suspecting that nested folders might be the issue, so i added a src folder, which is probably closer to a real world example anyways. It also clarifies that the pattern isn't recursive like .gitignore (unless the folder name matches, then it's actually traversed), even though the k8s path does hint at that.
Now when the Dockerfile and sync pattern no longer exactly overlap, you can easily test that only files intersected by the Dockerfile and sync pattern are synced, files included by the Dockerfile but not the sync pattern fall back to docker build, and files matched by the pattern but outside the Dockerfile are ignored.
In hindsight it feels kinda obvious, but we'll probably end up with fewer issues on hot-reload with an example that is a little more verbose.
My comment on #1668 is probably a separate issue
/jonas
Signed-off-by: Jonas Eckerström jonaseck@gmail.com