Skip to content

Commit

Permalink
Add Loongarch64 support
Browse files Browse the repository at this point in the history
Signed-off-by: yzewei <[email protected]>
  • Loading branch information
yzewei committed Jan 17, 2024
1 parent c89a6a8 commit ae5b29e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
goarch:
- arm64
- amd64
- loong64
exclude:
- goarch: arm64
goos: windows
- goarch: loong64
goos: windows
- goarch: loong64
goos: darwin
steps:
- name: Checkout commit
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
Expand Down
5 changes: 3 additions & 2 deletions cmd/artifact/config/config_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
testPluginPlatform1 = "linux/amd64"
testPluginPlatform2 = "windows/amd64"
testPluginPlatform3 = "linux/arm64"
testPluginPlatform4 = "linux/loong64"
ctx = context.Background()
pluginMultiPlatformRef string
rulesRef string
Expand Down Expand Up @@ -98,8 +99,8 @@ var _ = BeforeSuite(func() {
pusher := ocipusher.NewPusher(authn.NewClient(authn.WithCredentials(&auth.EmptyCredential)), true, nil)

// Push plugin artifact with multiple architectures.
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3})
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3, testPluginPlatform4})
pluginMultiPlatformRef = localRegistryHost + "/plugins:multiplatform"
artConfig := oci.ArtifactConfig{}
Expect(artConfig.ParseDependencies("my-dep:1.2.3|my-alt-dep:1.4.5")).ToNot(HaveOccurred())
Expand Down
5 changes: 3 additions & 2 deletions cmd/artifact/manifest/manifest_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
testPluginPlatform1 = "linux/amd64"
testPluginPlatform2 = "windows/amd64"
testPluginPlatform3 = "linux/arm64"
testPluginPlatform4 = "linux/loong64"
ctx = context.Background()
pluginMultiPlatformRef string
rulesRef string
Expand Down Expand Up @@ -97,8 +98,8 @@ var _ = BeforeSuite(func() {
pusher := ocipusher.NewPusher(authn.NewClient(authn.WithCredentials(&auth.EmptyCredential)), true, nil)

// Push plugin artifact with multiple architectures.
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3})
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3, testPluginPlatform4})
pluginMultiPlatformRef = localRegistryHost + "/plugins:multiplatform"
artConfig := oci.ArtifactConfig{}
Expect(artConfig.ParseDependencies("my-dep:1.2.3|my-alt-dep:1.4.5")).ToNot(HaveOccurred())
Expand Down
5 changes: 3 additions & 2 deletions pkg/oci/puller/puller_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
testPluginPlatform1 = "linux/amd64"
testPluginPlatform2 = "windows/amd64"
testPluginPlatform3 = "linux/arm64"
testPluginPlatform4 = "linux/loong64"
ctx = context.Background()
destinationDir string
pluginMultiPlatformRef string
Expand Down Expand Up @@ -98,8 +99,8 @@ var _ = BeforeSuite(func() {
pusher := ocipusher.NewPusher(authn.NewClient(authn.WithCredentials(&auth.EmptyCredential)), true, nil)

// Push plugin artifact with multiple architectures.
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3})
filePathsAndPlatforms := ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3, testPluginPlatform4})
pluginMultiPlatformRef = localRegistryHost + "/plugins:multiplatform"
artConfig := oci.ArtifactConfig{}
Expect(artConfig.ParseDependencies("my-dep:1.2.3|my-alt-dep:1.4.5")).ToNot(HaveOccurred())
Expand Down
1 change: 1 addition & 0 deletions pkg/oci/pusher/pusher_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var (
testPluginPlatform1 = "linux/amd64"
testPluginPlatform2 = "windows/amd64"
testPluginPlatform3 = "linux/arm64"
testPluginPlatform4 = "linux/loong64"
ctx = context.Background()
)

Expand Down
7 changes: 4 additions & 3 deletions pkg/oci/pusher/pusher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ var _ = Describe("Pusher", func() {
Context("pushing multiple flavors of plugin: 3 filepath, 3 platform without tag", func() {
BeforeEach(func() {
// Different files, one for each platform.
filePathsAndPlatforms = ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball},
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3})
filePathsAndPlatforms = ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball, testPluginTarball},

Check failure on line 172 in pkg/oci/pusher/pusher_test.go

View workflow job for this annotation

GitHub Actions / Lint golang files

line is 151 characters (lll)
[]string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3, testPluginPlatform4})
options = []ocipusher.Option{filePathsAndPlatforms}
// Pushing the artifact without an explicit tag, the default tag (latest) will be added by the pusher.
repoAndTag = "/plugin-test-three-flavors"
Expand All @@ -189,10 +189,11 @@ var _ = Describe("Pusher", func() {
// Being the artifact of type plugin we expect that the retrieved descriptor is of type image index.
Expect(d.MediaType).To(Equal(v1.MediaTypeImageIndex))
Expect(d.Digest.String()).To(Equal(result.Digest))
Expect(index.Manifests).To(HaveLen(3))
Expect(index.Manifests).To(HaveLen(4))
Expect(fmt.Sprintf("%s/%s", index.Manifests[0].Platform.OS, index.Manifests[0].Platform.Architecture)).To(Equal(testPluginPlatform1))
Expect(fmt.Sprintf("%s/%s", index.Manifests[1].Platform.OS, index.Manifests[1].Platform.Architecture)).To(Equal(testPluginPlatform2))
Expect(fmt.Sprintf("%s/%s", index.Manifests[2].Platform.OS, index.Manifests[2].Platform.Architecture)).To(Equal(testPluginPlatform3))
Expect(fmt.Sprintf("%s/%s", index.Manifests[3].Platform.OS, index.Manifests[3].Platform.Architecture)).To(Equal(testPluginPlatform4))
})
})

Expand Down

0 comments on commit ae5b29e

Please sign in to comment.