Skip to content

Commit

Permalink
Update API scheme registration for 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed Jul 20, 2020
1 parent 0d2a5da commit 84af398
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package api
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

"sigs.k8s.io/descheduler/pkg/descheduler/scheme"
)

var (
Expand All @@ -35,12 +33,6 @@ const GroupName = "descheduler"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

func init() {
if err := addKnownTypes(scheme.Scheme); err != nil {
panic(err)
}
}

// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
Expand Down
8 changes: 8 additions & 0 deletions pkg/descheduler/scheme/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ package scheme
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"sigs.k8s.io/descheduler/pkg/api"
"sigs.k8s.io/descheduler/pkg/api/v1alpha1"
)

var (
Scheme = runtime.NewScheme()
Codecs = serializer.NewCodecFactory(Scheme)
)

func init() {
utilruntime.Must(api.AddToScheme(Scheme))
utilruntime.Must(v1alpha1.AddToScheme(Scheme))
}

0 comments on commit 84af398

Please sign in to comment.