Skip to content

Commit

Permalink
Preserve path for cluster server endpoints (fixes virtctl with Rancher)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Knight <git@seanknight.com>
  • Loading branch information
SeanKnight committed Mar 17, 2022
1 parent 27b09bb commit 4cd6269
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion staging/src/kubevirt.io/client-go/kubecli/vmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"path"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -147,7 +148,10 @@ func RequestFromConfig(config *rest.Config, resource, name, namespace, subresour
return nil, fmt.Errorf("Unsupported Protocol %s", u.Scheme)
}

u.Path = fmt.Sprintf("/apis/subresources.kubevirt.io/%s/namespaces/%s/%s/%s/%s", v1.ApiStorageVersion, namespace, resource, name, subresource)
u.Path = path.Join(
u.Path,
fmt.Sprintf("/apis/subresources.kubevirt.io/%s/namespaces/%s/%s/%s/%s", v1.ApiStorageVersion, namespace, resource, name, subresource),
)
req := &http.Request{
Method: http.MethodGet,
URL: u,
Expand Down

0 comments on commit 4cd6269

Please sign in to comment.