Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit 717cd0e

Browse files
author
xiekeyang
committed
bump dummy version
During bumping official version, it should not change any code. So, it has to prepare the version variables, their functions and dummy version (as 0.0.0-dev) into code. After that is landed, then official versions can be released. Signed-off-by: xiekeyang <xiekeyang@huawei.com>
1 parent 7575a09 commit 717cd0e

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

cmd/oci-create-runtime-bundle/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
specs "github.com/opencontainers/image-spec/specs-go"
2424
"github.com/opencontainers/image-tools/image"
25+
"github.com/opencontainers/image-tools/version"
2526
"github.com/spf13/cobra"
2627
)
2728

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

cmd/oci-image-validate/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/opencontainers/image-spec/schema"
2424
specs "github.com/opencontainers/image-spec/specs-go"
2525
"github.com/opencontainers/image-tools/image"
26+
"github.com/opencontainers/image-tools/version"
2627
"github.com/pkg/errors"
2728
"github.com/spf13/cobra"
2829
)
@@ -104,6 +105,7 @@ func newValidateCmd(stdout, stderr *log.Logger) *cobra.Command {
104105
func (v *validateCmd) Run(cmd *cobra.Command, args []string) {
105106
if v.version {
106107
v.stdout.Printf("commit: %s", gitCommit)
108+
v.stdout.Printf("version: %s", version.Version)
107109
v.stdout.Printf("spec: %s", specs.Version)
108110
os.Exit(0)
109111
}

cmd/oci-unpack/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
specs "github.com/opencontainers/image-spec/specs-go"
2424
"github.com/opencontainers/image-tools/image"
25+
"github.com/opencontainers/image-tools/version"
2526
"github.com/spf13/cobra"
2627
)
2728

@@ -100,6 +101,7 @@ func newUnpackCmd(stdout, stderr *log.Logger) *cobra.Command {
100101
func (v *unpackCmd) Run(cmd *cobra.Command, args []string) {
101102
if v.version {
102103
v.stdout.Printf("commit: %s", gitCommit)
104+
v.stdout.Printf("version: %s", version.Version)
103105
v.stdout.Printf("spec: %s", specs.Version)
104106
os.Exit(0)
105107
}

version/version.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2016 The Linux Foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package version
16+
17+
import "fmt"
18+
19+
const (
20+
// VersionMajor is for an API incompatible changes
21+
VersionMajor = 0
22+
// VersionMinor is for functionality in a backwards-compatible manner
23+
VersionMinor = 0
24+
// VersionPatch is for backwards-compatible bug fixes
25+
VersionPatch = 0
26+
27+
// VersionDev indicates development branch. Releases will be empty string.
28+
VersionDev = "-dev"
29+
)
30+
31+
// Version is the specification version that the package types support.
32+
var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev)

0 commit comments

Comments
 (0)