mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Improve plugin args JSON tags
This commit is contained in:
parent
39ed64ec4c
commit
09598d48f6
@ -131,9 +131,9 @@ type LabelPreference struct {
|
||||
|
||||
// RequestedToCapacityRatioArguments holds arguments specific to RequestedToCapacityRatio priority function.
|
||||
type RequestedToCapacityRatioArguments struct {
|
||||
// Array of point defining priority function shape
|
||||
Shape []UtilizationShapePoint
|
||||
Resources []ResourceSpec
|
||||
// Array of point defining priority function shape.
|
||||
Shape []UtilizationShapePoint `json:"shape"`
|
||||
Resources []ResourceSpec `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// UtilizationShapePoint represents single point of priority function shape
|
||||
|
@ -128,7 +128,7 @@ func TestCreateFromConfig(t *testing.T) {
|
||||
wantArgs := `{"Name":"NodeLabel","Args":{"presentLabels":["zone"],"absentLabels":["foo"],"presentLabelsPreference":["l1"],"absentLabelsPreference":["l2"]}}`
|
||||
verifyPluginConvertion(t, nodelabel.Name, []string{"FilterPlugin", "ScorePlugin"}, prof, &factory.profiles[0], 6, wantArgs)
|
||||
// Verify that service affinity custom predicate/priority is converted to framework plugin.
|
||||
wantArgs = `{"Name":"ServiceAffinity","Args":{"labels":["zone","foo"],"antiAffinityLabelsPreference":["rack","zone"]}}`
|
||||
wantArgs = `{"Name":"ServiceAffinity","Args":{"affinityLabels":["zone","foo"],"antiAffinityLabelsPreference":["rack","zone"]}}`
|
||||
verifyPluginConvertion(t, serviceaffinity.Name, []string{"FilterPlugin", "ScorePlugin"}, prof, &factory.profiles[0], 6, wantArgs)
|
||||
// TODO(#87703): Verify all plugin configs.
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ type Args struct {
|
||||
// Labels are homogeneous for pods that are scheduled to a node.
|
||||
// (i.e. it returns true IFF this pod can be added to this node such that all other pods in
|
||||
// the same service are running on nodes with the exact same values for Labels).
|
||||
AffinityLabels []string `json:"labels,omitempty"`
|
||||
AffinityLabels []string `json:"affinityLabels,omitempty"`
|
||||
// AntiAffinityLabelsPreference are the labels to consider for service anti affinity scoring.
|
||||
AntiAffinityLabelsPreference []string `json:"antiAffinityLabelsPreference,omitempty"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user