Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

ci: Fix FC installation script#1855

Merged
jodh-intel merged 1 commit intokata-containers:masterfrom
GabyCT:topic/fixinstallfc
Jul 26, 2019
Merged

ci: Fix FC installation script#1855
jodh-intel merged 1 commit intokata-containers:masterfrom
GabyCT:topic/fixinstallfc

Conversation

@GabyCT
Copy link
Copy Markdown
Contributor

@GabyCT GabyCT commented Jul 25, 2019

While running multiple times the fc installation script fails to
detect the variables of driver and path at the configuration file. This
ensures that we can detect those variables.

Fixes #1854

Signed-off-by: Gabriela Cervantes gabriela.cervantes.tellez@intel.com

While running multiple times the fc installation script fails to
detect the variables of driver and path at the configuration file. This
ensures that we can detect those variables.

Fixes kata-containers#1854

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
if [ -f $docker_configuration_file ]; then
# Check devicemapper flag
check_devicemapper=$(grep -w '"storage-driver": "${driver}"' $docker_configuration_file | wc -l)
check_devicemapper=$(grep -w '"storage-driver": "'${driver}'"' $docker_configuration_file | wc -l)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @GabyCT
Can you explain why both " and ' are necessary here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcov the docker configuration should looks like

 "storage-driver": "devicemapper"

however, before like I have it grep -w '"storage-driver": "${driver}"' the variable of driver was not being replaced and that was causing to the script to fail when you run it multiple times

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was doing this the script

grep -w '"storage-driver": "${driver}"' /etc/docker/daemon.json

but now with this change is replacing the variable correctly

grep -w '"storage-driver": "devicemapper"' /etc/docker/daemon.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhh, now it's clear.
you are concatenating three strings, and the 1st and 3rd are single quoted:
"storage-driver": " + ${driver} + "

@marcov
Copy link
Copy Markdown
Contributor

marcov commented Jul 25, 2019

lgtm

@marcov
Copy link
Copy Markdown
Contributor

marcov commented Jul 25, 2019

/test

@jodh-intel jodh-intel merged commit cd350d5 into kata-containers:master Jul 26, 2019
@GabyCT GabyCT deleted the topic/fixinstallfc branch July 29, 2021 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix FC installation script

3 participants