-
Notifications
You must be signed in to change notification settings - Fork 188
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
find_git_info propogates an error when ADDed file is not found in Dockerfile #642
Comments
@ForgetMe17 Can you take a look at this? It's my understanding that if the file doesn't exist, |
The following change fixes the first issue:
Explanation of changes:
Once the above changes are merged -- another error occurs finding the git_url:
The fix for the above error is the same as the first -- we must get the absolute path of the
With the above changes, we can get the correct comment appended to the ADD line in the Dockerfile:
|
The Dockerfile lock feature in Tern attempts to find git information for files that are ADDed in the pinned Dockerfile. This commit fixes a bug in the check_git_src() and get_git_url() functions in tern/analyze/common.py. Instead of using the relative path of the file that is ADDed in the pinned Dockerfile (i.e. just the name of the file), we must use the absolute path, relative to where the user is invoking Tern. This commit also adds a FileNotFoundError exception to check_git_src() and get_git_url(). Resolves tern-tools#642 Signed-off-by: Rose Judge <rjudge@vmware.com>
Nevermind, I was able to look at this today :) |
Thanks for finding this bug and help me fix it. i miss it somehow |
The Dockerfile lock feature in Tern attempts to find git information for files that are ADDed in the pinned Dockerfile. This commit fixes a bug in the check_git_src() and get_git_url() functions in tern/analyze/common.py. Instead of using the relative path of the file that is ADDed in the pinned Dockerfile (i.e. just the name of the file), we must use the absolute path, relative to where the user is invoking Tern. This commit also adds a FileNotFoundError exception to check_git_src() and get_git_url(). Resolves #642 Signed-off-by: Rose Judge <rjudge@vmware.com>
We also missed this while reviewing the PR :) It is all part of the development process. |
The Dockerfile lock feature in Tern attempts to find git information for files that are ADDed in the pinned Dockerfile. This commit fixes a bug in the check_git_src() and get_git_url() functions in tern/analyze/common.py. Instead of using the relative path of the file that is ADDed in the pinned Dockerfile (i.e. just the name of the file), we must use the absolute path, relative to where the user is invoking Tern. This commit also adds a FileNotFoundError exception to check_git_src() and get_git_url(). Resolves tern-tools#642 Signed-off-by: Rose Judge <rjudge@vmware.com>
Describe the bug
Using this Dockerfile I ran
tern lock Dockerfile
and the ADD command in the file broke Tern's run while it was trying to find the git information.To Reproduce
Steps to reproduce the behavior:
tern
directory to match the above file (hint: add the `ADD Dockerfile /tmp line)Error in terminal
Expected behavior
Tern should handle the error if the file doesn't exist and append
Environment you are running Tern on
Enter all that apply
The text was updated successfully, but these errors were encountered: