-
Notifications
You must be signed in to change notification settings - Fork 395
Cleanups #40
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
Merged
Merged
Cleanups #40
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
never enough about testing 😄 |
$() is substituted by make; $$() by the shell. Also fix policy_reference_match.go to comply. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This improves on the dirReference encapsulation, and makes the methods clearly related to dirReference instead of arbitrary strings. Does not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This improves the ociReference encapsulation, and makes the methods clearly related to ociReference instead of arbitrary strings. Does not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Instead of supplying literals to ensureParentDirectoryExists, first compute the path of the file within the directory using the ociReference methods, and then use that to compute the parent directory path. Should not change behavior, except that filepath.Dir() implicitly calls filepath.Clean(), apparently incompatible with UNIX path semantics. But then we always call filepath.Join() with the same d.ref.dir input, which makes the same implicit call, and Go's handling of symlinks and .. seems close-to-unfixably broken in general, and trying to fix that only here is rather pointless: golang/go#4382 Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This improves the dockerReference encapsulation, and makes it more clear that the reference.IsNameOnly case can not happen. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
In principle this may return incorrect results if the underlying file is replaced between the two calls, in practice computing and looking up the path twice is just unnecessary overhead. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
We should not allow invalid tags even by callers who “know OCI”. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use a helper function for testing unmarshaling of obviously invalid JSON. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Collaborator
Author
|
Rebased, ready for review (but by no means urgent). |
Member
Collaborator
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These are a few trivial cleanups collected while working on #33. Merges/includes #33, I will rebase as necessary.
Test-heavy to the point of ridiculousness, rationale is #39 (comment) .