refactor(api): migrate MakeDependsOn to shared apis/meta func
Signed-off-by: Vincent Dely <vincent.dely@ik.me>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user