diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 29d6103fa..6c74d21b6 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -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 diff --git a/cmd/artifact/config/config_suite_test.go b/cmd/artifact/config/config_suite_test.go index 95d907745..ef33efc2f 100644 --- a/cmd/artifact/config/config_suite_test.go +++ b/cmd/artifact/config/config_suite_test.go @@ -47,6 +47,7 @@ var ( testPluginPlatform1 = "linux/amd64" testPluginPlatform2 = "windows/amd64" testPluginPlatform3 = "linux/arm64" + testPluginPlatform4 = "linux/loong64" ctx = context.Background() pluginMultiPlatformRef string rulesRef string @@ -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()) diff --git a/cmd/artifact/manifest/manifest_suite_test.go b/cmd/artifact/manifest/manifest_suite_test.go index c83547ecf..23cfc6b3a 100644 --- a/cmd/artifact/manifest/manifest_suite_test.go +++ b/cmd/artifact/manifest/manifest_suite_test.go @@ -47,6 +47,7 @@ var ( testPluginPlatform1 = "linux/amd64" testPluginPlatform2 = "windows/amd64" testPluginPlatform3 = "linux/arm64" + testPluginPlatform4 = "linux/loong64" ctx = context.Background() pluginMultiPlatformRef string rulesRef string @@ -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()) diff --git a/cmd/registry/push/push_test.go b/cmd/registry/push/push_test.go index 3a730ed3a..ca5c2f53f 100644 --- a/cmd/registry/push/push_test.go +++ b/cmd/registry/push/push_test.go @@ -283,6 +283,7 @@ var registryPushTests = Describe("push", func() { // Plugin's platforms. platformARM64 = "linux/arm64" platformAMD64 = "linux/amd64" + platformLOONG64 = "linux/loong64" // Data fetched from registry and used for assertions. pluginData *testutils.PluginArtifact @@ -479,7 +480,7 @@ var registryPushTests = Describe("push", func() { Expect(output).Should(gbytes.Say(regexp.QuoteMeta(pluginData.Descriptor.Digest.String()))) By("checking index") - Expect(pluginData.Index.Manifests).Should(HaveLen(2)) + Expect(pluginData.Index.Manifests).Should(HaveLen(3)) if annotation { Expect(pluginData.Index.Annotations).Should(HaveKeyWithValue("org.opencontainers.image.source", anSource)) @@ -490,6 +491,7 @@ var registryPushTests = Describe("push", func() { By("checking platforms") Expect(pluginData.Platforms).Should(HaveKey(platformARM64)) Expect(pluginData.Platforms).Should(HaveKey(platformAMD64)) + Expect(pluginData.Platforms).Should(HaveKey(platformLOONG64)) By("checking config layer") for _, p := range pluginData.Platforms { @@ -539,7 +541,8 @@ var registryPushTests = Describe("push", func() { When("with full flags and args", func() { BeforeEach(func() { args = []string{registryCmd, pushCmd, fullRepoName, plugin, pluginRaw, "--type", "plugin", "--platform", - platformAMD64, "--platform", platformARM64, "--version", version, "--config", configFile, + platformAMD64, "--platform", + platformARM64, "--platform", platformLOONG64, "--version", version, "--config", configFile, "--plain-http", "--depends-on", dep1, "--depends-on", dep2, "--requires", req, "--annotation-source", anSource, "--tag", pushedTags[0], "--tag", pushedTags[1], "--tag", pushedTags[2], "--name", artifactNameInConfigLayer} }) diff --git a/pkg/oci/puller/puller_suite_test.go b/pkg/oci/puller/puller_suite_test.go index 9c617a9b0..f5269a399 100644 --- a/pkg/oci/puller/puller_suite_test.go +++ b/pkg/oci/puller/puller_suite_test.go @@ -49,6 +49,7 @@ var ( testPluginPlatform1 = "linux/amd64" testPluginPlatform2 = "windows/amd64" testPluginPlatform3 = "linux/arm64" + testPluginPlatform4 = "linux/loong64" ctx = context.Background() destinationDir string pluginMultiPlatformRef string @@ -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()) diff --git a/pkg/oci/pusher/pusher_suite_test.go b/pkg/oci/pusher/pusher_suite_test.go index 0c98863d9..478668224 100644 --- a/pkg/oci/pusher/pusher_suite_test.go +++ b/pkg/oci/pusher/pusher_suite_test.go @@ -39,6 +39,7 @@ var ( testPluginPlatform1 = "linux/amd64" testPluginPlatform2 = "windows/amd64" testPluginPlatform3 = "linux/arm64" + testPluginPlatform4 = "linux/loong64" ctx = context.Background() ) diff --git a/pkg/oci/pusher/pusher_test.go b/pkg/oci/pusher/pusher_test.go index dca8097bd..bebc7cf96 100644 --- a/pkg/oci/pusher/pusher_test.go +++ b/pkg/oci/pusher/pusher_test.go @@ -170,7 +170,7 @@ var _ = Describe("Pusher", func() { BeforeEach(func() { // Different files, one for each platform. filePathsAndPlatforms = ocipusher.WithFilepathsAndPlatforms([]string{testPluginTarball, testPluginTarball, testPluginTarball}, - []string{testPluginPlatform1, testPluginPlatform2, testPluginPlatform3}) + []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" @@ -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)) }) })