Skip to content

Commit f58328a

Browse files
fix: segmentation fault when using podman (kubevirt#1368)
The ephemeral-provider-common.sh script reveals several issues related to Podman, particularly when dumping file content to stdout. The CLI scp command is affected; however, by replacing the string "- >" with the destination folder itself, the command functions correctly. Additionally, it's important to note that the destination folder differs between Podman and Docker due to changes made in ephemeral_provider_common.sh on line 57. As an alternative, we could consider making this workaround more generic by eliminating the use of "- >" altogether. Signed-off-by: Nestor Acuna Blanco <[email protected]>
1 parent f3ed3dc commit f58328a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cluster-up/cluster/k8s-provider-common.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ function up() {
4747
fi
4848
eval ${_cli:?} run $params
4949

50-
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig
50+
# Workaround https://github.com/containers/conmon/issues/315 by not dumping file content to stdout
51+
scp_suffix="- >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER"
52+
if [[ ${_cri_bin} = podman* ]]; then
53+
scp_suffix="/kubevirtci_config"
54+
fi
55+
56+
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf ${scp_suffix}/.kubeconfig
5157

5258
# Set server and disable tls check
5359
export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig
5460
kubectl config set-cluster kubernetes --server="https://$(_main_ip):$(_port k8s)"
5561
kubectl config set-cluster kubernetes --insecure-skip-tls-verify=true
5662

57-
${_cli} scp --prefix ${provider_prefix:?} /usr/bin/kubectl - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl
63+
${_cli} scp --prefix ${provider_prefix:?} /usr/bin/kubectl ${scp_suffix}/.kubectl
5864

5965
chmod u+x ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl
6066

0 commit comments

Comments
 (0)