-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release-v0.18.0] fix: version info for OCI refs (#1080)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Cherry Pick from a1890c2 #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> --------- Co-authored-by: Uwe Krueger <[email protected]>
- Loading branch information
1 parent
efae7d1
commit 0117891
Showing
8 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package ociutils_test | ||
|
||
import ( | ||
. "github.com/mandelsoft/goutils/testutils" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
"github.com/opencontainers/go-digest" | ||
"ocm.software/ocm/api/oci/ociutils" | ||
"ocm.software/ocm/api/oci/testhelper" | ||
) | ||
|
||
var _ = Describe("Ref Test Environment", func() { | ||
dig := "sha256:" + testhelper.H_OCIARCHMANIFEST1 | ||
|
||
type expect struct { | ||
yaml string | ||
versionSpec string | ||
isVersion bool | ||
version string | ||
isTag bool | ||
tag string | ||
isDigested bool | ||
digest string | ||
} | ||
|
||
DescribeTable("parsing", func(src string, e expect) { | ||
v := Must(ociutils.ParseVersion(src)) | ||
Expect(v).NotTo(BeNil()) | ||
Expect(v).To(YAMLEqual(e.yaml)) | ||
Expect(v.VersionSpec()).To(Equal(e.versionSpec)) | ||
Expect(v.IsVersion()).To(Equal(e.isVersion)) | ||
Expect(v.Version()).To(Equal(e.version)) | ||
Expect(v.IsTagged()).To(Equal(e.isTag)) | ||
Expect(v.GetTag()).To(Equal(e.tag)) | ||
Expect(v.IsDigested()).To(Equal(e.isDigested)) | ||
Expect(v.GetDigest()).To(Equal(digest.Digest(e.digest))) | ||
}, | ||
Entry("empty", "", expect{ | ||
yaml: "{}", | ||
versionSpec: "latest", | ||
version: "latest", | ||
}), | ||
Entry("tag", "tag", expect{ | ||
yaml: "{\"tag\":\"tag\"}", | ||
versionSpec: "tag", | ||
isVersion: true, | ||
version: "tag", | ||
isTag: true, | ||
tag: "tag", | ||
}), | ||
Entry("digest", "@"+dig, expect{ | ||
yaml: "{\"digest\":\"" + dig + "\"}", | ||
versionSpec: "@" + dig, | ||
isVersion: true, | ||
version: "@" + dig, | ||
isDigested: true, | ||
digest: dig, | ||
}), | ||
Entry("tag@digest", "tag@"+dig, expect{ | ||
yaml: "{\"tag\":\"tag\",\"digest\":\"" + dig + "\"}", | ||
versionSpec: "tag@" + dig, | ||
isVersion: true, | ||
version: "@" + dig, | ||
isTag: true, | ||
tag: "tag", | ||
isDigested: true, | ||
digest: dig, | ||
}), | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ociutils_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestConfig(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "OCI Utils Test Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Release v0.18.0-rc.2 | ||
|
||
- change short text for help topic (#1058) | ||
- bug: allow http protocol for oci access (#1060) | ||
- bug: fix unmarshal consumer identity with empty value (#1057) | ||
- fix artifact set tagging (#1033) | ||
- component constructor with references field (#1054) | ||
- priority for CLI registration options (#1045) | ||
- chore: update 'flake.nix' (#1049) | ||
- add action doc (#1032) | ||
- chore: update 'flake.nix' (#1040) | ||
- chore: update 'flake.nix' (#1039) | ||
- fix downloader handling (#1031) | ||
- Adjust README with rotated GPG key (#1025) | ||
|
||
## 🐛 Bug Fixes | ||
|
||
- fix: set tlskyber=0 (#1047) | ||
- fix: remove ocm release key if present (#1024) | ||
- chore: release fallout corrections (#1023) | ||
- fix version info for OCI refs (#1078) [cherry-picked](https://github.com/open-component-model/ocm/pull/1080) | ||
|
||
## 🧰 Maintenance | ||
|
||
<details> | ||
<summary>8 changes</summary> | ||
|
||
- chore: force bump to 0.18.0-dev (#1061) | ||
- chore: reuse aggregation from ctf during component build (#1044) | ||
- chore: disable runner cache for release note drafter (#1051) | ||
- chore: enhance the publishing to other repositories then github (#1028) | ||
- chore: migrate all component builds: ca => ctf (#1043) | ||
- chore(ci): various optimizations for build processing, caching and concurrency (#996) | ||
- fix: remove ocm release key if present (#1024) | ||
- chore: release fallout corrections (#1023) | ||
</details> | ||
|
||
## ⬆️ Dependencies | ||
|
||
<details> | ||
<summary>4 changes</summary> | ||
|
||
- chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 in the go\_modules group (#1048) | ||
- chore(deps): bump github.com/containerd/errdefs from 0.3.0 to 1.0.0 (#1037) | ||
- chore(deps): bump the ci group with 2 updates (#1038) | ||
- chore(deps): bump the go group with 8 updates (#1036) | ||
</details> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters