-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove fatal error from docker secrets #248
Conversation
This commit fixes pawelmalak#242 by catching the error thrown by getSecrets(). The underlying issue exists in docker-secret and has to do with the serviceAccount secret installed automatically by kubernetes.
This fix is meant to be temporary to allow people to continue to use the latest version of flame until docker-secret is updated. All it does is convert a fatal error into a regular error. |
Did you test it? Beacuse it is the exact same thing I did (wrapped |
I'm not gonna lie, the code was a tad rushed and I didn't have time to build and test it. The code I proposed here does not fix the issue unfortunately. I have opened hwkd/docker-secret#1, which has tested working code, and I was able to start Flame with it. I did post a temporary workaround in #242. |
It's still not working for me. I built new image from IDevJoe:master - # flame-k3s.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: flame
spec:
selector:
matchLabels:
app: flame
template:
metadata:
labels:
app: flame
spec:
volumes:
- name: flame-volume
emptyDir: {}
containers:
- name: flame
image: pawelmalak/flame:dev-alpha1
ports:
- containerPort: 5005
volumeMounts:
- mountPath: /app/data
name: flame-volume
env:
- name: PASSWORD
value: flame_password But it's still the same error: # start
kubectl create -f flame-k3s.yml
# get logs
kubectl logs flame-55469bd596-tkbf9
node:internal/fs/utils:344
throw err;
^
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:723:3)
at tryReadSync (node:fs:433:20)
at Object.readFileSync (node:fs:479:19)
at /app/node_modules/docker-secret/dist/index.js:17:39
at Array.forEach (<anonymous>)
at getSecrets (/app/node_modules/docker-secret/dist/index.js:14:15)
at Object.<anonymous> (/app/node_modules/docker-secret/dist/index.js:28:19)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/app/utils/init/initDockerSecrets.js:1:24)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) {
errno: -21,
syscall: 'read',
code: 'EISDIR'
}
# list pods
kubectl get pods
NAME READY STATUS RESTARTS AGE
flame-55469bd596-tkbf9 0/1 CrashLoopBackOff 6 9m30s |
@pawelmalak Try now I forgot to push the new package.json to git |
Now it seems to be working fine. |
Commit c8436aa references the fixed docker-secret. Although it's not entirely ideal, the container could be built off of this until the pull on docker-secret is merged. If it comes down to it, and docker-secret seems abandoned, I'll more than likely just republish it on npm. |
Sorry folks, I didn't notice the PR made by @IDevJoe. My mind was quite preoccupied with work. I've merged the PR on hwkd/docker-secret and published it to npm. |
@pawelmalak The PR here references my repository. Since the root issue is now fixed, I'd recommend changing it back to the repository on npm. Appreciate ya'll. |
This commit fixes #242 by catching the error thrown by getSecrets(). The underlying issue exists in docker-secret and has to do with the serviceAccount secret installed automatically by kubernetes.