Skip to content

Commit aad3305

Browse files
committed
cmd/oci-image-tool/main.go: Add description with supported versions
This shows up in the --help output. I expect image-tools to support a range of image-spec versions, not just a single one. For example, once image-spec cuts 2.0, image-tools should still be able to process 1.x images for some reasonable deprecation period. image-spec is setting us up for that possibility by using the v1 package for the Go types that are likely to change. And SemVer means that if we can unpack a 1.3 image, we can also unpack 1.2, 1.1, and 1.0 images. So I think we want this to be printing: * OCI Image Format Specification: 1.0.0-rc5 now. Once 1.0 is cut we should show: * OCI Image Format Specification: 1.0.0 Once 1.1 is cut we should show our position in the 1.x series: * OCI Image Format Specification: 1.1.0 And then when 2.0 is cut we should show our positions in both the 1.x and 2.x series. If 2.0 happened after 1.1 (without a 1.2, etc.), that would be: * OCI Image Format Specification: 1.1.0, 2.0.0 I see less need to support multiple runtime-spec formats, since they're only used in 'oci-image-tool create ...'. But the approach I used for image-spec ports well to runtime-spec, so I've listed a version for it too. Signed-off-by: W. Trevor King <[email protected]>
1 parent 144d945 commit aad3305

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/oci-image-tool/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020

2121
"github.com/Sirupsen/logrus"
2222
"github.com/opencontainers/image-tools/version"
23+
image_spec "github.com/opencontainers/image-spec/specs-go"
24+
runtime_spec "github.com/opencontainers/runtime-spec/specs-go"
2325
"github.com/urfave/cli"
2426
)
2527

@@ -35,6 +37,7 @@ func main() {
3537
} else {
3638
app.Version = version.Version
3739
}
40+
app.Description = fmt.Sprintf("Tools for working with OCI images. Currently supported specifications are:\n\n * OCI Image Format Specification: %s\n * OCI Runtime Specification: %s", image_spec.Version, runtime_spec.Version)
3841
app.Usage = "OCI (Open Container Initiative) image tools"
3942
app.Flags = []cli.Flag{
4043
cli.BoolFlag{

0 commit comments

Comments
 (0)