Skip to content

Commit aa4cf2e

Browse files
🌱 Moving version and util to internal/shared (operator-framework#1743)
* Moving version and util to internal/shared This partially fixes operator-framework#1707. The intent is to consolidate internal code from operator-controller and catalogd within internal e.g.: catalogd/ - code specific to catalogd internal/ - holds internal code of catalogd and operator-controller. internal/catalogd - holds unexported code specific to catalogd internal/operator-controller - holds unexported code specific to operator-comntroller internal/shared - shared code between catalogd and operator-controller which can not be exported outside. Signed-off-by: Lalatendu Mohanty <[email protected]> * Adjusting Makefiles to the new version location Signed-off-by: Lalatendu Mohanty <[email protected]> --------- Signed-off-by: Lalatendu Mohanty <[email protected]>
1 parent 9be7693 commit aa4cf2e

File tree

18 files changed

+17
-17
lines changed

18 files changed

+17
-17
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ endif
317317
export CGO_ENABLED
318318

319319
export GIT_REPO := $(shell go list -m)
320-
export VERSION_PATH := ${GIT_REPO}/internal/version
320+
export VERSION_PATH := ${GIT_REPO}/internal/shared/version
321321
export GO_BUILD_TAGS := containers_image_openpgp
322322
export GO_BUILD_ASMFLAGS := all=-trimpath=$(PWD)
323323
export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)

Diff for: catalogd/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ VERSION := $(shell git describe --tags --always --dirty)
7474
endif
7575
export VERSION
7676

77-
export VERSION_PKG := $(shell go list -m)/internal/version
77+
export VERSION_PKG := $(shell go list -m)/internal/shared/version
7878

7979
export GIT_COMMIT := $(shell git rev-parse HEAD)
8080
export GIT_VERSION := $(shell git describe --tags --always --dirty)

Diff for: catalogd/cmd/catalogd/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ import (
6464
"github.com/operator-framework/operator-controller/catalogd/internal/source"
6565
"github.com/operator-framework/operator-controller/catalogd/internal/storage"
6666
"github.com/operator-framework/operator-controller/catalogd/internal/webhook"
67-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
68-
"github.com/operator-framework/operator-controller/internal/version"
67+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
68+
"github.com/operator-framework/operator-controller/internal/shared/version"
6969
)
7070

7171
var (

Diff for: catalogd/internal/source/containers_image.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424

2525
catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
2626
"github.com/operator-framework/operator-controller/internal/operator-controller/httputil"
27-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
28-
imageutil "github.com/operator-framework/operator-controller/internal/util/image"
27+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
28+
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
2929
)
3030

3131
const ConfigDirLabel = "operators.operatorframework.io.index.configs.v1"

Diff for: cmd/operator-controller/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ import (
7070
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/preflights/crdupgradesafety"
7171
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/source"
7272
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
73-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
74-
"github.com/operator-framework/operator-controller/internal/version"
73+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
74+
"github.com/operator-framework/operator-controller/internal/shared/version"
7575
)
7676

7777
var (

Diff for: internal/operator-controller/catalogmetadata/filter/bundle_predicates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/operator-framework/operator-registry/alpha/declcfg"
77

88
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
9-
"github.com/operator-framework/operator-controller/internal/util/filter"
9+
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
1010
)
1111

1212
func InMastermindsSemverRange(semverRange *mmsemver.Constraints) filter.Predicate[declcfg.Bundle] {

Diff for: internal/operator-controller/catalogmetadata/filter/successors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/operator-framework/operator-registry/alpha/declcfg"
1010

1111
ocv1 "github.com/operator-framework/operator-controller/api/v1"
12-
"github.com/operator-framework/operator-controller/internal/util/filter"
12+
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
1313
)
1414

1515
func SuccessorsOf(installedBundle ocv1.BundleMetadata, channels ...declcfg.Channel) (filter.Predicate[declcfg.Bundle], error) {

Diff for: internal/operator-controller/catalogmetadata/filter/successors_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
ocv1 "github.com/operator-framework/operator-controller/api/v1"
1717
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
1818
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
19-
"github.com/operator-framework/operator-controller/internal/util/filter"
19+
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
2020
)
2121

2222
func TestSuccessorsPredicate(t *testing.T) {

Diff for: internal/operator-controller/resolve/catalog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
2323
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
2424
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter"
25-
filterutil "github.com/operator-framework/operator-controller/internal/util/filter"
25+
filterutil "github.com/operator-framework/operator-controller/internal/shared/util/filter"
2626
)
2727

2828
type ValidationFunc func(*declcfg.Bundle) error

Diff for: internal/operator-controller/rukpak/source/containers_image.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"sigs.k8s.io/controller-runtime/pkg/reconcile"
2222

2323
"github.com/operator-framework/operator-controller/internal/operator-controller/httputil"
24-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
25-
imageutil "github.com/operator-framework/operator-controller/internal/util/image"
24+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
25+
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
2626
)
2727

2828
var insecurePolicy = []byte(`{"default":[{"type":"insecureAcceptAnything"}]}`)

Diff for: internal/operator-controller/rukpak/source/containers_image_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"sigs.k8s.io/controller-runtime/pkg/reconcile"
2424

2525
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/source"
26-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
26+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
2727
)
2828

2929
const (
File renamed without changes.

Diff for: internal/util/filter/filter_test.go renamed to internal/shared/util/filter/filter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/stretchr/testify/require"
77

8-
"github.com/operator-framework/operator-controller/internal/util/filter"
8+
"github.com/operator-framework/operator-controller/internal/shared/util/filter"
99
)
1010

1111
func TestAnd(t *testing.T) {
File renamed without changes.
File renamed without changes.

Diff for: internal/util/image/layers.go renamed to internal/shared/util/image/layers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/containers/image/v5/types"
1717
"sigs.k8s.io/controller-runtime/pkg/log"
1818

19-
fsutil "github.com/operator-framework/operator-controller/internal/util/fs"
19+
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
2020
)
2121

2222
// ForceOwnershipRWX is a passthrough archive.Filter that sets a tar header's
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)