Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

Unescape the resource and namespace to allow names with : in them #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -189,6 +190,15 @@ func resourceFromSelflink(s string) (resource, namespace string, ok bool) {
break
}
}

var err error
if resource, err = url.PathUnescape(resource); err != nil {
return "", "", false
}
if namespace, err = url.PathUnescape(namespace); err != nil {
return "", "", false
}

return resource, namespace, true
}

Expand Down