290 lines
41 KiB
Go
290 lines
41 KiB
Go
![]() |
// Code generated by go-bindata.
|
||
|
// sources:
|
||
|
// rootfs/etc/nginx/nginx.conf
|
||
|
// rootfs/etc/nginx/template/nginx.tmpl
|
||
|
// rootfs/ingress-controller/clean-nginx-conf.sh
|
||
|
// DO NOT EDIT!
|
||
|
|
||
|
package file
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"compress/gzip"
|
||
|
"fmt"
|
||
|
"io"
|
||
|
"io/ioutil"
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
"strings"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
||
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||
|
}
|
||
|
|
||
|
var buf bytes.Buffer
|
||
|
_, err = io.Copy(&buf, gz)
|
||
|
clErr := gz.Close()
|
||
|
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||
|
}
|
||
|
if clErr != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return buf.Bytes(), nil
|
||
|
}
|
||
|
|
||
|
type asset struct {
|
||
|
bytes []byte
|
||
|
info os.FileInfo
|
||
|
}
|
||
|
|
||
|
type bindataFileInfo struct {
|
||
|
name string
|
||
|
size int64
|
||
|
mode os.FileMode
|
||
|
modTime time.Time
|
||
|
}
|
||
|
|
||
|
func (fi bindataFileInfo) Name() string {
|
||
|
return fi.name
|
||
|
}
|
||
|
func (fi bindataFileInfo) Size() int64 {
|
||
|
return fi.size
|
||
|
}
|
||
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
||
|
return fi.mode
|
||
|
}
|
||
|
func (fi bindataFileInfo) ModTime() time.Time {
|
||
|
return fi.modTime
|
||
|
}
|
||
|
func (fi bindataFileInfo) IsDir() bool {
|
||
|
return false
|
||
|
}
|
||
|
func (fi bindataFileInfo) Sys() interface{} {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var _etcNginxNginxConf = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xca\x41\x0a\x83\x40\x0c\x85\xe1\xfd\x9c\xe2\x41\xf7\x7a\x00\x57\x3d\xca\xa0\x89\x06\x34\x19\x32\x4f\x69\x29\xbd\x7b\x69\xe9\xea\x5f\xfc\xdf\x0d\x77\x5c\x92\x4f\x74\x3b\xda\x2e\xf0\xd5\xfc\x81\x39\x5c\x6d\x3d\xb3\xd2\xc2\xa1\xb6\x0b\xb8\x55\x42\x23\x67\xe9\x7f\xc4\x40\x67\x4d\x0e\xa5\xd9\x82\x31\x4f\x1f\x7f\x63\x68\xb6\x4c\xa5\xc8\x25\xce\x8e\xd7\xbb\x6c\x64\xfb\x76\xa9\x72\x84\x23\x54\xa7\x4f\x00\x00\x00\xff\xff\x75\xb5\xe6\xb8\x77\x00\x00\x00")
|
||
|
|
||
|
func etcNginxNginxConfBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_etcNginxNginxConf,
|
||
|
"etc/nginx/nginx.conf",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func etcNginxNginxConf() (*asset, error) {
|
||
|
bytes, err := etcNginxNginxConfBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "etc/nginx/nginx.conf", size: 119, mode: os.FileMode(420), modTime: time.Unix(1508444716, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var _etcNginxTemplateNginxTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6d\x73\xdb\x38\xd2\xe0\xf7\xfc\x0a\x94\xec\x2a\xdb\xa9\x48\x76\xb2\xd9\x79\xe6\xb1\x2b\x57\xe7\xd8\xc9\xda\x37\x4e\xa2\xb2\x9c\xcc\xd4\x5e\x5d\xa9\x20\xb2\x25\x62\x4d\x01\x5c\x00\xb4\xad\xe4\x74\xbf\xfd\x0a\x6f\x24\x08\x82\x94\x9c\xc9\x64\x66\xb6\x86\x1f\x5c\x16\xd9\x68\x34\x1a\x8d\x06\xfa\x05\xc0\x97\x2f\x68\x17\xe7\x39\x3a\x7e\x85\x46\x68\xbd\x7e\xa2\x7e\x0b\xe0\x77\xc0\x85\x7e\x37\xb1\xff\xdb\x4f\xc9\x7c\xa1\x5f\x9f\xcd\x17\xee\xd5\xa5\xb8\x1c\x7f\xfa\xe1\x0d\xc5\xb3\x1c\x52\xfd\xb1\xf9\xc6\x82\x65\x80\x73\x99\x7d\xfe\x78\x7d\xa9\x61\x2e\xea\x9f\x16\x60\x86\x93\x5b\xa0\xa9\xa9\xf6\xb5\xfb\x61\x3f\x16\x9c\x3d\xac\x2e\x00\xa7\x8e\xae\xb1\x7a\x31\x01\xe9\xde\x59\x38\x9c\xa6\x3e\xd4\x69\xfd\x73\xbd\x7e\xa2\x20\xc8\x5c\x37\x62\x64\xa8\x7b\xc7\x52\x01\x49\xc9\x89\x5c\x29\x80\x9c\xe1\x74\xba\x64\x69\x99\x03\x3a\x04\x99\x1c\xd2\x05\xa1\x0f\x87\xe6\x8d\x38\xa4\x8b\x87\x69\x26\x65\xa1\x40\x5c\x31\x0b\x3e\x12\xec\x44\xa1\x07\x9a\xc6\x6b\xfa\x50\x00\x95\x1c\x27\x84\x2e\x1e\x53\x13\xab\x8b\xf5\xd6\xb4\x8f\x69\xda\x55\xdd\x3e\x05\xf3\xe9\x9f\xa4\xb8\x25\xf4\x8c\xe5\x39\x24\x92\xf1\x0b\x26\x24\x1a\x0c\x0e\x0e\x1e\x43\xd0\x67\x8d\xa3\x83\x96\x14\xc3\x92\x51\xc4\xe6\xf3\x93\x27\x4f\xee\x19\xbf\x05\x3e\x2d\x38\x4b\x40\x08\x10\xc8\xca\xcf\xe8\x67\xfd\x61\x5c\xbd\x5f\xaf\x4f\x9e\x14\x24\x45\x87\xbc\xa4\xa6\xda\x51\x41\xd2\x13\xdb\x32\x0a\x68\xf4\x0e\x3f\xa8\x06\xbd\x25\x39\x08\x74\xa4\xaa\xb2\xc8\x79\x4e\x96\x44\x4e\x29\x9b\x93\x1c\x54\x05\x4d\x50\x85\xd9\x90\x67\x38\x75\xf8\x14\xa9\x46\x1c\x1f\xda\x6a\x18\x5f\x1c\x02\x3d\x4c\x59\x62\x5a\x98\x30\x0e\xae\x69\x99\x5c\xe6\x3b\xb6\x1a\x91\x95\x32\x65\xf7\x74\x2a\xc9\x12\x58\x29\xd1\xd3\x43\x2d\x6f\x87\x4f\x11\xbe\x63\x24\x45\xf7\x98\x48\xc5\x6a\xc9\x18\xca\x19\x5d\xa0\xb4\xe4\xea\x37\x46\x1c\x14\x67\x4d\x81\x2e\x6c\x4d\xc6\x4c\xec\xe7\x1b\xfb\x75\xbd\x46\x27\x4f\x9e\xc0\x1d\x50\x29\xd0\x97\x27\x08\x21\xb4\x2c\x73\x49\xa6\x38\x49\xa0\x90\xc8\x3e\x8c\x9e\xe8\x6f\xb6\x92\x84\x51\x0a\x89\x24\x8c\x0a\x54\x55\xf0\x0e\x3f\x98\x3a\xce\xbc\xaf\x8a\x49\xaa\x60\x29\x00\x85\x0f\x14\x2c\xcf\x4f\x9e\xac\x9f\x3c\x51\x7c\xb3\xb5\xeb\x76\xdf\x83\x2e\x20\x33\x40\x77\x38\x2f\x01\xb1\xb9\xfe\x91\xe9\xe1\x86\x7e\x19\xbe\x65\xfc\x1e\xf3\x14\x52\xf5\x1f\x92\x0c\xcd\x00\x29\xc9\x54\xff\xba\x92\x0b\x60\x53\x52\x20\x2b\x76\x9a\x47\xa6\x82\x6a\xf0\x7c\x14\xa0\x47\xfa\x98\x33\xc9\x12\x96\x23\x0b\xc2\x01\xe7\x53\x52\x4c\x6d\x75\xfa\xd1\x3a\x42\xc9\x9b\x86\x3c\x71\xa8\x20\x17\xd0\x57\xcc\x31\xa7\x22\xf8\x2d\xe3\x46\x69\x54\xac\xf1\x44\xdc\xc7\xc2\x95\x0e\x10\xe4\x0e\x3c\xf6\x7f\xf9\x82\x38\xa6\x0b\x40\xbb\x92\x97\x42\x42\xaa\x1a\x78\xfc\xca\x54\xa1\x9b\x72\x0d\x38\xbf\x1c\x9f\x5d\x9e\x5f\x3b\xaa\x04\xc8\xa9\xc3\x39\xe7\x6c\xe9\xa8\xf2\x30\x74\x50\xa2\xbb\x22\xc5\x12\xcf\xb0\x1a\x49\xa5\x80\x54\xf1\x37\x05\x09\x7c\x49\xa8\xe1\x72\xc2\x4a\x2a\xf9\x0a\xa5\x50\x00\x4d\x95\x58\x32\x6a\x3e\xe4\x04\xa8\x44\x97\x63\x84\xd3\x94\x83\x10\x7e\x17\xf4\x8d\x15\xf5\xa1\x56\x09\x0b\x60\xa4\xf0\x87\x4d\x80\x46\x66\x44\x20\x22\x10\x87\x7f\x97\x84\x6b\x01\x48\x70\x9e\x94\x39\x96\x80\x24\xc7\xf3\x39\x49\xd0\x9c\x71\x44\x68\x4a\xee\x48\x5a\xe2\xbc\xa2\xb9\x14\x8a\xde\x7f\x00\xbb\x1c\x23\x62\xa8\x16\x12\xcb\x52\xa0\x02\x2f\x3c\x91\x31\x34\xb8\x52\xe6\xf1\xd4\x98\x46\x30\x4a\xb1\x3c\xf1\xa1\x95\xd6\xaf\x9e\x26\xf4\x15\x91\x70\x46\xe4\x2a\x2c\x63\x64\xac\xee\x78\xd5\xed\xa1\xcc\x1a\x0d\xfc\x49\x8a\x89\xa1\xd4\x92\x78\x97\x31\x21\xa7\xb6\xbd\x53\xd3\x8a\xe9\x67\x46\x01\x89\x0c\x73\x48\x8f\x63\x00\xc7\x4e\x3a\x2b\x74\xff\x64\x14\x26\xe4\x33\x54\x22\x11\xc5\x3b\x27\xb9\x04\x3e\x9d\xad\xa6\x4a\xb8\x6e\x61\x85\x3c\x44\xe7\x30\xc7\x65\x2e\xdf\x6a\x98\x9f\x60\xd5\x25\x5d\x02\x68\xaa\x15\xab\xf7\x54\x0d\xc6\x84\xb5\xd4\x85\xcc\x38\xe0\x54\x9c\x38\x80\xe9\x3d\x27\x12\x62\xa5\x65\x52\x4c\x29\x2b\x4a\x91\x35\x3f\xd6\xdf\x52\xc8\xf1\xaa\x5d\x30\x67\x8b\xa9\x28\x67\x4a\x96\x40\xc8\xe0\x23\x07\xd5\x5a\xa5\x56\x53\x56\x4a\x4f\x07\xd6\x20\xb7\x00\x05\xce\xc9\x1d\x54\xda\xb7\xe2\xcc\x4f\x00\xc5\xa9\xfa\x84\xd6\x6b\xdb\x86\x1a\xda\x56\x28\xda\xd0\xd7\xee\x8b\xe2\xa2\x2e\x
|
||
|
|
||
|
func etcNginxTemplateNginxTmplBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_etcNginxTemplateNginxTmpl,
|
||
|
"etc/nginx/template/nginx.tmpl",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func etcNginxTemplateNginxTmpl() (*asset, error) {
|
||
|
bytes, err := etcNginxTemplateNginxTmplBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "etc/nginx/template/nginx.tmpl", size: 37465, mode: os.FileMode(420), modTime: time.Unix(1511380479, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var _ingressControllerCleanNginxConfSh = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x92\x41\x6b\xe3\x48\x10\x85\xef\xfa\x15\x6f\x2d\x83\x77\x17\x47\x9d\x78\x0f\x0b\xc9\xc9\x9b\x64\x19\x91\x60\x43\xe4\x4c\x08\x98\x40\xbb\x55\x96\x0a\xa4\x6e\x4d\x75\x2b\xb6\x99\x99\xff\x3e\xb4\xe2\xcc\xc4\x8c\x8e\x55\x4f\xfd\xbe\x7a\x55\xe9\x1f\x6a\xc3\x56\x6d\xb4\xaf\x93\x24\xc5\xb5\xeb\x0e\xc2\x55\x1d\x30\x3b\xbf\xf8\x17\xab\x9a\x70\xd7\x6f\x48\x2c\x05\xf2\x98\xf7\xa1\x76\xe2\xb3\x24\x4d\x52\xdc\xb3\x21\xeb\xa9\x44\x6f\x4b\x12\x84\x9a\x30\xef\xb4\xa9\xe9\xbd\x33\xc5\x67\x12\xcf\xce\x62\x96\x9d\xe3\xcf\x28\x18\x1d\x5b\xa3\xbf\xae\x92\x14\x07\xd7\xa3\xd5\x07\x58\x17\xd0\x7b\x42\xa8\xd9\x63\xcb\x0d\x81\xf6\x86\xba\x00\xb6\x30\xae\xed\x1a\xd6\xd6\x10\x76\x1c\xea\xc1\xe6\xf8\x48\x96\xa4\x78\x3e\x3e\xe1\x36\x41\xb3\x85\x86\x71\xdd\x01\x6e\xfb\x51\x07\x1d\x06\xe0\xf8\xd5\x21\x74\x97\x4a\xed\x76\xbb\x4c\x0f\xb0\x99\x93\x4a\x35\x6f\x42\xaf\xee\xf3\xeb\xdb\x45\x71\x7b\x36\xcb\xce\x87\x5f\x1e\x6d\x43\xde\x43\xe8\x4b\xcf\x42\x25\x36\x07\xe8\xae\x6b\xd8\xe8\x4d\x43\x68\xf4\x0e\x4e\xa0\x2b\x21\x2a\x11\x5c\xe4\xdd\x09\x07\xb6\xd5\x14\xde\x6d\xc3\x4e\x0b\x25\x29\x4a\xf6\x41\x78\xd3\x87\x93\xb0\xde\xe9\xd8\x9f\x08\x9c\x85\xb6\x18\xcd\x0b\xe4\xc5\x08\xff\xcd\x8b\xbc\x98\x26\x29\x9e\xf2\xd5\xa7\xe5\xe3\x0a\x4f\xf3\x87\x87\xf9\x62\x95\xdf\x16\x58\x3e\xe0\x7a\xb9\xb8\xc9\x57\xf9\x72\x51\x60\xf9\x3f\xe6\x8b\x67\xdc\xe5\x8b\x9b\x29\x88\x43\x4d\x02\xda\x77\x12\xf9\x9d\x80\x63\x8c\x54\xc6\xcc\x0a\xa2\x13\x80\xad\x7b\x03\xf2\x1d\x19\xde\xb2\x41\xa3\x6d\xd5\xeb\x8a\x50\xb9\x57\x12\xcb\xb6\x42\x47\xd2\xb2\x8f\xcb\xf4\xd0\xb6\x4c\x52\x34\xdc\x72\xd0\x61\xa8\xfc\x36\x54\x16\x6f\x69\x15\xd7\xe9\x8d\x70\x17\x20\xd4\xba\x57\xf2\x30\xce\x7a\x32\x7d\xe0\x57\x02\xb5\x5d\x38\xa0\x61\x4b\x3e\x26\x67\x2b\xb6\xfb\xcc\x38\xbb\x8d\xc1\xfb\xe8\x1a\xaf\x8b\x3d\x5a\x27\x04\x1f\x27\x88\xe0\xda\xa2\x1f\xba\x1a\x95\x83\x50\x45\xfb\x64\x98\xaa\x8c\xc7\xd2\x6a\x5b\xfa\xcb\x24\xc5\x45\x76\x34\x1d\xb8\x84\x42\x2f\x16\x46\x8b\x30\x09\x4c\xad\x45\x9b\x40\xa2\x7c\x92\x62\xf6\x53\xfa\x01\x29\x49\xf1\x4f\xac\x77\x8d\x36\x84\xb6\x6f\x02\x47\xff\x8f\x8a\x88\x77\x46\x98\x78\xb5\x16\xa5\xaa\x09\xbe\xe1\x57\xe9\x05\xf8\x7b\xac\xd6\x93\xf1\x64\x6d\x4f\x7b\xea\x65\xac\xbe\x2e\xae\xd4\xcb\xda\x8e\xd5\xcd\xd5\xf7\x49\xf2\x23\x00\x00\xff\xff\x3b\xba\x15\x8d\x85\x03\x00\x00")
|
||
|
|
||
|
func ingressControllerCleanNginxConfShBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_ingressControllerCleanNginxConfSh,
|
||
|
"ingress-controller/clean-nginx-conf.sh",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func ingressControllerCleanNginxConfSh() (*asset, error) {
|
||
|
bytes, err := ingressControllerCleanNginxConfShBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "ingress-controller/clean-nginx-conf.sh", size: 901, mode: os.FileMode(493), modTime: time.Unix(1509931394, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
// Asset loads and returns the asset for the given name.
|
||
|
// It returns an error if the asset could not be found or
|
||
|
// could not be loaded.
|
||
|
func Asset(name string) ([]byte, error) {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
if f, ok := _bindata[cannonicalName]; ok {
|
||
|
a, err := f()
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||
|
}
|
||
|
return a.bytes, nil
|
||
|
}
|
||
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
}
|
||
|
|
||
|
// MustAsset is like Asset but panics when Asset would return an error.
|
||
|
// It simplifies safe initialization of global variables.
|
||
|
func MustAsset(name string) []byte {
|
||
|
a, err := Asset(name)
|
||
|
if err != nil {
|
||
|
panic("asset: Asset(" + name + "): " + err.Error())
|
||
|
}
|
||
|
|
||
|
return a
|
||
|
}
|
||
|
|
||
|
// AssetInfo loads and returns the asset info for the given name.
|
||
|
// It returns an error if the asset could not be found or
|
||
|
// could not be loaded.
|
||
|
func AssetInfo(name string) (os.FileInfo, error) {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
if f, ok := _bindata[cannonicalName]; ok {
|
||
|
a, err := f()
|
||
|
if err != nil {
|
||
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||
|
}
|
||
|
return a.info, nil
|
||
|
}
|
||
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||
|
}
|
||
|
|
||
|
// AssetNames returns the names of the assets.
|
||
|
func AssetNames() []string {
|
||
|
names := make([]string, 0, len(_bindata))
|
||
|
for name := range _bindata {
|
||
|
names = append(names, name)
|
||
|
}
|
||
|
return names
|
||
|
}
|
||
|
|
||
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
||
|
var _bindata = map[string]func() (*asset, error){
|
||
|
"etc/nginx/nginx.conf": etcNginxNginxConf,
|
||
|
"etc/nginx/template/nginx.tmpl": etcNginxTemplateNginxTmpl,
|
||
|
"ingress-controller/clean-nginx-conf.sh": ingressControllerCleanNginxConfSh,
|
||
|
}
|
||
|
|
||
|
// AssetDir returns the file names below a certain
|
||
|
// directory embedded in the file by go-bindata.
|
||
|
// For example if you run go-bindata on data/... and data contains the
|
||
|
// following hierarchy:
|
||
|
// data/
|
||
|
// foo.txt
|
||
|
// img/
|
||
|
// a.png
|
||
|
// b.png
|
||
|
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||
|
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||
|
// AssetDir("") will return []string{"data"}.
|
||
|
func AssetDir(name string) ([]string, error) {
|
||
|
node := _bintree
|
||
|
if len(name) != 0 {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
pathList := strings.Split(cannonicalName, "/")
|
||
|
for _, p := range pathList {
|
||
|
node = node.Children[p]
|
||
|
if node == nil {
|
||
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if node.Func != nil {
|
||
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
}
|
||
|
rv := make([]string, 0, len(node.Children))
|
||
|
for childName := range node.Children {
|
||
|
rv = append(rv, childName)
|
||
|
}
|
||
|
return rv, nil
|
||
|
}
|
||
|
|
||
|
type bintree struct {
|
||
|
Func func() (*asset, error)
|
||
|
Children map[string]*bintree
|
||
|
}
|
||
|
var _bintree = &bintree{nil, map[string]*bintree{
|
||
|
"etc": &bintree{nil, map[string]*bintree{
|
||
|
"nginx": &bintree{nil, map[string]*bintree{
|
||
|
"nginx.conf": &bintree{etcNginxNginxConf, map[string]*bintree{}},
|
||
|
"template": &bintree{nil, map[string]*bintree{
|
||
|
"nginx.tmpl": &bintree{etcNginxTemplateNginxTmpl, map[string]*bintree{}},
|
||
|
}},
|
||
|
}},
|
||
|
}},
|
||
|
"ingress-controller": &bintree{nil, map[string]*bintree{
|
||
|
"clean-nginx-conf.sh": &bintree{ingressControllerCleanNginxConfSh, map[string]*bintree{}},
|
||
|
}},
|
||
|
}}
|
||
|
|
||
|
// RestoreAsset restores an asset under the given directory
|
||
|
func RestoreAsset(dir, name string) error {
|
||
|
data, err := Asset(name)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
info, err := AssetInfo(name)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// RestoreAssets restores an asset under the given directory recursively
|
||
|
func RestoreAssets(dir, name string) error {
|
||
|
children, err := AssetDir(name)
|
||
|
// File
|
||
|
if err != nil {
|
||
|
return RestoreAsset(dir, name)
|
||
|
}
|
||
|
// Dir
|
||
|
for _, child := range children {
|
||
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func _filePath(dir, name string) string {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||
|
}
|
||
|
|