Skip to content
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

Merged
merged 4 commits into from
May 17, 2018
Merged

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Apr 25, 2018

Fixes #386
Also Fixes #462

@dgageot dgageot force-pushed the paths branch 6 times, most recently from 141f837 to b1ba745 Compare May 11, 2018 17:05
@dgageot dgageot force-pushed the paths branch 6 times, most recently from bc766c5 to 5d7fe29 Compare May 16, 2018 20:00
dgageot added 3 commits May 17, 2018 18:45
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
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)
Copy link
Contributor

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.

Copy link
Contributor Author

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"},
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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>
@dgageot
Copy link
Contributor Author

dgageot commented May 17, 2018

@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.

@tejal29 tejal29 merged commit 17013a5 into GoogleContainerTools:master May 17, 2018
@dgageot dgageot deleted the paths branch May 29, 2018 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants