diff --git a/common/pkg/apparmor/apparmor.go b/common/pkg/apparmor/apparmor.go index 46b8cd20ff..7b6a45db66 100644 --- a/common/pkg/apparmor/apparmor.go +++ b/common/pkg/apparmor/apparmor.go @@ -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. diff --git a/common/version/version.go b/common/version/version.go index ecaac32b42..60745c59ae 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -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" +) + +// Version is the specification version that the package types support. +var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/storage/VERSION b/storage/VERSION deleted file mode 100644 index 66d8af842c..0000000000 --- a/storage/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.64.0-dev diff --git a/storage/store.go b/storage/store.go index 36ffbafe49..ab5e7ddfc1 100644 --- a/storage/store.go +++ b/storage/store.go @@ -1,7 +1,6 @@ package storage import ( - _ "embed" "encoding/base64" "errors" "fmt" @@ -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 @@ -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 != "" { diff --git a/storage/version/version.go b/storage/version/version.go new file mode 100644 index 0000000000..6b1bffc504 --- /dev/null +++ b/storage/version/version.go @@ -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)