Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/pkg/apparmor/apparmor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
const (
// ProfilePrefix is used for version-independent presence checks.
ProfilePrefix = "containers-default-"
)

var (
// Profile default name.
Profile = ProfilePrefix + version.Version
)

var (
// ErrApparmorUnsupported indicates that AppArmor support is not supported.
ErrApparmorUnsupported = errors.New("AppArmor is not supported")
// ErrApparmorRootless indicates that AppArmor support is not supported in rootless mode.
Expand Down
18 changes: 16 additions & 2 deletions common/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
package version

// Version is the version of the build.
const Version = "0.69.0-dev"
import "fmt"

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

// VersionDev indicates development branch. Releases will be empty string.
VersionDev = "-dev"
)
Comment on lines +6 to +15
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not care that much but personally I find a single string much much simpler than this unnecessary splitting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general matter I dislike strings and especially string parsing, so providing numeric constants (which don’t take any runtime space) is nice.

[Running Sprintf at runtime, on every startup, is a bit less nice, but definitely not worth over-engineering to avoid.]


// Version is the specification version that the package types support.
var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev)
1 change: 0 additions & 1 deletion storage/VERSION

This file was deleted.

5 changes: 2 additions & 3 deletions storage/store.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package storage

import (
_ "embed"
"encoding/base64"
"errors"
"fmt"
Expand Down Expand Up @@ -35,6 +34,7 @@ import (
"go.podman.io/storage/pkg/stringutils"
"go.podman.io/storage/pkg/system"
"go.podman.io/storage/types"
"go.podman.io/storage/version"
)

type updateNameOperation int
Expand Down Expand Up @@ -2960,8 +2960,7 @@ func (s *store) Status() ([][2]string, error) {
return rlstore.Status()
}

//go:embed VERSION
var storageVersion string
var storageVersion = version.Version

func (s *store) Version() ([][2]string, error) {
if trimmedVersion := strings.TrimSpace(storageVersion); trimmedVersion != "" {
Expand Down
18 changes: 18 additions & 0 deletions storage/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package version

import "fmt"

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

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

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