Closed jay7x closed 3 years ago
Describe the bug dgoss edit overwrites goss.yaml with goss_wait.yaml contents on exit. Check following code:
dgoss edit
goss.yaml
goss_wait.yaml
This line will overwrite ${GOSS_FILE:-goss.yaml} with any file for which get_docker_file function was called:
${GOSS_FILE:-goss.yaml}
get_docker_file
docker cp "$id:$1" "${GOSS_FILES_PATH}/${GOSS_FILE:-goss.yaml}"
I'd suggest to pass 2nd argument into this function with the output file name desired.
How To Reproduce Create both goss.yaml and goss_wait.yaml then run dgoss edit and exit the shell after.
Expected Behavior goss_wait.yaml must be copied into the goss_wait.yaml file but not into the goss.yaml file.
Actual Behavior I have GOSS_FILE overridden here, so output filename is different. But from dgoss code it doesn't matters actually.
dgoss
INFO: Creating docker container INFO: Copy goss files into container INFO: Starting docker container INFO: Container ID: 6aae6002 INFO: Run goss add/autoadd to add resources $ exit INFO: Copied '/goss/goss.yaml' from container to './Test_2.249.1.yaml' INFO: Copied '/goss/goss_wait.yaml' from container to './Test_2.249.1.yaml' INFO: Deleting container
Environment:
Good catch! Definitely a bug. Marking as approved.
I can take a look at it later this week or next week. Unless, you have a fix handy that you're planning to submit.
I made the PR for this :)
Describe the bug
dgoss edit
overwritesgoss.yaml
withgoss_wait.yaml
contents on exit. Check following code:goss_wait.yaml
file: https://github.com/aelsabbahy/goss/blob/master/extras/dgoss/dgoss#L114This line will overwrite
${GOSS_FILE:-goss.yaml}
with any file for whichget_docker_file
function was called:I'd suggest to pass 2nd argument into this function with the output file name desired.
How To Reproduce Create both
goss.yaml
andgoss_wait.yaml
then rundgoss edit
and exit the shell after.Expected Behavior
goss_wait.yaml
must be copied into thegoss_wait.yaml
file but not into thegoss.yaml
file.Actual Behavior I have GOSS_FILE overridden here, so output filename is different. But from
dgoss
code it doesn't matters actually.Environment: