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
-21
View File
@@ -47,7 +47,6 @@ import (
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1"
notificationv1b3 "github.com/fluxcd/notification-controller/api/v1beta3"
"github.com/fluxcd/pkg/apis/meta"
runclient "github.com/fluxcd/pkg/runtime/client"
"github.com/fluxcd/pkg/version"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
@@ -231,26 +230,6 @@ func ParseObjectKindNameNamespace(input string) (kind, name, namespace string) {
return kind, name, namespace
}
func MakeDependsOn(deps []string) []meta.NamespacedObjectReference {
refs := []meta.NamespacedObjectReference{}
for _, dep := range deps {
parts := strings.Split(dep, "/")
depNamespace := ""
depName := ""
if len(parts) > 1 {
depNamespace = parts[0]
depName = parts[1]
} else {
depName = parts[0]
}
refs = append(refs, meta.NamespacedObjectReference{
Namespace: depNamespace,
Name: depName,
})
}
return refs
}
func ValidateComponents(components []string) error {
defaults := install.MakeDefaultOptions()
bootstrapAllComponents := append(defaults.Components, defaults.ComponentsExtra...)