Closed EduardGomezEscandell closed 1 month ago
To exercise this fix you need a VM image, then you can run this script:
IMAGE=./cirros-0.6.2-x86_64-disk.img
# Start cluster
make cluster-up
make cluster-sync
# Patch cluster (Solved in https://github.com/kubevirt/containerized-data-importer/pull/3306)
host_port=$(./cluster-up/cli.sh ports uploadproxy | xargs)
override="https://127.0.0.1:$host_port"
kubectl patch cdi cdi --type merge -p '{"spec": {"config": {"uploadProxyURLOverride": "'"$override"'"}}}'
# Break the uploadproxy
cat << EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
spec:
podSelector: {}
policyTypes:
- Ingress
EOF
# Exercise the error
virtctl image-upload dv hello-example --size=1Gi --image-path "${IMAGE}" --force-bind --insecure
Keep it mind it takes a while to fail because it keeps retrying.
/cc @awels
/retest
/retest
/cc @awels
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: awels
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What this PR does / why we need it: Upload proxy uses the
httputil.ReverseProxy
.When
httputil.ReverseProxy
fails, it sends a message down the standard library's default logger. This can be seen in the pod's log but the client simply receives a 5xx error and no context.This PR redirects messages away from the standard logger and into both the k8s logger and the client.
Changes in virtctl output BEFORE
AFTER
Changes in upload-proxy logs BEFORE
AFTER
Which issue(s) this PR fixes https://issues.redhat.com/browse/CNV-41624
Special notes for your reviewer:
Release note: