Skip to content

Commit

Permalink
version: release v0.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: xiekeyang <xiekeyang@huawei.com>
  • Loading branch information
xiekeyang committed Feb 23, 2017
1 parent 7575a09 commit 0cecf6b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/oci-create-runtime-bundle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

specs "github.com/opencontainers/image-spec/specs-go"
"github.com/opencontainers/image-tools/image"
"github.com/opencontainers/image-tools/version"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -107,6 +108,7 @@ It is strongly recommended to keep the default value.`,
func (v *bundleCmd) Run(cmd *cobra.Command, args []string) {
if v.version {
v.stdout.Printf("commit: %s", gitCommit)
v.stdout.Printf("version: %s", version.Version)
v.stdout.Printf("spec: %s", specs.Version)
os.Exit(0)

Expand Down
2 changes: 2 additions & 0 deletions cmd/oci-image-validate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/opencontainers/image-spec/schema"
specs "github.com/opencontainers/image-spec/specs-go"
"github.com/opencontainers/image-tools/image"
"github.com/opencontainers/image-tools/version"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -104,6 +105,7 @@ func newValidateCmd(stdout, stderr *log.Logger) *cobra.Command {
func (v *validateCmd) Run(cmd *cobra.Command, args []string) {
if v.version {
v.stdout.Printf("commit: %s", gitCommit)
v.stdout.Printf("version: %s", version.Version)
v.stdout.Printf("spec: %s", specs.Version)
os.Exit(0)
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/oci-unpack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

specs "github.com/opencontainers/image-spec/specs-go"
"github.com/opencontainers/image-tools/image"
"github.com/opencontainers/image-tools/version"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -100,6 +101,7 @@ func newUnpackCmd(stdout, stderr *log.Logger) *cobra.Command {
func (v *unpackCmd) Run(cmd *cobra.Command, args []string) {
if v.version {
v.stdout.Printf("commit: %s", gitCommit)
v.stdout.Printf("version: %s", version.Version)
v.stdout.Printf("spec: %s", specs.Version)
os.Exit(0)
}
Expand Down
32 changes: 32 additions & 0 deletions version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2016 The Linux Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package version

import "fmt"

const (
// VersionMajor is for an API incompatible changes
VersionMajor = 0
// VersionMinor is for functionality in a backwards-compatible manner
VersionMinor = 1
// VersionPatch is for backwards-compatible bug fixes
VersionPatch = 0

// VersionDev indicates development branch. Releases will be empty string.
VersionDev = ""
)

// Version is the specification version that the package types support.
var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev)

0 comments on commit 0cecf6b

Please sign in to comment.