1
0
mirror of synced 2026-06-10 00:30:49 +00:00

refactor(api): migrate MakeDependsOn to shared apis/meta func

Signed-off-by: Vincent Dely <vincent.dely@ik.me>
This commit is contained in:
vecil
2026-05-22 21:14:09 +02:00
parent 8c41d5b56d
commit 22953596c6
6 changed files with 5 additions and 51 deletions
-25
View File
@@ -21,10 +21,7 @@ package utils
import (
"path/filepath"
"reflect"
"testing"
"github.com/fluxcd/pkg/apis/meta"
)
func TestCompatibleVersion(t *testing.T) {
@@ -79,28 +76,6 @@ func TestParseObjectKindNameNamespace(t *testing.T) {
}
}
func TestMakeDependsOn(t *testing.T) {
input := []string{
"someNSA/someNameA",
"someNSB/someNameB",
"someNameC",
"someNSD/",
"",
}
want := []meta.NamespacedObjectReference{
{Namespace: "someNSA", Name: "someNameA"},
{Namespace: "someNSB", Name: "someNameB"},
{Namespace: "", Name: "someNameC"},
{Namespace: "someNSD", Name: ""},
{Namespace: "", Name: ""},
}
got := MakeDependsOn(input)
if !reflect.DeepEqual(got, want) {
t.Errorf("MakeDependsOn() = %v, want %v", got, want)
}
}
func TestValidateComponents(t *testing.T) {
tests := []struct {
name string