Closed Waterdrips closed 3 years ago
@AkihiroSuda do you have any suggestions? I visually inspected the code and it looked to be as expected.
Alistair perhaps we are not using a reference in a loop somewhere?
Here is an example of it happening for me:
curl -s http://admin:$(sudo cat /var/lib/faasd/secrets/basic-auth-password)@localhost:8081/system/functions|jq
[
{
"name": "f2",
"image": "docker.io/functions/figlet:0.13.0",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 0,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
},
{
"name": "f1",
"image": "docker.io/functions/figlet:0.13.0",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 0,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
}
]
The /system/function/NAME endpoint appears to be stable in its output:
alex@alexx:~$ curl -s http://admin:$(sudo cat /var/lib/faasd/secrets/basic-auth-password)@localhost:8081/system/function/f1|jq
{
"name": "f1",
"image": "",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 1,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
}
alex@alexx:~$ curl -s http://admin:$(sudo cat /var/lib/faasd/secrets/basic-auth-password)@localhost:8081/system/function/f1|jq
{
"name": "f1",
"image": "",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 1,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
}
alex@alexx:~$ curl -s http://admin:$(sudo cat /var/lib/faasd/secrets/basic-auth-password)@localhost:8081/system/function/f1|jq
{
"name": "f1",
"image": "",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 1,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
}
alex@alexx:~$ curl -s http://admin:$(sudo cat /var/lib/faasd/secrets/basic-auth-password)@localhost:8081/system/function/f1|jq
{
"name": "f1",
"image": "",
"invocationCount": 0,
"replicas": 1,
"envProcess": "",
"availableReplicas": 1,
"labels": {},
"annotations": {
"f1": "1"
},
"namespace": "openfaas-fn"
}
alex@alexx:~$
/close
I have a setup in faasd (On Rpi3) . Installed by cloning faasd (master) and running the install script in
./hack
directoryit has 2x functions, one has annotations, the other does not:
When i curl
/system/functions
sometimes they both have the annotations set onnodeinfo
sometimes neither have the annotation
Expected Behaviour
We always get the correct annotations for a function returned by this call
Current Behaviour
sometimes we get both functions showing an annotation, sometimes neither
Possible Solution
Looks like the faasd provider code is the place to start looking
Steps to Reproduce (for bugs)
/system/fucntions
endpoint a few times, you should see neither, then both having the annotationsContext
The cron-connector calls
/system/functions
and then builds the schedules based on the results, so we see it invoking both, or neither.