diff --git a/Makefile b/Makefile index 2e3a3680e..fb7cdf4a1 100644 --- a/Makefile +++ b/Makefile @@ -317,7 +317,7 @@ endif export CGO_ENABLED export GIT_REPO := $(shell go list -m) -export VERSION_PATH := ${GIT_REPO}/internal/version +export VERSION_PATH := ${GIT_REPO}/internal/shared/version export GO_BUILD_TAGS := containers_image_openpgp export GO_BUILD_ASMFLAGS := all=-trimpath=$(PWD) export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD) diff --git a/catalogd/Makefile b/catalogd/Makefile index 6747a3dde..ffe017bf1 100644 --- a/catalogd/Makefile +++ b/catalogd/Makefile @@ -74,7 +74,7 @@ VERSION := $(shell git describe --tags --always --dirty) endif export VERSION -export VERSION_PKG := $(shell go list -m)/internal/version +export VERSION_PKG := $(shell go list -m)/internal/shared/version export GIT_COMMIT := $(shell git rev-parse HEAD) export GIT_VERSION := $(shell git describe --tags --always --dirty) diff --git a/catalogd/cmd/catalogd/main.go b/catalogd/cmd/catalogd/main.go index 499248d84..8d547a131 100644 --- a/catalogd/cmd/catalogd/main.go +++ b/catalogd/cmd/catalogd/main.go @@ -64,8 +64,8 @@ import ( "github.com/operator-framework/operator-controller/catalogd/internal/source" "github.com/operator-framework/operator-controller/catalogd/internal/storage" "github.com/operator-framework/operator-controller/catalogd/internal/webhook" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" - "github.com/operator-framework/operator-controller/internal/version" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" + "github.com/operator-framework/operator-controller/internal/shared/version" ) var ( diff --git a/catalogd/internal/source/containers_image.go b/catalogd/internal/source/containers_image.go index f4c736834..1ecc93237 100644 --- a/catalogd/internal/source/containers_image.go +++ b/catalogd/internal/source/containers_image.go @@ -24,8 +24,8 @@ import ( catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1" "github.com/operator-framework/operator-controller/internal/operator-controller/httputil" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" - imageutil "github.com/operator-framework/operator-controller/internal/util/image" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" + imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image" ) const ConfigDirLabel = "operators.operatorframework.io.index.configs.v1" diff --git a/cmd/operator-controller/main.go b/cmd/operator-controller/main.go index 66017a0e0..869e43170 100644 --- a/cmd/operator-controller/main.go +++ b/cmd/operator-controller/main.go @@ -70,8 +70,8 @@ import ( "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/preflights/crdupgradesafety" "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/source" "github.com/operator-framework/operator-controller/internal/operator-controller/scheme" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" - "github.com/operator-framework/operator-controller/internal/version" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" + "github.com/operator-framework/operator-controller/internal/shared/version" ) var ( diff --git a/internal/operator-controller/catalogmetadata/filter/bundle_predicates.go b/internal/operator-controller/catalogmetadata/filter/bundle_predicates.go index cd0b0e47c..ecea3783b 100644 --- a/internal/operator-controller/catalogmetadata/filter/bundle_predicates.go +++ b/internal/operator-controller/catalogmetadata/filter/bundle_predicates.go @@ -6,7 +6,7 @@ import ( "github.com/operator-framework/operator-registry/alpha/declcfg" "github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil" - "github.com/operator-framework/operator-controller/internal/util/filter" + "github.com/operator-framework/operator-controller/internal/shared/util/filter" ) func InMastermindsSemverRange(semverRange *mmsemver.Constraints) filter.Predicate[declcfg.Bundle] { diff --git a/internal/operator-controller/catalogmetadata/filter/successors.go b/internal/operator-controller/catalogmetadata/filter/successors.go index 128c80cca..c4abb3258 100644 --- a/internal/operator-controller/catalogmetadata/filter/successors.go +++ b/internal/operator-controller/catalogmetadata/filter/successors.go @@ -9,7 +9,7 @@ import ( "github.com/operator-framework/operator-registry/alpha/declcfg" ocv1 "github.com/operator-framework/operator-controller/api/v1" - "github.com/operator-framework/operator-controller/internal/util/filter" + "github.com/operator-framework/operator-controller/internal/shared/util/filter" ) func SuccessorsOf(installedBundle ocv1.BundleMetadata, channels ...declcfg.Channel) (filter.Predicate[declcfg.Bundle], error) { diff --git a/internal/operator-controller/catalogmetadata/filter/successors_test.go b/internal/operator-controller/catalogmetadata/filter/successors_test.go index abe15870d..0d3fb45d2 100644 --- a/internal/operator-controller/catalogmetadata/filter/successors_test.go +++ b/internal/operator-controller/catalogmetadata/filter/successors_test.go @@ -16,7 +16,7 @@ import ( ocv1 "github.com/operator-framework/operator-controller/api/v1" "github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil" "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare" - "github.com/operator-framework/operator-controller/internal/util/filter" + "github.com/operator-framework/operator-controller/internal/shared/util/filter" ) func TestSuccessorsPredicate(t *testing.T) { diff --git a/internal/operator-controller/resolve/catalog.go b/internal/operator-controller/resolve/catalog.go index 095be8b10..8b6021c43 100644 --- a/internal/operator-controller/resolve/catalog.go +++ b/internal/operator-controller/resolve/catalog.go @@ -22,7 +22,7 @@ import ( "github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil" "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare" "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter" - filterutil "github.com/operator-framework/operator-controller/internal/util/filter" + filterutil "github.com/operator-framework/operator-controller/internal/shared/util/filter" ) type ValidationFunc func(*declcfg.Bundle) error diff --git a/internal/operator-controller/rukpak/source/containers_image.go b/internal/operator-controller/rukpak/source/containers_image.go index e0bb408ab..1eebdfb56 100644 --- a/internal/operator-controller/rukpak/source/containers_image.go +++ b/internal/operator-controller/rukpak/source/containers_image.go @@ -21,8 +21,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/operator-framework/operator-controller/internal/operator-controller/httputil" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" - imageutil "github.com/operator-framework/operator-controller/internal/util/image" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" + imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image" ) var insecurePolicy = []byte(`{"default":[{"type":"insecureAcceptAnything"}]}`) diff --git a/internal/operator-controller/rukpak/source/containers_image_test.go b/internal/operator-controller/rukpak/source/containers_image_test.go index 9cd255b97..7196a7774 100644 --- a/internal/operator-controller/rukpak/source/containers_image_test.go +++ b/internal/operator-controller/rukpak/source/containers_image_test.go @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/source" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" ) const ( diff --git a/internal/util/filter/filter.go b/internal/shared/util/filter/filter.go similarity index 100% rename from internal/util/filter/filter.go rename to internal/shared/util/filter/filter.go diff --git a/internal/util/filter/filter_test.go b/internal/shared/util/filter/filter_test.go similarity index 98% rename from internal/util/filter/filter_test.go rename to internal/shared/util/filter/filter_test.go index 2622b4adf..46f4d5812 100644 --- a/internal/util/filter/filter_test.go +++ b/internal/shared/util/filter/filter_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/operator-framework/operator-controller/internal/util/filter" + "github.com/operator-framework/operator-controller/internal/shared/util/filter" ) func TestAnd(t *testing.T) { diff --git a/internal/util/fs/fs.go b/internal/shared/util/fs/fs.go similarity index 100% rename from internal/util/fs/fs.go rename to internal/shared/util/fs/fs.go diff --git a/internal/util/fs/fs_test.go b/internal/shared/util/fs/fs_test.go similarity index 100% rename from internal/util/fs/fs_test.go rename to internal/shared/util/fs/fs_test.go diff --git a/internal/util/image/layers.go b/internal/shared/util/image/layers.go similarity index 99% rename from internal/util/image/layers.go rename to internal/shared/util/image/layers.go index 1038fdb81..7feef83ae 100644 --- a/internal/util/image/layers.go +++ b/internal/shared/util/image/layers.go @@ -16,7 +16,7 @@ import ( "github.com/containers/image/v5/types" "sigs.k8s.io/controller-runtime/pkg/log" - fsutil "github.com/operator-framework/operator-controller/internal/util/fs" + fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs" ) // ForceOwnershipRWX is a passthrough archive.Filter that sets a tar header's diff --git a/internal/util/image/layers_test.go b/internal/shared/util/image/layers_test.go similarity index 100% rename from internal/util/image/layers_test.go rename to internal/shared/util/image/layers_test.go diff --git a/internal/version/version.go b/internal/shared/version/version.go similarity index 100% rename from internal/version/version.go rename to internal/shared/version/version.go