$ docker run -d --name ubuntu01 ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done"
$ docker run -d -e 'affinity:container!=ubuntu0*' --name ubuntu02 ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done"
Whenever I use wildcard character(*) for affinity filter, the docker client always complains about error response:
$ docker ps -a
Error response from daemon: problem loading containers (b884fa50-a553-11e6-ab53-9966a7dac7ef)
The related fwapi log:
NotIndexedError: fwapi_rules does not have indexes that support (fromtags=docker:label:com.docker.swarm.affinities=["container!=ubuntu0*"]=40)
at _substr (/opt/smartdc/moray/lib/objects/common.js:170:23)
at compileQuery (/opt/smartdc/moray/lib/objects/common.js:259:9)
at /opt/smartdc/moray/lib/objects/common.js:227:17
at Array.forEach (native)
at compileQuery (/opt/smartdc/moray/lib/objects/common.js:226:19)
at /opt/smartdc/moray/lib/objects/common.js:206:17
at Array.forEach (native)
at compileQuery (/opt/smartdc/moray/lib/objects/common.js:205:19)
at buildWhereClause (/opt/smartdc/moray/lib/objects/common.js:583:17)
at vasync.forEachPipeline.func (/opt/smartdc/moray/lib/control.js:127:13)
The error comes from moray:
if (_f.initial) {
_v = _value(s, _f.attribute, _f.initial, _f);
if (_v.isArray)
throw new NotIndexedError(b, _f.toString()); // <-- exception occurs
if (_v.value === undefined)
valid = false;
_like_tmp += _v.value + '%';
}
As written in https://apidocs.joyent.com/docker/features/placement, I applied affinity filter like this:
Whenever I use wildcard character(*) for affinity filter, the docker client always complains about error response:
The related fwapi log:
The error comes from moray:
I'm not sure how to fix this error.