Skip to content

Commit

Permalink
generate code for state parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sivanzcw committed Nov 5, 2019
1 parent fbdda90 commit 21b08a4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
11 changes: 11 additions & 0 deletions pkg/apis/scheduling/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package v1alpha1

import (
"unsafe"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"

"volcano.sh/volcano/pkg/apis/scheduling"
)

Expand All @@ -17,6 +21,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
// functions are the same as the autogenerated ones in every other way.
err := scheme.AddConversionFuncs(
Convert_scheduling_QueueStatus_To_v1alpha1_QueueStatus,
Convert_scheduling_QueueSpec_To_v1alpha1_QueueSpec,
)
if err != nil {
return err
Expand All @@ -31,3 +36,9 @@ func Convert_scheduling_QueueStatus_To_v1alpha1_QueueStatus(in *scheduling.Queue
out.Running = in.Running
return nil
}

func Convert_scheduling_QueueSpec_To_v1alpha1_QueueSpec(in *scheduling.QueueSpec, out *QueueSpec, s conversion.Scope) error {
out.Weight = in.Weight
out.Capability = *(*v1.ResourceList)(unsafe.Pointer(&in.Capability))
return nil
}
12 changes: 7 additions & 5 deletions pkg/apis/scheduling/v1alpha1/zz_generated.conversion.go

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

4 changes: 4 additions & 0 deletions pkg/apis/scheduling/v1alpha2/zz_generated.conversion.go

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

0 comments on commit 21b08a4

Please sign in to comment.