Skip to content

Commit

Permalink
[deprecation]: Deprecate CatalogSourceConfig API
Browse files Browse the repository at this point in the history
This PR removes the CatalogSourceConfig API in it's entirety.
  • Loading branch information
anik120 committed Apr 18, 2020
1 parent e3db2ea commit 44612e7
Show file tree
Hide file tree
Showing 44 changed files with 179 additions and 2,322 deletions.
25 changes: 17 additions & 8 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import (
"time"

"github.com/operator-framework/operator-marketplace/pkg/metrics"
"github.com/operator-framework/operator-marketplace/pkg/migrator"

apiconfigv1 "github.com/openshift/api/config/v1"
olm "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/signals"
"github.com/operator-framework/operator-marketplace/pkg/apis"
configv1 "github.com/operator-framework/operator-marketplace/pkg/apis/config/v1"
"github.com/operator-framework/operator-marketplace/pkg/catalogsourceconfig"
"github.com/operator-framework/operator-marketplace/pkg/controller"
"github.com/operator-framework/operator-marketplace/pkg/controller/options"
"github.com/operator-framework/operator-marketplace/pkg/defaults"
"github.com/operator-framework/operator-marketplace/pkg/operatorhub"
"github.com/operator-framework/operator-marketplace/pkg/operatorsource"
"github.com/operator-framework/operator-marketplace/pkg/registry"
"github.com/operator-framework/operator-marketplace/pkg/status"
sourceCommit "github.com/operator-framework/operator-marketplace/pkg/version"
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
"github.com/operator-framework/operator-sdk/pkg/leader"
sdkVersion "github.com/operator-framework/operator-sdk/version"
log "github.com/sirupsen/logrus"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
kruntime "k8s.io/apimachinery/pkg/runtime"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -122,9 +122,6 @@ func main() {

log.Print("Registering Components.")

catalogsourceconfig.InitializeStaticSyncer(mgr.GetClient(), initialWait)
registrySyncer := operatorsource.NewRegistrySyncer(mgr.GetClient(), initialWait, resyncInterval, updateNotificationSendWait, catalogsourceconfig.Syncer, catalogsourceconfig.Syncer)

// Setup Scheme for all defined resources
if err := apis.AddToScheme(mgr.GetScheme()); err != nil {
exit(err)
Expand All @@ -135,6 +132,9 @@ func main() {
exit(err)
}

if err := v1beta1.AddToScheme(mgr.GetScheme()); err != nil {
exit(err)
}
// If the config API is available add the config resources to the scheme
if configv1.IsAPIAvailable() {
if err := apiconfigv1.AddToScheme(mgr.GetScheme()); err != nil {
Expand Down Expand Up @@ -174,6 +174,18 @@ func main() {

log.Print("Starting the Cmd.")

// migrate away from Marketplace API
clientGo, err := client.New(cfg, client.Options{Scheme: mgr.GetScheme()})
if err != nil {
log.Error(err, "Failed to instantiate client for migrator")
os.Exit(1)
}
migrator := migrator.New(clientGo)
err = migrator.Migrate()
if err != nil {
log.Error(err, "[migration] Error in migrating Marketplace away from CatalogSourceConfig API")
}

// Populate the global default OperatorSources definition and config
err = defaults.PopulateGlobals()
if err != nil {
Expand All @@ -189,9 +201,6 @@ func main() {
// statusReportingDoneCh will be closed after the operator has successfully stopped reporting ClusterOperator status.
statusReportingDoneCh := statusReporter.StartReporting()

go registrySyncer.Sync(stopCh)
go catalogsourceconfig.Syncer.Sync(stopCh)

// Start the Cmd
err = mgr.Start(stopCh)

Expand Down
10 changes: 0 additions & 10 deletions deploy/examples/catalogsourceconfig.cr.yaml

This file was deleted.

123 changes: 0 additions & 123 deletions deploy/upstream/02_catalogsourceconfig.crd.yaml

This file was deleted.

6 changes: 2 additions & 4 deletions deploy/upstream/03_operatorsource.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ spec:
type: string
type: object
displayName:
description: DisplayName is passed along to the CatalogSourceConfig
to be used by the resulting CatalogSource to be used as a pretty name.
description: DisplayName is passed along to the resulting CatalogSource to be used as a pretty name.
type: string
endpoint:
description: Endpoint points to the remote app registry server from
where operator manifests can be fetched.
type: string
publisher:
description: Publisher is passed along to the CatalogSourceConfig to
be used by the resulting CatalogSource that defines what entity published
description: Publisher is passed along to the resulting CatalogSource that defines what entity published
the artifacts from the OperatorSource.
type: string
registryNamespace:
Expand Down
7 changes: 7 additions & 0 deletions deploy/upstream/05_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ rules:
- get
- update
- list
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- delete
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
17 changes: 0 additions & 17 deletions docs/csc-source-resolution.md

This file was deleted.

123 changes: 0 additions & 123 deletions manifests/02_catalogsourceconfig.crd.yaml

This file was deleted.

0 comments on commit 44612e7

Please sign in to comment.