1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-28 14:41:10 +01:00

Descheduler related modifications.

This commit is contained in:
Avesh Agarwal
2017-09-13 15:19:01 -04:00
parent 8a6b9a814b
commit d634701250
48 changed files with 379 additions and 377 deletions

View File

@@ -15,10 +15,10 @@ limitations under the License.
*/
// +k8s:deepcopy-gen=package,register
// +k8s:conversion-gen=github.com/aveshagarwal/rescheduler/pkg/apis/componentconfig
// +k8s:conversion-gen=github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig
// +k8s:defaulter-gen=TypeMeta
// Package v1alpha1 is the v1alpha1 version of the rescheduler's componentconfig API
// +groupName=reschedulercomponentconfig
// Package v1alpha1 is the v1alpha1 version of the descheduler's componentconfig API
// +groupName=deschedulercomponentconfig
package v1alpha1 // import "github.com/aveshagarwal/rescheduler/pkg/apis/componentconfig/v1alpha1"
package v1alpha1 // import "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig/v1alpha1"

View File

@@ -28,7 +28,7 @@ var (
)
// GroupName is the group name use in this package
const GroupName = "reschedulercomponentconfig"
const GroupName = "deschedulercomponentconfig"
const GroupVersion = "v1alpha1"
// SchemeGroupVersion is group version used to register these objects
@@ -54,7 +54,7 @@ func init() {
func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this will get cleaned up with the scheme types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&ReschedulerConfiguration{},
&DeschedulerConfiguration{},
)
return nil
}

View File

