1
0
mirror of synced 2026-05-03 02:03:31 +00:00

Make plugin types public

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2026-04-14 00:02:13 +03:00
parent c0938d351f
commit 5256361d8c
6 changed files with 192 additions and 153 deletions

View File

@@ -20,6 +20,8 @@ import (
"net/http"
"net/http/httptest"
"testing"
plugintypes "github.com/fluxcd/flux2/v2/pkg/plugin"
)
func TestFetchManifest(t *testing.T) {
@@ -168,9 +170,9 @@ plugins: []
}
func TestResolveVersion(t *testing.T) {
manifest := &PluginManifest{
manifest := &plugintypes.Manifest{
Name: "operator",
Versions: []PluginVersion{
Versions: []plugintypes.Version{
{Version: "0.45.0"},
{Version: "0.44.0"},
},
@@ -204,7 +206,7 @@ func TestResolveVersion(t *testing.T) {
})
t.Run("no versions", func(t *testing.T) {
_, err := ResolveVersion(&PluginManifest{Name: "empty"}, "")
_, err := ResolveVersion(&plugintypes.Manifest{Name: "empty"}, "")
if err == nil {
t.Fatal("expected error, got nil")
}
@@ -212,9 +214,9 @@ func TestResolveVersion(t *testing.T) {
}
func TestResolvePlatform(t *testing.T) {
pv := &PluginVersion{
pv := &plugintypes.Version{
Version: "0.45.0",
Platforms: []PluginPlatform{
Platforms: []plugintypes.Platform{
{OS: "darwin", Arch: "arm64", URL: "https://example.com/darwin_arm64.tar.gz"},
{OS: "linux", Arch: "amd64", URL: "https://example.com/linux_amd64.tar.gz"},
},