Skip to content

Commit 8b923bf

Browse files
[WIP] Moving pkgs to internal/operator-controller/
This partially fixes #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]>
1 parent f6b1130 commit 8b923bf

28 files changed

+24
-23
lines changed

cmd/operator-controller/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,19 @@ import (
5252

5353
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
5454

55+
"github.com/operator-framework/operator-controller/internal/operator-controller/action"
56+
"github.com/operator-framework/operator-controller/internal/operator-controller/applier"
57+
5558
ocv1 "github.com/operator-framework/operator-controller/api/v1"
5659
catalogd "github.com/operator-framework/operator-controller/catalogd/api/v1"
57-
"github.com/operator-framework/operator-controller/internal/action"
58-
"github.com/operator-framework/operator-controller/internal/applier"
59-
"github.com/operator-framework/operator-controller/internal/authentication"
60-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/cache"
61-
catalogclient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
6260
"github.com/operator-framework/operator-controller/internal/contentmanager"
6361
"github.com/operator-framework/operator-controller/internal/controllers"
6462
"github.com/operator-framework/operator-controller/internal/features"
6563
"github.com/operator-framework/operator-controller/internal/finalizers"
6664
"github.com/operator-framework/operator-controller/internal/httputil"
65+
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
66+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/cache"
67+
catalogclient "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/client"
6768
"github.com/operator-framework/operator-controller/internal/resolve"
6869
"github.com/operator-framework/operator-controller/internal/rukpak/preflights/crdupgradesafety"
6970
"github.com/operator-framework/operator-controller/internal/rukpak/source"

internal/controllers/clusterextension_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ import (
5050

5151
ocv1 "github.com/operator-framework/operator-controller/api/v1"
5252
catalogd "github.com/operator-framework/operator-controller/catalogd/api/v1"
53-
"github.com/operator-framework/operator-controller/internal/bundleutil"
5453
"github.com/operator-framework/operator-controller/internal/conditionsets"
5554
"github.com/operator-framework/operator-controller/internal/contentmanager"
5655
"github.com/operator-framework/operator-controller/internal/labels"
56+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
5757
"github.com/operator-framework/operator-controller/internal/resolve"
5858
rukpaksource "github.com/operator-framework/operator-controller/internal/rukpak/source"
5959
)

internal/action/helm.go renamed to internal/operator-controller/action/helm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
actionclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
1111

12-
olmv1error "github.com/operator-framework/operator-controller/internal/action/error"
12+
olmv1error "github.com/operator-framework/operator-controller/internal/operator-controller/action/error"
1313
)
1414

1515
type ActionClientGetter struct {

internal/action/restconfig.go renamed to internal/operator-controller/action/restconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"sigs.k8s.io/controller-runtime/pkg/client"
1010

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

1515
func ServiceAccountRestConfigMapper(tokenGetter *authentication.TokenGetter) func(ctx context.Context, o client.Object, c *rest.Config) (*rest.Config, error) {

internal/applier/helm_test.go renamed to internal/operator-controller/applier/helm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
2020

2121
v1 "github.com/operator-framework/operator-controller/api/v1"
22-
"github.com/operator-framework/operator-controller/internal/applier"
22+
"github.com/operator-framework/operator-controller/internal/operator-controller/applier"
2323
"github.com/operator-framework/operator-controller/internal/features"
2424
)
2525

internal/bundleutil/bundle_test.go renamed to internal/operator-controller/bundleutil/bundle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/operator-framework/operator-registry/alpha/declcfg"
1010
"github.com/operator-framework/operator-registry/alpha/property"
1111

12-
"github.com/operator-framework/operator-controller/internal/bundleutil"
12+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
1313
)
1414

1515
func TestGetVersion(t *testing.T) {

internal/catalogmetadata/cache/cache.go renamed to internal/operator-controller/catalogmetadata/cache/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/operator-framework/operator-registry/alpha/declcfg"
1212

13-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
13+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/client"
1414
)
1515

1616
var _ client.Cache = &filesystemCache{}

internal/catalogmetadata/cache/cache_test.go renamed to internal/operator-controller/catalogmetadata/cache/cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/stretchr/testify/require"
1919
"k8s.io/apimachinery/pkg/util/sets"
2020

21-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/cache"
21+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/cache"
2222
)
2323

2424
const (

internal/catalogmetadata/client/client_test.go renamed to internal/operator-controller/catalogmetadata/client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/operator-framework/operator-registry/alpha/declcfg"
1818

1919
catalogd "github.com/operator-framework/operator-controller/catalogd/api/v1"
20-
catalogClient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
20+
catalogClient "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/client"
2121
)
2222

2323
func defaultCatalog() *catalogd.ClusterCatalog {

internal/catalogmetadata/compare/compare.go renamed to internal/operator-controller/catalogmetadata/compare/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/operator-framework/operator-registry/alpha/declcfg"
77

8-
"github.com/operator-framework/operator-controller/internal/bundleutil"
8+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
99
)
1010

1111
// ByVersion is a sort "less" function that orders bundles

internal/catalogmetadata/compare/compare_test.go renamed to internal/operator-controller/catalogmetadata/compare/compare_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/operator-framework/operator-registry/alpha/declcfg"
1111
"github.com/operator-framework/operator-registry/alpha/property"
1212

13-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/compare"
13+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
1414
)
1515

1616
func TestByVersion(t *testing.T) {

internal/catalogmetadata/filter/bundle_predicates.go renamed to internal/operator-controller/catalogmetadata/filter/bundle_predicates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/operator-framework/operator-registry/alpha/declcfg"
77

8-
"github.com/operator-framework/operator-controller/internal/bundleutil"
8+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
99
)
1010

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

internal/catalogmetadata/filter/bundle_predicates_test.go renamed to internal/operator-controller/catalogmetadata/filter/bundle_predicates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/operator-framework/operator-registry/alpha/declcfg"
1212
"github.com/operator-framework/operator-registry/alpha/property"
1313

14-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
14+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter"
1515
)
1616

1717
func TestInMastermindsSemverRange(t *testing.T) {

internal/catalogmetadata/filter/filter_test.go renamed to internal/operator-controller/catalogmetadata/filter/filter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/operator-framework/operator-registry/alpha/declcfg"
99

10-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
10+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter"
1111
)
1212

1313
func TestFilter(t *testing.T) {

internal/catalogmetadata/filter/successors_test.go renamed to internal/operator-controller/catalogmetadata/filter/successors_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/operator-framework/operator-registry/alpha/property"
1515

1616
ocv1 "github.com/operator-framework/operator-controller/api/v1"
17-
"github.com/operator-framework/operator-controller/internal/bundleutil"
18-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/compare"
17+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
18+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
1919
)
2020

2121
func TestSuccessorsPredicate(t *testing.T) {

internal/resolve/catalog.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919

2020
ocv1 "github.com/operator-framework/operator-controller/api/v1"
2121
catalogd "github.com/operator-framework/operator-controller/catalogd/api/v1"
22-
"github.com/operator-framework/operator-controller/internal/bundleutil"
23-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/compare"
24-
"github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
22+
"github.com/operator-framework/operator-controller/internal/operator-controller/bundleutil"
23+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/compare"
24+
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/filter"
2525
)
2626

2727
type ValidationFunc func(*declcfg.Bundle) error

0 commit comments

Comments
 (0)