Skip to content

Commit

Permalink
Merge pull request #96 from k8stopologyawareschedwg/set_api_to_v1beta2
Browse files Browse the repository at this point in the history
api:vendor: move deployer to use v1beta2's scheduler-plugins scheme
  • Loading branch information
ffromani authored Mar 28, 2022
2 parents 62924ed + 958834f commit 1fa3a7d
Show file tree
Hide file tree
Showing 32 changed files with 4,606 additions and 350 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiserver v0.22.6 // indirect
k8s.io/component-base v0.22.6 // indirect
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
k8s.io/kubernetes v1.22.6 // indirect
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,7 @@ k8s.io/apiextensions-apiserver v0.22.3 h1:bKku7MqawIbtTZc084BZoMV4fz0WZuvCnB5E+y
k8s.io/apiextensions-apiserver v0.22.3/go.mod h1:f4plF+CXeqI89jAXL0Ml4LI/kSAZ54JS94+XOX1sae8=
k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk=
k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apiserver v0.22.3 h1:x21xyLQ2qvPr5vjOTVOBaSJu8svnU2wfLOfSjNJEOdw=
k8s.io/apiserver v0.22.3/go.mod h1:oam7lH/F1Kto/WTamyQYrD68fS0mGUBORAFf6x/9Mxs=
k8s.io/cli-runtime v0.22.3/go.mod h1:um6JvCxV9Hrhq0zCUxcqYoY7/wF64g6IYgOViI8sg6Q=
k8s.io/client-go v0.22.3 h1:6onkOSc+YNdwq5zXE0wFXicq64rrym+mXwHu/CPVGO4=
Expand Down
14 changes: 7 additions & 7 deletions pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (
apiextensionv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
kubeschedulerconfigv1beta1 "k8s.io/kube-scheduler/config/v1beta1"
kubeschedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2"
"k8s.io/utils/pointer"
apiconfig "sigs.k8s.io/scheduler-plugins/pkg/apis/config"
apiconfigv1beta2 "sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2"

rteassets "github.com/k8stopologyawareschedwg/deployer/pkg/assets/rte"
"github.com/k8stopologyawareschedwg/deployer/pkg/deployer/platform"
Expand Down Expand Up @@ -87,8 +87,8 @@ var src embed.FS

func init() {
apiextensionv1.AddToScheme(scheme.Scheme)
apiconfig.AddToScheme(scheme.Scheme)
kubeschedulerconfigv1beta1.AddToScheme(scheme.Scheme)
apiconfigv1beta2.AddToScheme(scheme.Scheme)
kubeschedulerconfigv1beta2.AddToScheme(scheme.Scheme)
machineconfigv1.Install(scheme.Scheme)
securityv1.Install(scheme.Scheme)
}
Expand Down Expand Up @@ -575,20 +575,20 @@ func SecurityContextConstraint(component string) (*securityv1.SecurityContextCon
return scc, nil
}

func KubeSchedulerConfigurationFromData(data []byte) (*kubeschedulerconfigv1beta1.KubeSchedulerConfiguration, error) {
func KubeSchedulerConfigurationFromData(data []byte) (*kubeschedulerconfigv1beta2.KubeSchedulerConfiguration, error) {
obj, err := deserializeObjectFromData(data)
if err != nil {
return nil, err
}

sc, ok := obj.(*kubeschedulerconfigv1beta1.KubeSchedulerConfiguration)
sc, ok := obj.(*kubeschedulerconfigv1beta2.KubeSchedulerConfiguration)
if !ok {
return nil, fmt.Errorf("unexpected type, got %T %v", obj, obj.GetObjectKind())
}
return sc, nil
}

func KubeSchedulerConfigurationToData(sc *kubeschedulerconfigv1beta1.KubeSchedulerConfiguration) ([]byte, error) {
func KubeSchedulerConfigurationToData(sc *kubeschedulerconfigv1beta2.KubeSchedulerConfiguration) ([]byte, error) {
var buf bytes.Buffer
err := SerializeObject(sc, &buf)
return buf.Bytes(), err
Expand Down
202 changes: 202 additions & 0 deletions vendor/k8s.io/apiserver/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/k8s.io/apiserver/pkg/features/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1fa3a7d

Please sign in to comment.