@@ -67,7 +67,7 @@ func init() {
}
}
func (x *ReschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
func (x *DeschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
@@ -86,7 +86,7 @@ func (x *ReschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
const yyr2 bool = false
yyq2[0] = x.Kind != ""
yyq2[1] = x.APIVersion != ""
yyq2[2] = x.ReschedulingInterval != 0
yyq2[2] = x.DeschedulingInterval != 0
yyq2[4] = x.PolicyConfigFile != ""
var yynn2 int
if yyr2 || yy2arr2 {
@@ -157,9 +157,9 @@ func (x *ReschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
yym10 := z.EncBinary()
_ = yym10
if false {
} else if z.HasExtensions() && z.EncExt(x.ReschedulingInterval) {
} else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) {
} else {
r.EncodeInt(int64(x.ReschedulingInterval))
r.EncodeInt(int64(x.DeschedulingInterval))
}
} else {
r.EncodeInt(0)
@@ -167,14 +167,14 @@ func (x *ReschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
if yyq2[2] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("reschedulingInterval"))
r.EncodeString(codecSelferC_UTF81234, string("deschedulingInterval"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(x.ReschedulingInterval) {
} else if z.HasExtensions() && z.EncExt(x.DeschedulingInterval) {
} else {
r.EncodeInt(int64(x.ReschedulingInterval))
r.EncodeInt(int64(x.DeschedulingInterval))
}
}
}
@@ -231,7 +231,7 @@ func (x *ReschedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) {
}
}
func (x *ReschedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) {
func (x *DeschedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
@@ -261,7 +261,7 @@ func (x *ReschedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) {
}
}
func (x *ReschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
func (x *DeschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
@@ -307,11 +307,11 @@ func (x *ReschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De
*((*string)(yyv6)) = r.DecodeString()
}
}
case "reschedulingInterval":
case "deschedulingInterval":
if r.TryDecodeAsNil() {
x.ReschedulingInterval = 0
x.DeschedulingInterval = 0
} else {
yyv8 := &x.ReschedulingInterval
yyv8 := &x.DeschedulingInterval
yym9 := z.DecBinary()
_ = yym9
if false {
@@ -351,7 +351,7 @@ func (x *ReschedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.De
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}
func (x *ReschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
func (x *DeschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
@@ -414,9 +414,9 @@ func (x *ReschedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ReschedulingInterval = 0
x.DeschedulingInterval = 0
} else {
yyv19 := &x.ReschedulingInterval
yyv19 := &x.DeschedulingInterval
yym20 := z.DecBinary()
_ = yym20
if false {

View File

@@ -22,16 +22,16 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type ReschedulerConfiguration struct {
type DeschedulerConfiguration struct {
metav1.TypeMeta `json:",inline"`
// Time interval for rescheduler to run
ReschedulingInterval time.Duration `json:"reschedulingInterval,omitempty"`
// Time interval for descheduler to run
DeschedulingInterval time.Duration `json:"deschedulingInterval,omitempty"`
// KubeconfigFile is path to kubeconfig file with authorization and master
// location information.
KubeconfigFile string `json:"kubeconfigFile"`
// PolicyConfigFile is the filepath to the rescheduler policy configuration.
// PolicyConfigFile is the filepath to the descheduler policy configuration.
PolicyConfigFile string `json:"policyConfigFile,,omitempty"`
}

View File

@@ -21,7 +21,7 @@ limitations under the License.
package v1alpha1
import (
componentconfig "github.com/aveshagarwal/rescheduler/pkg/apis/componentconfig"
componentconfig "github.com/kubernetes-incubator/descheduler/pkg/apis/componentconfig"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
time "time"
@@ -35,31 +35,31 @@ func init() {
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1alpha1_ReschedulerConfiguration_To_componentconfig_ReschedulerConfiguration,
Convert_componentconfig_ReschedulerConfiguration_To_v1alpha1_ReschedulerConfiguration,
Convert_v1alpha1_DeschedulerConfiguration_To_componentconfig_DeschedulerConfiguration,
Convert_componentconfig_DeschedulerConfiguration_To_v1alpha1_DeschedulerConfiguration,
)
}
func autoConvert_v1alpha1_ReschedulerConfiguration_To_componentconfig_ReschedulerConfiguration(in *ReschedulerConfiguration, out *componentconfig.ReschedulerConfiguration, s conversion.Scope) error {
out.ReschedulingInterval = time.Duration(in.ReschedulingInterval)
func autoConvert_v1alpha1_DeschedulerConfiguration_To_componentconfig_DeschedulerConfiguration(in *DeschedulerConfiguration, out *componentconfig.DeschedulerConfiguration, s conversion.Scope) error {
out.DeschedulingInterval = time.Duration(in.DeschedulingInterval)
out.KubeconfigFile = in.KubeconfigFile
out.PolicyConfigFile = in.PolicyConfigFile
return nil
}
// Convert_v1alpha1_ReschedulerConfiguration_To_componentconfig_ReschedulerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_ReschedulerConfiguration_To_componentconfig_ReschedulerConfiguration(in *ReschedulerConfiguration, out *componentconfig.ReschedulerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_ReschedulerConfiguration_To_componentconfig_ReschedulerConfiguration(in, out, s)
// Convert_v1alpha1_DeschedulerConfiguration_To_componentconfig_DeschedulerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_DeschedulerConfiguration_To_componentconfig_DeschedulerConfiguration(in *DeschedulerConfiguration, out *componentconfig.DeschedulerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_DeschedulerConfiguration_To_componentconfig_DeschedulerConfiguration(in, out, s)
}
func autoConvert_componentconfig_ReschedulerConfiguration_To_v1alpha1_ReschedulerConfiguration(in *componentconfig.ReschedulerConfiguration, out *ReschedulerConfiguration, s conversion.Scope) error {
out.ReschedulingInterval = time.Duration(in.ReschedulingInterval)
func autoConvert_componentconfig_DeschedulerConfiguration_To_v1alpha1_DeschedulerConfiguration(in *componentconfig.DeschedulerConfiguration, out *DeschedulerConfiguration, s conversion.Scope) error {
out.DeschedulingInterval = time.Duration(in.DeschedulingInterval)
out.KubeconfigFile = in.KubeconfigFile
out.PolicyConfigFile = in.PolicyConfigFile
return nil
}
// Convert_componentconfig_ReschedulerConfiguration_To_v1alpha1_ReschedulerConfiguration is an autogenerated conversion function.
func Convert_componentconfig_ReschedulerConfiguration_To_v1alpha1_ReschedulerConfiguration(in *componentconfig.ReschedulerConfiguration, out *ReschedulerConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_ReschedulerConfiguration_To_v1alpha1_ReschedulerConfiguration(in, out, s)
// Convert_componentconfig_DeschedulerConfiguration_To_v1alpha1_DeschedulerConfiguration is an autogenerated conversion function.
func Convert_componentconfig_DeschedulerConfiguration_To_v1alpha1_DeschedulerConfiguration(in *componentconfig.DeschedulerConfiguration, out *DeschedulerConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_DeschedulerConfiguration_To_v1alpha1_DeschedulerConfiguration(in, out, s)
}

View File

@@ -34,15 +34,15 @@ func init() {
// to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ReschedulerConfiguration, InType: reflect.TypeOf(&ReschedulerConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_DeschedulerConfiguration, InType: reflect.TypeOf(&DeschedulerConfiguration{})},
)
}
// DeepCopy_v1alpha1_ReschedulerConfiguration is an autogenerated deepcopy function.
func DeepCopy_v1alpha1_ReschedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
// DeepCopy_v1alpha1_DeschedulerConfiguration is an autogenerated deepcopy function.
func DeepCopy_v1alpha1_DeschedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ReschedulerConfiguration)
out := out.(*ReschedulerConfiguration)
in := in.(*DeschedulerConfiguration)
out := out.(*DeschedulerConfiguration)
*out = *in
return nil
}