mirror of https://github.com/kubernetes/kops.git
Merge pull request #1633 from justinsb/file_urls
Recognize file:// urls
This commit is contained in:
commit
08f7a73dc9
|
|
@ -44,7 +44,7 @@ var Context = VFSContext{
|
|||
// metadata: reads from instance metadata on GCE/AWS
|
||||
// http / https: reads from HTTP
|
||||
func (c *VFSContext) ReadFile(location string) ([]byte, error) {
|
||||
if strings.Contains(location, "://") {
|
||||
if strings.Contains(location, "://") && !strings.HasPrefix(location, "file://") {
|
||||
// Handle our special case schemas
|
||||
u, err := url.Parse(location)
|
||||
if err != nil {
|
||||
|
|
@ -70,9 +70,10 @@ func (c *VFSContext) ReadFile(location string) ([]byte, error) {
|
|||
case "http", "https":
|
||||
return c.readHttpLocation(location, nil)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
location = strings.TrimPrefix(location, "file://")
|
||||
|
||||
p, err := c.BuildVfsPath(location)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Reference in New Issue