oci: introduce WithSpecFromFile combinator#2479
Conversation
|
missing some windows counterpart and other linter errors: |
dc1af14 to
a09fcd2
Compare
There was a problem hiding this comment.
Perhaps containerd.WithSpec could be made to tolerate a nil for the first argument (in which case it initialises the spec ptr internally with a zero val struct). Saves an, incredibly minor, bit of faff for the caller in these cases.
There was a problem hiding this comment.
I did explore this, but you'd have to pass in a pointer to the pointer to make this work with nil.
There was a problem hiding this comment.
I misread spec as being an actual Spec, but of course its a Opt thing which consumes s in a deferred way. Sorry for the noise.
|
Waiting on fix for protobuf output. |
a09fcd2 to
4412287
Compare
We introduce a WithSpecFromFile option combinator to allow creation simpler creation of OCI specs from a file name. Often used as the first option in a `SpecOpts` slice, it simplifies choosing between a local file and the built-in default. The code in `ctr run` has been updated to use the new option, with out changing the order of operations or functionality present there. Signed-off-by: Stephen Day <[email protected]>
4412287 to
2a1bd74
Compare
Codecov Report
@@ Coverage Diff @@
## master #2479 +/- ##
=========================================
+ Coverage 44.74% 45% +0.26%
=========================================
Files 93 93
Lines 9559 9583 +24
=========================================
+ Hits 4277 4313 +36
+ Misses 4589 4575 -14
- Partials 693 695 +2
Continue to review full report at Codecov.
|
|
LGTM |
1 similar comment
|
LGTM |
We introduce a WithSpecFromFile option combinator to allow creation
simpler creation of OCI specs from a file name. Often used as the first
option in a
SpecOptsslice, it simplifies choosing between a localfile and the built-in default.
The code in
ctr runhas been updated to use the new option, with outchanging the order of operations or functionality present there.
Signed-off-by: Stephen Day [email protected]