-
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
Improve Docker dependencies code #466
Conversation
141f837
to
b1ba745
Compare
bc766c5
to
5d7fe29
Compare
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
pkg/skaffold/docker/context_test.go
Outdated
os.Mkdir(filepath.Join(tmpDir, "files"), 0750) | ||
ioutil.WriteFile(filepath.Join(tmpDir, "files", "ignored.txt"), []byte(""), 0644) | ||
ioutil.WriteFile(filepath.Join(tmpDir, "files", "included.txt"), []byte(""), 0644) | ||
ioutil.WriteFile(filepath.Join(tmpDir, ".dockerignore"), []byte("**/ignored.txt"), 0644) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test case for #386.
Add a line to .dockerignore with "alsoignored.txt" and create a file alsoignored.txt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that, thanks for the idea!
@@ -159,7 +159,7 @@ func TestGetDockerfileDependencies(t *testing.T) { | |||
description: "add dependency", | |||
dockerfile: addDockerfile, | |||
workspace: "docker", | |||
expected: []string{"docker/Dockerfile", "docker/nginx.conf"}, | |||
expected: []string{"Dockerfile", "nginx.conf"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is worry some for me. I don't have a lot of context, but earlier GetDockerfileDependencies used to return absolute paths.
Now you dont. Would this not break the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't but yes, that's a big change. One that's needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep things as relative as possible. Each time we switch to absolute paths, it's a mess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i agree absolute paths are a mess.
Will take one more look.
Signed-off-by: David Gageot <david@gageot.net>
@tejal29 I've added the test. Regarding the paths, I spend quite some time trying to fix our path madness and keeping relative paths as much as possible was the best solution I found. There's more work to be done on the kubectl deployer side. |
Fixes #386
Also Fixes #462