Skip to content

Commit

Permalink
add v1alpha3 to new controller
Browse files Browse the repository at this point in the history
  • Loading branch information
AmaliMatharaarachchi committed Sep 19, 2024
1 parent 3564581 commit e410748
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
6 changes: 2 additions & 4 deletions adapter/internal/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,8 @@ func Run(conf *config.Config) {
xds.UpdateEnforcerConfig(conf)
if !conf.Adapter.EnableGatewayClassController {
go operator.InitOperator(conf.Adapter.Metrics)
}

if conf.Adapter.EnableGatewayClassController {
SetupRunners(conf)
} else {
go SetupRunners(conf)
}

OUTER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,22 @@ import (
"fmt"
"strings"

"github.com/wso2/apk/adapter/config"
"github.com/wso2/apk/adapter/internal/loggers"
dpcontrollers "github.com/wso2/apk/adapter/internal/operator/controllers/dp"
"github.com/wso2/apk/adapter/internal/operator/gateway-api/provider"
"github.com/wso2/apk/adapter/internal/operator/message"
"github.com/wso2/apk/adapter/internal/operator/status"
"github.com/wso2/apk/adapter/internal/operator/synchronizer"
"github.com/wso2/apk/adapter/pkg/logging"
"github.com/wso2/apk/adapter/pkg/metrics"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"github.com/wso2/apk/adapter/config"
"github.com/wso2/apk/adapter/pkg/metrics"
"github.com/wso2/apk/adapter/internal/loggers"
"github.com/wso2/apk/adapter/pkg/logging"
"github.com/wso2/apk/adapter/internal/operator/synchronizer"
dpcontrollers "github.com/wso2/apk/adapter/internal/operator/controllers/dp"


)

// Provider is the scaffolding for the Kubernetes provider. It sets up dependencies
Expand Down Expand Up @@ -73,7 +71,6 @@ func New(cfg *rest.Config, resources *message.ProviderResources) (*Provider, err
LeaderElectionID: "operator-lease.apk.wso2.com",
}


conf := config.ReadConfigs()
metricsConfig := conf.Adapter.Metrics
if metricsConfig.Enabled {
Expand Down
4 changes: 4 additions & 0 deletions adapter/internal/operator/gateway-api/provider/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package provider
import (
dpv1alpha1 "github.com/wso2/apk/common-go-libs/apis/dp/v1alpha1"
dpv1alpha2 "github.com/wso2/apk/common-go-libs/apis/dp/v1alpha2"
dpv1alpha3 "github.com/wso2/apk/common-go-libs/apis/dp/v1alpha3"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
Expand Down Expand Up @@ -62,6 +63,9 @@ func init() {
if err := dpv1alpha2.AddToScheme(scheme); err != nil {
panic(err)
}
if err := dpv1alpha3.AddToScheme(scheme); err != nil {
panic(err)
}
}

// GetScheme returns a scheme with types supported by the Kubernetes provider.
Expand Down

0 comments on commit e410748

Please sign in to comment.