Skip to content

Commit

Permalink
remove schema registration from init
Browse files Browse the repository at this point in the history
  • Loading branch information
AmaliMatharaarachchi committed Sep 30, 2024
1 parent 7915971 commit 0e8b50d
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions adapter/internal/operator/gateway-api/provider/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ import (
gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1"
)

var (
// scheme contains all the API types necessary for the provider's dynamic
// clients to work. Any new non-core types must be added here.
//
// NOTE: The discovery mechanism used by the client doesn't automatically
// refresh, so only add types here that are guaranteed to exist before the
// provider starts.
scheme = runtime.NewScheme()
)

func init() {
// GetScheme returns a scheme with types supported by the Kubernetes provider.
func GetScheme() *runtime.Scheme {
// todo(amali) move this to init method once we remove the old operator
scheme := runtime.NewScheme()
if err := clientgoscheme.AddToScheme(scheme); err != nil {
panic(err)
}
Expand All @@ -66,9 +59,6 @@ func init() {
if err := dpv1alpha3.AddToScheme(scheme); err != nil {
panic(err)
}
}

// GetScheme returns a scheme with types supported by the Kubernetes provider.
func GetScheme() *runtime.Scheme {
return scheme
}

0 comments on commit 0e8b50d

Please sign in to comment.