mirror of https://github.com/docker/docs.git
classify whether constraint error or affinity error
Signed-off-by: Sun Hongliang <allen.sun@daocloud.io>
This commit is contained in:
parent
a91f1818c4
commit
01fc95fe31
|
@ -69,7 +69,7 @@ func (f *AffinityFilter) Filter(config *cluster.ContainerConfig, nodes []*node.N
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
return nil, fmt.Errorf("unable to find a node that satisfies %s%s%s", affinity.key, OPERATORS[affinity.operator], affinity.value)
|
return nil, fmt.Errorf("unable to find a node that satisfies the affinity %s%s%s", affinity.key, OPERATORS[affinity.operator], affinity.value)
|
||||||
}
|
}
|
||||||
nodes = candidates
|
nodes = candidates
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ func (f *ConstraintFilter) Filter(config *cluster.ContainerConfig, nodes []*node
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
return nil, fmt.Errorf("unable to find a node that satisfies %s%s%s", constraint.key, OPERATORS[constraint.operator], constraint.value)
|
return nil, fmt.Errorf("unable to find a node that satisfies the constraint %s%s%s", constraint.key, OPERATORS[constraint.operator], constraint.value)
|
||||||
}
|
}
|
||||||
nodes = candidates
|
nodes = candidates
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ function teardown() {
|
||||||
run docker_swarm run -d --name test_container -e constraint:node==node-1 busyboxabcde sleep 1000
|
run docker_swarm run -d --name test_container -e constraint:node==node-1 busyboxabcde sleep 1000
|
||||||
|
|
||||||
# check error message
|
# check error message
|
||||||
[[ "${output}" != *"unable to find a node that satisfies"* ]]
|
[[ "${output}" != *"unable to find a node that satisfies the constraint"* ]]
|
||||||
[[ "${output}" == *"not found"* ]]
|
[[ "${output}" == *"not found"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue