-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add metadata into oci manifest when 'kpm push' (#205)
* feat: add metadata into oci manifest when 'kpm push' Signed-off-by: zongz <[email protected]> * fix: fix CR comments Signed-off-by: zongz <[email protected]> * fix: fix CR comments Signed-off-by: zongz <[email protected]> --------- Signed-off-by: zongz <[email protected]>
- Loading branch information
Showing
23 changed files
with
187 additions
and
35 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
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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package constants | ||
|
||
const ( | ||
KFilePathSuffix = ".k" | ||
TarPathSuffix = ".tar" | ||
OciScheme = "oci" | ||
FileEntry = "file" | ||
FileWithKclModEntry = "file_with_kcl_mod" | ||
UrlEntry = "url" | ||
RefEntry = "ref" | ||
TarEntry = "tar" | ||
KCL_MOD = "kcl.mod" | ||
OCI_SEPARATOR = ":" | ||
KCL_PKG_TAR = "*.tar" | ||
DEFAULT_KCL_FILE_NAME = "main.k" | ||
DEFAULT_KCL_FILE_CONTENT = "The_first_kcl_program = 'Hello World!'" | ||
KFilePathSuffix = ".k" | ||
TarPathSuffix = ".tar" | ||
OciScheme = "oci" | ||
FileEntry = "file" | ||
FileWithKclModEntry = "file_with_kcl_mod" | ||
UrlEntry = "url" | ||
RefEntry = "ref" | ||
TarEntry = "tar" | ||
KCL_MOD = "kcl.mod" | ||
OCI_SEPARATOR = ":" | ||
KCL_PKG_TAR = "*.tar" | ||
DEFAULT_KCL_FILE_NAME = "main.k" | ||
DEFAULT_KCL_FILE_CONTENT = "The_first_kcl_program = 'Hello World!'" | ||
DEFAULT_KCL_OCI_MANIFEST_NAME = "org.kcllang.package.name" | ||
DEFAULT_KCL_OCI_MANIFEST_VERSION = "org.kcllang.package.version" | ||
DEFAULT_KCL_OCI_MANIFEST_DESCRIPTION = "org.kcllang.package.description" | ||
DEFAULT_CREATE_OCI_MANIFEST_TIME = "org.opencontainers.image.created" | ||
) |
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
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,5 @@ | ||
[package] | ||
name = "test_mod_with_desc" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
description = "This is a test module with a description" |
Empty file.
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 @@ | ||
The_first_kcl_program = 'Hello World!' |
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
2 changes: 2 additions & 0 deletions
2
test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.env
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,2 @@ | ||
KPM_HOME="" | ||
KCLVM_VENDOR_HOME="" |
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.input
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 @@ | ||
kpm push |
Empty file.
3 changes: 3 additions & 0 deletions
3
test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.stdout
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,3 @@ | ||
kpm: package 'test_push_with_oci_manifest' will be pushed | ||
kpm: pushed [registry] localhost:5001/test/test_push_with_oci_manifest | ||
kpm: digest: sha256: |
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/test_data/test_push_with_oci_manifest/expected_oci_manifest.json
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 @@ | ||
{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","artifactType":"application/vnd.oci.image.layer.v1.tar","config":{"mediaType":"application/vnd.oci.empty.v1+json","digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a","size":2,"data":"e30="},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar","digest":"sha256:1d0b4bf7380ee67c23d48a16ebfbcc0720e9d0c59a1fe0f603e452ee8e99068f","size":4608,"annotations":{"org.opencontainers.image.title":"test_push_with_oci_manifest-0.0.1.tar"}}],"annotations":{"org.kcllang.package.description":"This is the description of the package","org.kcllang.package.name":"test_push_with_oci_manifest","org.kcllang.package.version":"0.0.1","org.opencontainers.image.created":"2023-10-23T06:24:49Z"}} |
6 changes: 6 additions & 0 deletions
6
test/e2e/test_suites/test_data/test_push_with_oci_manifest/kcl.mod
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,6 @@ | ||
[package] | ||
name = "test_push_with_oci_manifest" | ||
edition = "0.0.1" | ||
version = "0.0.1" | ||
description = "This is the description of the package" | ||
|
Empty file.
1 change: 1 addition & 0 deletions
1
test/e2e/test_suites/test_data/test_push_with_oci_manifest/main.k
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 @@ | ||
The_first_kcl_program = 'Hello World!' |