Skip to content

Commit 82b5ef3

Browse files
committed
Bug 1866168: [deprecation] Remove OperatorSource API
This PR removes the OperatorSource API from the cluster
1 parent 82a0785 commit 82b5ef3

File tree

350 files changed

+31
-78366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+31
-78366
lines changed

Gopkg.lock

Lines changed: 1 addition & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ required = [
7878
name = "github.com/operator-framework/operator-lifecycle-manager"
7979
version = "v0.14.1"
8080

81-
[[constraint]]
82-
branch = "master"
83-
name = "github.com/operator-framework/go-appr"
84-
85-
[[constraint]]
86-
name = "github.com/golang/mock"
87-
version = "v1.2.0"
88-
8981
[[constraint]]
9082
branch = "release-4.2"
9183
name = "github.com/openshift/api"

Makefile

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,11 @@ osbs-build:
2121
# hack/build.sh
2222
./build/build.sh
2323

24-
unit: generate-mocks unit-test
24+
unit: unit-test
2525

2626
unit-test:
2727
go test -v ./pkg/...
2828

29-
generate-mocks:
30-
# Build mockgen from the same version used by gomock. This ensures that
31-
# gomock and mockgen are never out of sync.
32-
go install ./vendor/github.com/golang/mock/mockgen
33-
34-
@echo making sure directory for mocks exists
35-
mkdir -p $(MOCKS_DIR)
36-
37-
# $(mockgen) -destination=<Path/file where the mock is generated> -package=<The package that the generated mock files will belong to> -mock_names=<Original Interface name>=<Name of Generated mocked Interface> <Go package path of the original interface> <comma seperated list of the interface you want to mock>
38-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_datastore.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=Reader=DatastoreReader,Writer=DatastoreWriter $(PKG)/datastore Reader,Writer
39-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_phase_reconciler.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=Reconciler=PhaseReconciler $(PKG)/operatorsource Reconciler
40-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_phase_tansitioner.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=Transitioner=PhaseTransitioner $(PKG)/phase Transitioner
41-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_client.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=Client=Client $(PKG)/client Client
42-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_phase_reconciler_strategy.go -package=$(OPERATORSOURCE_MOCK_PKG) $(PKG)/operatorsource PhaseReconcilerFactory
43-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_appregistry.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=ClientFactory=AppRegistryClientFactory,Client=AppRegistryClient $(PKG)/appregistry ClientFactory,Client
44-
$(mockgen) -destination=$(MOCKS_DIR)/$(OPERATORSOURCE_MOCK_PKG)/mock_syncer.go -package=$(OPERATORSOURCE_MOCK_PKG) -mock_names=PackageRefreshNotificationSender=SyncerPackageRefreshNotificationSender $(PKG)/operatorsource PackageRefreshNotificationSender
45-
46-
clean-mocks:
47-
@echo cleaning mock folder
48-
rm -rf $(MOCKS_DIR)
49-
50-
clean: clean-mocks
51-
5229
e2e-test:
5330
./scripts/e2e-tests.sh
5431

cmd/manager/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import (
2121
"github.com/operator-framework/operator-marketplace/pkg/controller/options"
2222
"github.com/operator-framework/operator-marketplace/pkg/defaults"
2323
"github.com/operator-framework/operator-marketplace/pkg/operatorhub"
24-
"github.com/operator-framework/operator-marketplace/pkg/registry"
2524
"github.com/operator-framework/operator-marketplace/pkg/status"
2625
sourceCommit "github.com/operator-framework/operator-marketplace/pkg/version"
2726
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
2827
"github.com/operator-framework/operator-sdk/pkg/leader"
2928
sdkVersion "github.com/operator-framework/operator-sdk/version"
3029
log "github.com/sirupsen/logrus"
3130
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
31+
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
3232
kruntime "k8s.io/apimachinery/pkg/runtime"
3333
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
3434
"k8s.io/client-go/rest"
@@ -62,10 +62,8 @@ func main() {
6262
printVersion()
6363

6464
// Parse the command line arguments
65-
flag.StringVar(&registry.ServerImage, "registryServerImage",
66-
registry.DefaultServerImage, "the image to use for creating the operator registry pod")
6765
flag.StringVar(&defaults.Dir, "defaultsDir",
68-
"", "the directory where the default OperatorSources are stored")
66+
"", "the directory where the default CatalogSources are stored")
6967
var clusterOperatorName string
7068
flag.StringVar(&clusterOperatorName, "clusterOperatorName", "", "the name of the OpenShift ClusterOperator that should reflect this operator's status, or the empty string to disable ClusterOperator updates")
7169
flag.Parse()
@@ -153,7 +151,7 @@ func main() {
153151
}
154152

155153
// Setup all Controllers
156-
if err := controller.AddToManager(mgr, options.ControllerOptions{SyncSender: statusReporter}); err != nil {
154+
if err := controller.AddToManager(mgr, options.ControllerOptions{}); err != nil {
157155
exit(err)
158156
}
159157

@@ -176,14 +174,14 @@ func main() {
176174

177175
// migrate away from Marketplace API
178176
clientGo, err := client.New(cfg, client.Options{Scheme: mgr.GetScheme()})
179-
if err != nil {
177+
if err != nil && !k8sErrors.IsNotFound(err) {
180178
log.Error(err, "Failed to instantiate client for migrator")
181179
os.Exit(1)
182180
}
183181
migrator := migrator.New(clientGo)
184182
err = migrator.Migrate()
185183
if err != nil {
186-
log.Error(err, "[migration] Error in migrating Marketplace away from CatalogSourceConfig API")
184+
log.Error(err, "[migration] Error in migrating Marketplace away from OperatorSource API")
187185
}
188186

189187
// Populate the global default OperatorSources definition and config

0 commit comments

Comments
 (0)