diff --git a/go.mod b/go.mod index d48d166d..4526a641 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/fluxcd/pkg/http/fetch v0.19.0 github.com/fluxcd/pkg/runtime v0.84.0 github.com/fluxcd/pkg/tar v0.14.0 - github.com/fluxcd/source-controller/api v1.6.2 + github.com/fluxcd/source-controller/api v1.7.0 github.com/gitops-tools/pkg v0.2.0 github.com/go-logr/logr v1.4.3 github.com/go-logr/zapr v1.3.0 diff --git a/go.sum b/go.sum index 5cc9dcdd..b9f5b3fc 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/fluxcd/pkg/tar v0.14.0 h1:9Gku8FIvPt2bixKldZnzXJ/t+7SloxePlzyVGOK8GVQ github.com/fluxcd/pkg/tar v0.14.0/go.mod h1:+rOWYk93qLEJ8WwmkvJOkB8i0dna1mrwJFybE8i9Udo= github.com/fluxcd/pkg/testserver v0.13.0 h1:xEpBcEYtD7bwvZ+i0ZmChxKkDo/wfQEV3xmnzVybSSg= github.com/fluxcd/pkg/testserver v0.13.0/go.mod h1:akRYv3FLQUsme15na9ihECRG6hBuqni4XEY9W8kzs8E= -github.com/fluxcd/source-controller/api v1.6.2 h1:UmodAeqLIeF29HdTqf2GiacZyO+hJydJlepDaYsMvhc= -github.com/fluxcd/source-controller/api v1.6.2/go.mod h1:ZJcAi0nemsnBxjVgmJl0WQzNvB0rMETxQMTdoFosmMw= +github.com/fluxcd/source-controller/api v1.7.0 h1:y6vjvbkIN4JzianhmaJqujeghVpvQn3gcsVW/f1xMeA= +github.com/fluxcd/source-controller/api v1.7.0/go.mod h1:UOIEs9AACxPW7fQFqGWw1/FN2QqYDLG6WkvPIyscHkw= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= diff --git a/pkg/cmd/local_client.go b/pkg/cmd/local_client.go index b26d59af..5e95b03d 100644 --- a/pkg/cmd/local_client.go +++ b/pkg/cmd/local_client.go @@ -9,8 +9,8 @@ import ( "os" "path/filepath" + "github.com/fluxcd/pkg/apis/meta" sourcev1 "github.com/fluxcd/source-controller/api/v1" - sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2" "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -93,16 +93,12 @@ func (l localObjectReader) Get(ctx context.Context, key client.ObjectKey, obj cl l.logger.Info("reading from local filesystem", "base", base) switch v := obj.(type) { - case *sourcev1beta2.GitRepository: - v.Status.Artifact = &sourcev1.Artifact{ - URL: "file://" + filepath.Join(base, key.Name), - } case *sourcev1.GitRepository: - v.Status.Artifact = &sourcev1.Artifact{ + v.Status.Artifact = &meta.Artifact{ URL: "file://" + filepath.Join(base, key.Name), } - case *sourcev1beta2.OCIRepository: - v.Status.Artifact = &sourcev1.Artifact{ + case *sourcev1.OCIRepository: + v.Status.Artifact = &meta.Artifact{ URL: "file://" + filepath.Join(base, key.Name), } diff --git a/pkg/generators/gitrepository/git_repository_test.go b/pkg/generators/gitrepository/git_repository_test.go index 00ecdf16..922bf576 100644 --- a/pkg/generators/gitrepository/git_repository_test.go +++ b/pkg/generators/gitrepository/git_repository_test.go @@ -3,6 +3,7 @@ package gitrepository import ( "testing" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/http/fetch" "github.com/fluxcd/pkg/tar" sourcev1 "github.com/fluxcd/source-controller/api/v1" @@ -199,7 +200,7 @@ func TestGenerate_errors(t *testing.T) { func withArchiveURLAndChecksum(archiveURL, xsum string) func(*sourcev1.GitRepository) { return func(gr *sourcev1.GitRepository) { - gr.Status.Artifact = &sourcev1.Artifact{ + gr.Status.Artifact = &meta.Artifact{ URL: archiveURL, Digest: xsum, } diff --git a/pkg/generators/matrix/matrix_test.go b/pkg/generators/matrix/matrix_test.go index db0f98aa..a6975e70 100644 --- a/pkg/generators/matrix/matrix_test.go +++ b/pkg/generators/matrix/matrix_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/http/fetch" "github.com/fluxcd/pkg/tar" - sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2" templatesv1 "github.com/gitops-tools/gitopssets-controller/api/v1alpha1" "github.com/gitops-tools/gitopssets-controller/pkg/generators" @@ -554,7 +554,7 @@ func newGitRepository(archiveURL, xsum string) *sourcev1beta2.GitRepository { Namespace: testNamespace, }, Status: sourcev1beta2.GitRepositoryStatus{ - Artifact: &sourcev1.Artifact{ + Artifact: &meta.Artifact{ URL: archiveURL, Digest: xsum, }, diff --git a/pkg/generators/ocirepository/oci_repository_test.go b/pkg/generators/ocirepository/oci_repository_test.go index 2274bbb8..b01df2a9 100644 --- a/pkg/generators/ocirepository/oci_repository_test.go +++ b/pkg/generators/ocirepository/oci_repository_test.go @@ -3,9 +3,9 @@ package ocirepository import ( "testing" + "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/http/fetch" "github.com/fluxcd/pkg/tar" - sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2" "github.com/go-logr/logr" "github.com/google/go-cmp/cmp" @@ -200,7 +200,7 @@ func TestGenerate_errors(t *testing.T) { func withArchiveURLAndChecksum(archiveURL, xsum string) func(*sourcev1beta2.OCIRepository) { return func(gr *sourcev1beta2.OCIRepository) { - gr.Status.Artifact = &sourcev1.Artifact{ + gr.Status.Artifact = &meta.Artifact{ URL: archiveURL, Digest: xsum, } diff --git a/tests/e2e/gitopsset_controller_test.go b/tests/e2e/gitopsset_controller_test.go index 07755c1e..723b9f3a 100644 --- a/tests/e2e/gitopsset_controller_test.go +++ b/tests/e2e/gitopsset_controller_test.go @@ -9,7 +9,6 @@ import ( imagev1 "github.com/fluxcd/image-reflector-controller/api/v1" kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta2" "github.com/fluxcd/pkg/apis/meta" - sourcev1 "github.com/fluxcd/source-controller/api/v1" sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -900,8 +899,8 @@ func generateResourceInventory(objs []runtime.Object) *templatesv1.ResourceInven return &templatesv1.ResourceInventory{Entries: entries} } -func newArtifact(url, checksum string) *sourcev1.Artifact { - return &sourcev1.Artifact{ +func newArtifact(url, checksum string) *meta.Artifact { + return &meta.Artifact{ URL: url, Digest: checksum, LastUpdateTime: metav1.Now(),