Skip to content

Commit 3491ecc

Browse files
author
Mrunal Patel
committed
Merge pull request #58 from wking/default-version
generate: Set ociVersion if it wasn't set in the template
2 parents f59e581 + 36b04d7 commit 3491ecc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

generate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ func loadTemplate(path string) (spec *rspec.Spec, err error) {
123123
}
124124

125125
func modify(spec *rspec.Spec, context *cli.Context) error {
126+
if len(spec.Version) == 0 {
127+
spec.Version = rspec.Version
128+
}
126129
spec.Root.Path = context.String("rootfs")
127130
if context.IsSet("read-only") {
128131
spec.Root.Readonly = context.Bool("read-only")

0 commit comments

Comments
 (0)