fix tests related to secrets (#1198)

1. fix the path used to read secret data
without this fix, the path to the compose file is added to the already
absolute path, hence readFile was unable to find the secrets file

2. fix the expected json format
mountPath includes the entire path including the name of the secret
This commit is contained in:
Chander G authored and Hang Yan committed 2019-12-04 10:32:29 +08:00
1 parent 30736a3973
commit 356c64890c
6 files changed
+17 -18

No files matched your search

+5 -1
View File
@@ -39,6 +39,10 @@
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
@@ -65,7 +69,7 @@
"volumeMounts": [
{
"name": "my_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_secret"
}
]
}
+1 -1
View File
@@ -90,7 +90,7 @@
"volumeMounts": [
{
"name": "my_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_secret"
}
]
}
+6 -2
View File
@@ -39,6 +39,10 @@
"creationTimestamp": null,
"labels": {
"io.kompose.service": "redis"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
@@ -76,11 +80,11 @@
"volumeMounts": [
{
"name": "my_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_secret"
},
{
"name": "my_other_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_other_secret"
}
]
}
+2 -2
View File
@@ -101,11 +101,11 @@
"volumeMounts": [
{
"name": "my_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_secret"
},
{
"name": "my_other_secret",
"mountPath": "/run/secrets"
"mountPath": "/run/secrets/my_other_secret"
}
]
}