Skip to content

Commit fa68d8b

Browse files
ankitathomascamilamacedo86
authored andcommitted
fix catalogd version variable paths in Makefile (operator-framework#1705)
Signed-off-by: Ankita Thomas <[email protected]> [monorepo - phase 2] : Move the internal files from catalogd to operator-controller
1 parent b73874e commit fa68d8b

27 files changed

+46
-79
lines changed

catalogd/cmd/catalogd/main.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import (
2020
"crypto/tls"
2121
"flag"
2222
"fmt"
23+
"github.com/operator-framework/operator-controller/internal/controllers/core"
24+
"github.com/operator-framework/operator-controller/internal/garbagecollection"
25+
catalogdmetrics "github.com/operator-framework/operator-controller/internal/metrics"
26+
"github.com/operator-framework/operator-controller/internal/serverutil"
27+
"github.com/operator-framework/operator-controller/internal/source"
28+
"github.com/operator-framework/operator-controller/internal/webhook"
2329
"log"
2430
"net/url"
2531
"os"
@@ -54,16 +60,10 @@ import (
5460
crwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
5561

5662
catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
57-
corecontrollers "github.com/operator-framework/operator-controller/catalogd/internal/controllers/core"
58-
"github.com/operator-framework/operator-controller/catalogd/internal/features"
59-
"github.com/operator-framework/operator-controller/catalogd/internal/garbagecollection"
60-
catalogdmetrics "github.com/operator-framework/operator-controller/catalogd/internal/metrics"
61-
"github.com/operator-framework/operator-controller/catalogd/internal/serverutil"
62-
"github.com/operator-framework/operator-controller/catalogd/internal/source"
63-
"github.com/operator-framework/operator-controller/catalogd/internal/storage"
64-
"github.com/operator-framework/operator-controller/catalogd/internal/version"
65-
"github.com/operator-framework/operator-controller/catalogd/internal/webhook"
63+
"github.com/operator-framework/operator-controller/internal/features"
6664
"github.com/operator-framework/operator-controller/internal/fsutil"
65+
"github.com/operator-framework/operator-controller/internal/storage"
66+
"github.com/operator-framework/operator-controller/internal/version"
6767
)
6868

6969
var (
@@ -127,7 +127,7 @@ func main() {
127127
pflag.Parse()
128128

129129
if catalogdVersion {
130-
fmt.Printf("%#v\n", version.Version())
130+
fmt.Printf("%#v\n", version.String())
131131
os.Exit(0)
132132
}
133133

@@ -324,7 +324,7 @@ func main() {
324324
os.Exit(1)
325325
}
326326

327-
if err = (&corecontrollers.ClusterCatalogReconciler{
327+
if err = (&core.ClusterCatalogReconciler{
328328
Client: mgr.GetClient(),
329329
Unpacker: unpacker,
330330
Storage: localStorage,
@@ -335,7 +335,7 @@ func main() {
335335

336336
if globalPullSecretKey != nil {
337337
setupLog.Info("creating SecretSyncer controller for watching secret", "Secret", globalPullSecret)
338-
err := (&corecontrollers.PullSecretReconciler{
338+
err := (&core.PullSecretReconciler{
339339
Client: mgr.GetClient(),
340340
AuthFilePath: authFilePath,
341341
SecretKey: *globalPullSecretKey,

catalogd/internal/features/features.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

catalogd/internal/version/version.go

Lines changed: 0 additions & 36 deletions
This file was deleted.

config/base/rbac/role.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,38 @@ rules:
2121
resources:
2222
- clustercatalogs
2323
verbs:
24+
- create
25+
- delete
2426
- get
2527
- list
28+
- patch
29+
- update
2630
- watch
2731
- apiGroups:
2832
- olm.operatorframework.io
2933
resources:
30-
- clusterextensions
34+
- clustercatalogs/finalizers
35+
- clusterextensions/finalizers
36+
verbs:
37+
- update
38+
- apiGroups:
39+
- olm.operatorframework.io
40+
resources:
41+
- clustercatalogs/status
3142
verbs:
3243
- get
33-
- list
3444
- patch
3545
- update
36-
- watch
3746
- apiGroups:
3847
- olm.operatorframework.io
3948
resources:
40-
- clusterextensions/finalizers
49+
- clusterextensions
4150
verbs:
51+
- get
52+
- list
53+
- patch
4254
- update
55+
- watch
4356
- apiGroups:
4457
- olm.operatorframework.io
4558
resources:

catalogd/internal/controllers/core/clustercatalog_controller.go renamed to internal/controllers/core/clustercatalog_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context" // #nosec
2121
"errors"
2222
"fmt"
23+
"github.com/operator-framework/operator-controller/internal/source"
2324
"slices"
2425
"sync"
2526
"time"
@@ -38,8 +39,7 @@ import (
3839
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3940

4041
catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
41-
"github.com/operator-framework/operator-controller/catalogd/internal/source"
42-
"github.com/operator-framework/operator-controller/catalogd/internal/storage"
42+
"github.com/operator-framework/operator-controller/internal/storage"
4343
)
4444

4545
const (

catalogd/internal/controllers/core/clustercatalog_controller_test.go renamed to internal/controllers/core/clustercatalog_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"github.com/operator-framework/operator-controller/internal/source"
8+
"github.com/operator-framework/operator-controller/internal/storage"
79
"io/fs"
810
"net/http"
911
"testing"
@@ -21,8 +23,6 @@ import (
2123
"sigs.k8s.io/controller-runtime/pkg/reconcile"
2224

2325
catalogdv1 "github.com/operator-framework/operator-controller/catalogd/api/v1"
24-
"github.com/operator-framework/operator-controller/catalogd/internal/source"
25-
"github.com/operator-framework/operator-controller/catalogd/internal/storage"
2626
)
2727

2828
var _ source.Unpacker = &MockSource{}

catalogd/internal/controllers/core/pull_secret_controller.go renamed to internal/controllers/core/pull_secret_controller.go

File renamed without changes.

catalogd/internal/controllers/core/pull_secret_controller_test.go renamed to internal/controllers/core/pull_secret_controller_test.go

File renamed without changes.

internal/features/features.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ const (
99
// Add new feature gates constants (strings)
1010
// Ex: SomeFeature featuregate.Feature = "SomeFeature"
1111
PreflightPermissions featuregate.Feature = "PreflightPermissions"
12+
APIV1QueryHandler = featuregate.Feature("APIV1QueryHandler")
1213
)
1314

15+
var catalogdFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
16+
APIV1QueryHandler: {Default: false, PreRelease: featuregate.Alpha},
17+
}
18+
1419
var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
1520
// Add new feature gate definitions
1621
// Ex: SomeFeature: {...}
@@ -23,6 +28,10 @@ var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.Feature
2328

2429
var OperatorControllerFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate()
2530

31+
var CatalogdFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate()
32+
2633
func init() {
2734
utilruntime.Must(OperatorControllerFeatureGate.Add(operatorControllerFeatureGates))
35+
utilruntime.Must(CatalogdFeatureGate.Add(catalogdFeatureGates))
36+
2837
}
File renamed without changes.

0 commit comments

Comments
 (0)