Tianon Gravi
143301cc9e
Merge github.com/docker-library/go-dockerlibrary into bashbrew
...
This adjusts import paths, go.mod, and adds a new "Dockerfile.test" to run the unit tests.
2020-08-19 16:21:07 -07:00
Tianon Gravi
718495e812
As a first step towards line-based manifest file deprecation, stop returning line-based parsing errors
2020-08-19 13:49:08 -07:00
Tianon Gravi
3ff8c5ce0d
Add "(Shared)Tags" validation
2019-06-26 16:47:34 -07:00
Tianon Gravi
c37ef753c4
Update test to verify "path.Clean" behavior
2019-06-18 16:21:09 -07:00
Tianon Gravi
23fe0d7295
Adjust "GitCommitRegex" to account for potential future sha256 commit IDs
2019-06-18 16:18:51 -07:00
Tianon Gravi
ab12b4904b
Fix "path.Clean" behavior to take arch-specific Directory values into account too
2019-06-18 16:18:28 -07:00
Tianon Gravi
7d4d3222cd
Invoke "path.Clean" on "Directory" values in go-dockerlibrary itself (instead of only doing so just before "git archive" inside bashbrew)
2019-06-05 15:49:21 -07:00
Tianon Gravi
7e50189a05
Use pointers more consistently, allow "fetch" tag validation to check SharedTags too
2019-01-28 16:03:21 -08:00
Tianon Gravi
3c2181232e
Force line-based files to have valid "Maintainers" too
...
This copies the exact `mainfest.Global.Maintainers` validation from `rfc2822.go`.
2019-01-07 16:12:21 -08:00
Tianon Gravi
49776e367d
Adjust test to instead use the same example manifest for consistency
2018-07-25 14:30:21 -07:00
Giuseppe Valente
5cfb31e65b
manifest: test non-default arch
2018-04-25 16:06:23 -07:00
Giuseppe Valente
3532dbec44
manifest: test ArchFile()
2018-04-25 15:54:15 -07:00
Giuseppe Valente
3f4644cf4f
manifest: add File: attribute
...
It is useful to have multiple dockerfiles in a single directory, if for
example multiple apps need to have access to the root of the repo to be
built.
2018-04-13 16:11:33 -07:00
Tianon Gravi
21d68d83eb
Add Architectures sorting, deduplication, and validation
2017-06-13 14:34:23 -07:00
Tianon Gravi
ce6f973ced
Add new functions to ensure global arch-specific values are inherited properly
2017-06-05 12:54:57 -07:00
Tianon Gravi
663a091da1
Add a few missing bits
2017-06-01 16:37:35 -07:00
Tianon Gravi
08c08a33e1
Add GitRepo and GitCommit setters
2017-06-01 14:58:09 -07:00
Tianon Gravi
68838fa86d
Add new "DefaultArchitecture" value
2017-06-01 14:24:33 -07:00
Tianon Gravi
6c0c78bdb5
Fix the case of default Architectures being added to any Global Architectures
2017-06-01 14:13:35 -07:00
Tianon Gravi
d84bfcca38
Add a few new fields for slightly more code coverage
2017-06-01 11:38:22 -07:00
Tianon Gravi
40117df115
Add more tweaks, functionality, and tests to the Architectures implementation
2017-06-01 11:16:29 -07:00
Joe Ferguson
76cdafaca6
Add arch-specific fields
2017-05-24 16:12:36 -07:00
Tianon Gravi
ae1ac322eb
Add a simple test for a "manifest.Parse" error
2017-05-02 10:36:50 -07:00
Tianon Gravi
5c0cbe7322
Add an example of reading a local manifest file too
2017-04-03 15:37:39 -07:00
Tianon Gravi
02a23d8a95
Increase coverage further by adding an example for "manifest.Fetch"
2017-04-03 15:29:23 -07:00
Tianon Gravi
6355cdbae8
Apply gofmt
2017-04-03 15:20:35 -07:00
Tianon Gravi
ef736bc836
Add example Constraints for another 0.4% test coverage increase
2017-04-03 15:17:09 -07:00
Tianon Gravi
499d4731a3
Add "line-based" maintainers to our example for a 0.4% coverage increase
2017-04-03 15:13:42 -07:00
Tianon Gravi
9536e92ebd
Convert "example.go" into a real Go "Example" function (77% test coverage right off the bat!)
2017-04-03 15:10:40 -07:00
Tianon Gravi
ff63f9df03
Fix GetSharedTagGroups ordering and update our hacky example code to have some SharedTags examples
2017-02-10 11:05:35 -08:00
Tianon Gravi
c48fd9a499
First pass at implementing GetSharedTagGroups
2017-02-10 10:25:54 -08:00
Tianon Gravi
8488b2f8fc
Add initial support for an explicit "SharedTags" field
...
Things we know we'll need to be able to do with the new `SharedTags` (and are thus included in this initial file format support):
- get list of all shared tags from a manifest (`manifest.GetAllSharedTags()`)
- get list of shared tags from an entry (`entry.SharedTags`)
- get list of entries given a shared tag (`manifest.GetSharedTag(tag)`)
2017-02-06 16:25:53 -08:00
Tianon Gravi
08ef5a968e
Fix return values
2017-01-24 13:50:52 -08:00
Tianon Gravi
3a995f9639
Move GitFetch and GitCommit content enforcement back to Parse2822 (since they have a different format when coming from line-based legacy files)
2017-01-24 13:50:02 -08:00
Tianon Gravi
187e703bbf
Return an error for duplicated tags in a single entry as well
2017-01-24 13:38:56 -08:00
Tianon Gravi
a65f578c6d
Fix error message formatting to be consistent
2017-01-24 13:12:29 -08:00
Tianon Gravi
29ebe1cee3
Also verify that Maintainers are valid in individual entry objects
2017-01-24 13:03:52 -08:00
Tianon Gravi
8bde624aad
Move more "bad entry" error handling into manifest.AddEntry, wher eit really belongs
2017-01-24 13:02:23 -08:00
Tianon Gravi
b3ac43e115
Update "duplicate tag" error message to include the tag list from both entries (for easier identification)
2017-01-24 12:54:44 -08:00
Tianon Gravi
0066f2058b
Minor whitespace change
2017-01-24 10:41:19 -08:00
Tianon Gravi
9442670fdd
Add very basic line-based "maintainer:" comment parsing (passing contents directly into the manifest struct without any verification for now)
2016-07-20 11:12:33 -07:00
Tianon Gravi
d6068c47a7
Allow only "http" and "https" URLs
2016-06-08 10:36:33 -07:00
Tianon Gravi
c1549952f3
Facepalm
2016-06-08 10:24:38 -07:00
Tianon Gravi
ac3ac95930
First attempt to unstick Windows
2016-06-08 10:23:10 -07:00
Tianon Gravi
7d56be63f3
Be slightly less aggressive about using the current directory's "repo"
2016-06-01 17:08:02 -07:00
Tianon Gravi
a0797a5c0b
Add more validation and better line-based "git tag" handling
2016-05-27 16:41:04 -07:00
Tianon Gravi
e74aa41b37
Catch errors for invalid tagName values
2016-05-27 13:25:04 -07:00
Tianon Gravi
04af83c7d7
Add simple "HasTag" function for a Manifest2822Entry
2016-05-27 13:19:04 -07:00
Tianon Gravi
8a9af33071
Update manifest.Fetch to also parse "tag" from repo strings
2016-05-27 13:11:10 -07:00
Tianon Gravi
e40181b728
Also verify the "absoluteness" of the URL
2016-05-27 11:59:54 -07:00