1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Update Source API to v1beta2

The creation of oldConditions, statusableConditions and
reconcilableConditions is an adhoc solution to deal with the upstream
changes on `pkg/apis/meta`, which are yet to be replicated across other
Flux API components.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
This commit is contained in:
Paulo Gomes
2022-03-22 15:50:52 +00:00
committed by Hidde Beydals
parent a929d24924
commit e5ede275f8
54 changed files with 130 additions and 82 deletions

View File

@@ -46,9 +46,9 @@ import (
imagereflectv1 "github.com/fluxcd/image-reflector-controller/api/v1beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
"github.com/fluxcd/pkg/runtime/dependency"
"github.com/fluxcd/pkg/apis/meta"
"github.com/fluxcd/pkg/version"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
"github.com/fluxcd/flux2/pkg/manifestgen/install"
)
@@ -226,8 +226,8 @@ func ParseObjectKindNameNamespace(input string) (kind, name, namespace string) {
return kind, name, namespace
}
func MakeDependsOn(deps []string) []dependency.CrossNamespaceDependencyReference {
refs := []dependency.CrossNamespaceDependencyReference{}
func MakeDependsOn(deps []string) []meta.NamespacedObjectReference {
refs := []meta.NamespacedObjectReference{}
for _, dep := range deps {
parts := strings.Split(dep, "/")
depNamespace := ""
@@ -238,7 +238,7 @@ func MakeDependsOn(deps []string) []dependency.CrossNamespaceDependencyReference
} else {
depName = parts[0]
}
refs = append(refs, dependency.CrossNamespaceDependencyReference{
refs = append(refs, meta.NamespacedObjectReference{
Namespace: depNamespace,
Name: depName,
})

View File

@@ -25,7 +25,7 @@ import (
"reflect"
"testing"
"github.com/fluxcd/pkg/runtime/dependency"
"github.com/fluxcd/pkg/apis/meta"
)
func TestCompatibleVersion(t *testing.T) {
@@ -88,7 +88,7 @@ func TestMakeDependsOn(t *testing.T) {
"someNSD/",
"",
}
want := []dependency.CrossNamespaceDependencyReference{
want := []meta.NamespacedObjectReference{
{Namespace: "someNSA", Name: "someNameA"},
{Namespace: "someNSB", Name: "someNameB"},
{Namespace: "", Name: "someNameC"},