mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
Merge pull request #1480 from ingvagabund/omitempty-for-plugin-args
Plugin args: tag arguments with omitempty to reduce the marshalled json size
This commit is contained in:
@@ -46,8 +46,8 @@ type DeschedulerPolicy struct {
|
|||||||
// Namespaces carries a list of included/excluded namespaces
|
// Namespaces carries a list of included/excluded namespaces
|
||||||
// for which a given strategy is applicable
|
// for which a given strategy is applicable
|
||||||
type Namespaces struct {
|
type Namespaces struct {
|
||||||
Include []string `json:"include"`
|
Include []string `json:"include,omitempty"`
|
||||||
Exclude []string `json:"exclude"`
|
Exclude []string `json:"exclude,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ import (
|
|||||||
type DefaultEvictorArgs struct {
|
type DefaultEvictorArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
NodeSelector string `json:"nodeSelector"`
|
NodeSelector string `json:"nodeSelector,omitempty"`
|
||||||
EvictLocalStoragePods bool `json:"evictLocalStoragePods"`
|
EvictLocalStoragePods bool `json:"evictLocalStoragePods,omitempty"`
|
||||||
EvictDaemonSetPods bool `json:"evictDaemonSetPods"`
|
EvictDaemonSetPods bool `json:"evictDaemonSetPods,omitempty"`
|
||||||
EvictSystemCriticalPods bool `json:"evictSystemCriticalPods"`
|
EvictSystemCriticalPods bool `json:"evictSystemCriticalPods,omitempty"`
|
||||||
IgnorePvcPods bool `json:"ignorePvcPods"`
|
IgnorePvcPods bool `json:"ignorePvcPods,omitempty"`
|
||||||
EvictFailedBarePods bool `json:"evictFailedBarePods"`
|
EvictFailedBarePods bool `json:"evictFailedBarePods,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
PriorityThreshold *api.PriorityThreshold `json:"priorityThreshold"`
|
PriorityThreshold *api.PriorityThreshold `json:"priorityThreshold,omitempty"`
|
||||||
NodeFit bool `json:"nodeFit"`
|
NodeFit bool `json:"nodeFit,omitempty"`
|
||||||
MinReplicas uint `json:"minReplicas"`
|
MinReplicas uint `json:"minReplicas,omitempty"`
|
||||||
MinPodAge *metav1.Duration `json:"minPodAge"`
|
MinPodAge *metav1.Duration `json:"minPodAge,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,15 +24,15 @@ import (
|
|||||||
type LowNodeUtilizationArgs struct {
|
type LowNodeUtilizationArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
UseDeviationThresholds bool `json:"useDeviationThresholds"`
|
UseDeviationThresholds bool `json:"useDeviationThresholds,omitempty"`
|
||||||
Thresholds api.ResourceThresholds `json:"thresholds"`
|
Thresholds api.ResourceThresholds `json:"thresholds"`
|
||||||
TargetThresholds api.ResourceThresholds `json:"targetThresholds"`
|
TargetThresholds api.ResourceThresholds `json:"targetThresholds"`
|
||||||
NumberOfNodes int `json:"numberOfNodes"`
|
NumberOfNodes int `json:"numberOfNodes,omitempty"`
|
||||||
|
|
||||||
// Naming this one differently since namespaces are still
|
// Naming this one differently since namespaces are still
|
||||||
// considered while considering resources used by pods
|
// considered while considering resources used by pods
|
||||||
// but then filtered out before eviction
|
// but then filtered out before eviction
|
||||||
EvictableNamespaces *api.Namespaces `json:"evictableNamespaces"`
|
EvictableNamespaces *api.Namespaces `json:"evictableNamespaces,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen=true
|
// +k8s:deepcopy-gen=true
|
||||||
@@ -42,9 +42,9 @@ type HighNodeUtilizationArgs struct {
|
|||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Thresholds api.ResourceThresholds `json:"thresholds"`
|
Thresholds api.ResourceThresholds `json:"thresholds"`
|
||||||
NumberOfNodes int `json:"numberOfNodes"`
|
NumberOfNodes int `json:"numberOfNodes,omitempty"`
|
||||||
// Naming this one differently since namespaces are still
|
// Naming this one differently since namespaces are still
|
||||||
// considered while considering resources used by pods
|
// considered while considering resources used by pods
|
||||||
// but then filtered out before eviction
|
// but then filtered out before eviction
|
||||||
EvictableNamespaces *api.Namespaces `json:"evictableNamespaces"`
|
EvictableNamespaces *api.Namespaces `json:"evictableNamespaces,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ import (
|
|||||||
type PodLifeTimeArgs struct {
|
type PodLifeTimeArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
MaxPodLifeTimeSeconds *uint `json:"maxPodLifeTimeSeconds"`
|
MaxPodLifeTimeSeconds *uint `json:"maxPodLifeTimeSeconds,omitempty"`
|
||||||
States []string `json:"states"`
|
States []string `json:"states,omitempty"`
|
||||||
IncludingInitContainers bool `json:"includingInitContainers"`
|
IncludingInitContainers bool `json:"includingInitContainers,omitempty"`
|
||||||
IncludingEphemeralContainers bool `json:"includingEphemeralContainers"`
|
IncludingEphemeralContainers bool `json:"includingEphemeralContainers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@ import (
|
|||||||
type RemoveDuplicatesArgs struct {
|
type RemoveDuplicatesArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
ExcludeOwnerKinds []string `json:"excludeOwnerKinds"`
|
ExcludeOwnerKinds []string `json:"excludeOwnerKinds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ import (
|
|||||||
type RemoveFailedPodsArgs struct {
|
type RemoveFailedPodsArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
ExcludeOwnerKinds []string `json:"excludeOwnerKinds"`
|
ExcludeOwnerKinds []string `json:"excludeOwnerKinds,omitempty"`
|
||||||
MinPodLifetimeSeconds *uint `json:"minPodLifetimeSeconds"`
|
MinPodLifetimeSeconds *uint `json:"minPodLifetimeSeconds,omitempty"`
|
||||||
Reasons []string `json:"reasons"`
|
Reasons []string `json:"reasons,omitempty"`
|
||||||
ExitCodes []int32 `json:"exitCodes"`
|
ExitCodes []int32 `json:"exitCodes,omitempty"`
|
||||||
IncludingInitContainers bool `json:"includingInitContainers"`
|
IncludingInitContainers bool `json:"includingInitContainers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ import (
|
|||||||
type RemovePodsHavingTooManyRestartsArgs struct {
|
type RemovePodsHavingTooManyRestartsArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
PodRestartThreshold int32 `json:"podRestartThreshold"`
|
PodRestartThreshold int32 `json:"podRestartThreshold,omitempty"`
|
||||||
IncludingInitContainers bool `json:"includingInitContainers"`
|
IncludingInitContainers bool `json:"includingInitContainers,omitempty"`
|
||||||
States []string `json:"states"`
|
States []string `json:"states,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ import (
|
|||||||
type RemovePodsViolatingInterPodAntiAffinityArgs struct {
|
type RemovePodsViolatingInterPodAntiAffinityArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
type RemovePodsViolatingNodeAffinityArgs struct {
|
type RemovePodsViolatingNodeAffinityArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
NodeAffinityType []string `json:"nodeAffinityType"`
|
NodeAffinityType []string `json:"nodeAffinityType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ import (
|
|||||||
type RemovePodsViolatingNodeTaintsArgs struct {
|
type RemovePodsViolatingNodeTaintsArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
IncludePreferNoSchedule bool `json:"includePreferNoSchedule"`
|
IncludePreferNoSchedule bool `json:"includePreferNoSchedule,omitempty"`
|
||||||
ExcludedTaints []string `json:"excludedTaints"`
|
ExcludedTaints []string `json:"excludedTaints,omitempty"`
|
||||||
IncludedTaints []string `json:"includedTaints"`
|
IncludedTaints []string `json:"includedTaints,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ import (
|
|||||||
type RemovePodsViolatingTopologySpreadConstraintArgs struct {
|
type RemovePodsViolatingTopologySpreadConstraintArgs struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
Namespaces *api.Namespaces `json:"namespaces"`
|
Namespaces *api.Namespaces `json:"namespaces,omitempty"`
|
||||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||||
Constraints []v1.UnsatisfiableConstraintAction `json:"constraints"`
|
Constraints []v1.UnsatisfiableConstraintAction `json:"constraints,omitempty"`
|
||||||
TopologyBalanceNodeFit *bool `json:"topologyBalanceNodeFit"`
|
TopologyBalanceNodeFit *bool `json:"topologyBalanceNodeFit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user