2017-11-22 13:40:54 +00:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
2018-02-02 19:53:28 +00:00
|
|
|
info := bindataFileInfo{name: "etc/nginx/nginx.conf", size: 119, mode: os.FileMode(420), modTime: time.Unix(1516916602, 0)}
|
2017-11-22 13:40:54 +00:00
|
|
|
a := &asset{bytes: bytes, info: info}
|
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
2018-02-02 19:53:28 +00:00
|
|
|
var _etcNginxTemplateNginxTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6b\x73\xdb\x38\x12\xe0\xf7\xfc\x0a\x94\xec\x2b\xdb\xa9\x48\x76\x66\xb2\xb3\xbb\x76\xf9\xea\x1c\x3b\x59\x7b\xd7\x49\x5c\x96\x33\xb3\xb5\x57\x57\x2a\x88\x6c\x89\x58\x53\x04\x07\x00\x65\x6b\x72\xba\xdf\x7e\x85\x27\x01\x12\xa4\x64\x4f\xe6\xb1\x53\xcb\x0f\x2e\x8b\x6c\x34\x1a\x8d\x46\x03\xfd\x00\xf0\xe5\x0b\xda\xc5\x79\x8e\x8e\x4f\xd1\x08\xad\xd7\x2f\xe4\x6f\x0e\x6c\x09\x8c\xab\x77\x63\xf3\xbf\xf9\x94\xcc\xe6\xea\xf5\xf9\x6c\x6e\x5f\x5d\xf1\xab\x9b\xef\xbf\x7b\x57\xe0\x69\x0e\xa9\xfa\x18\xbe\x31\x60\x19\xe0\x5c\x64\x3f\x7d\xbe\xbd\x52\x30\x97\xf5\x4f\x03\x30\xc5\xc9\x3d\x14\xa9\xae\xf6\xad\xfd\x61\x3e\x96\x8c\x3e\xae\x2e\x01\xa7\x96\xae\x1b\xf9\x62\x0c\xc2\xbe\x33\x70\x38\x4d\x7d\xa8\xb3\xfa\xe7\x7a\xfd\x42\x42\x90\x99\x6a\xc4\x48\x53\xf7\x81\xa6\x1c\x92\x8a\x11\xb1\x92\x00\x39\xc5\xe9\x64\x41\xd3\x2a\x07\x74\x08\x22\x39\x2c\xe6\xa4\x78\x3c\xd4\x6f\xf8\x61\x31\x7f\x9c\x64\x42\x94\x12\xc4\x16\x33\xe0\x23\x4e\x4f\x24\x7a\x28\xd2\x78\x4d\x9f\x4a\x28\x04\xc3\x09\x29\xe6\x4f\xa9\x89\xd6\xc5\x7a\x6b\xda\xc7\x45\xda\x55\xdd\x7e\x01\xfa\xd3\xbf\x48\x79\x4f\x8a\x73\x9a\xe7\x90\x08\xca\x2e\x29\x17\x68\x30\x38\x38\x78\x0a\x41\x3f\x29\x1c\x3f\x9f\x96\xbf\x63\x98\x03\xfb\x79\xb4\xfc\x5b\xe1\xe8\xa0\x25\xc5\xb0\xa0\x05\xa2\xb3\xd9\xc9\x8b\x17\x0f\x94\xdd\x03\x9b\x94\x8c\x26\xc0\x39\x70\x64\x64\x79\xf4\x83\xfa\x70\xe3\xde\xaf\xd7\x27\x2f\x4a\x92\xa2\x43\x56\x15\xba\xda\x51\x49\xd2\x13\xd3\xb2\x02\xd0\xe8\x03\x7e\x94\x0d\x7a\x4f\x72\xe0\xe8\x48\x56\x65\x90\xb3\x9c\x2c\x88\x98\x14\x74\x46\x72\x90\x15\x84\xa0\x12\xb3\x26\x4f\x73\xea\xf0\x25\x92\x8d\x38\x3e\x34\xd5\x50\x36\x3f\x84\xe2\x30\xa5\x89\x6e\x61\x42\x19\xd8\xa6\x65\x62\x91\xef\x98\x6a\x78\x56\x89\x94\x3e\x14\x13\x41\x16\x40\x2b\x81\x5e\x1e\x2a\xd9\x3f\x7c\x89\xf0\x92\x92\x14\x3d\x60\x22\x24\xab\x05\xa5\x28\xa7\xc5\x1c\xa5\x15\x93\xbf\x31\x62\x20\x39\xab\x0b\x74\x61\x0b\x19\x33\x36\x9f\xef\xcc\xd7\xf5\x1a\x9d\xbc\x78\x01\x4b\x28\x04\x47\x5f\x5e\x20\x84\xd0\xa2\xca\x05\x99\xe0\x24\x81\x52\x20\xf3\xd0\xe2\x44\x7d\x33\x95\x24\xb4\x28\x20\x11\x84\x16\x1c\xb9\x0a\x3e\xe0\x47\x5d\xc7\xb9\xf7\x55\x32\x49\x16\xac\x38\xa0\xe6\x03\x25\xcd\xf3\x93\x17\xeb\x17\x2f\x24\xdf\x4c\xed\xaa\xdd\x0f\xa0\x0a\x88\x0c\xd0\x12\xe7\x15\x20\x3a\x53\x3f\x32\x35\xf4\xd1\x3f\x87\xef\x29\x7b\xc0\x2c\x85\x54\xfe\x87\x04\x45\x53\x40\x52\x32\xe5\xbf\xb6\xe4\x1c\xe8\x84\x94\xc8\x88\x9d\xe2\x91\xae\xc0\x0d\xe4\xcf\x1c\x94\xd6\xb9\x61\x54\xd0\x84\xe6\xc8\x80\x30\xc0\xf9\x84\x94\x13\x53\x9d\x7a\x94\xbe\x92\xf2\xa6\x20\x4f\x2c\x2a\xc8\x39\xf4\x15\xb3\xcc\x71\x04\xbf\xa7\x4c\x2b\x30\xc7\x1a\x4f\xc4\x7d\x2c\x4c\xea\x23\x4e\x96\xe0\xb1\xff\xcb\x17\xc4\x70\x31\x07\xb4\x2b\x58\xc5\x05\xa4\xb2\x81\xc7\xa7\xba\x0a\xd5\x94\x5b\xc0\xf9\xd5\xcd\xf9\xd5\xc5\xad\xa5\x8a\x83\x98\x58\x9c\x33\x46\x17\x96\x2a\x0f\x43\x07\x25\xaa\x2b\x52\x2c\xf0\x14\xcb\x91\x54\x71\x48\x25\x7f\x53\x10\xc0\x16\xa4\xd0\x5c\x4e\x68\x55\x08\xb6\x42\x29\x94\x50\xa4\x52\x2c\x69\xa1\x3f\xe4\x04\x0a\x81\xae\x6e\x10\x4e\x53\x06\x9c\xfb\x5d\xd0\x37\x56\xe4\x87\x5a\x25\xcc\x81\x92\xd2\x1f\x36\x0d\x34\x22\x23\x1c\x11\x8e\x18\xfc\x58\x11\xa6\x04\x20\xc1\x79\x52\xe5\x58\x00\x12\x0c\xcf\x66\x24\x41\x33\xca\x10\x29\x52\xb2\x24\x69\x85\x73\x47\x73\xc5\x25\xbd\x7f\x03\x7a\x75\x83\x88\xa6\x9a\x0b\x2c\x2a\x8e\x4a\x3c\xf7\x44\x46\xd3\x60\x4b\xe9\xc7\x53\x63\x0a\xc1\x28\xc5\xe2\xc4\x87\x96\x33\x90\x7b\x42\xe8\x6b\x22\xe0\x9c\x88\x55\xb3\x8c\x96\xb1\xba\xe3\x65\xb7\x37\x65\x56\x6b\xe0\xef\x05\x1f\x6b\x4a\x0d\x89\xcb\x8c\x72\x31\x31\xed\x9d\xe8\x56\x4c\x7e\xa2\x05\x20\x9e\x61\x06\xe9\x71\x0c\xe0\xd8\x4a\xa7\x43\xf7\x2f\x5a\xc0\x98\xfc\x04\x4e\x24\xa2\x78\x67\x24\x17\xc0\x26\xd3\xd5\x44\x0a\xd7\x3d\xac\x90\x87\xe8\x02\x66\xb8\xca\xc5\x7b\x05\xf3\x0f\x58\x75\x49\x17\x26\xb4\xa5\x11\x44\xc6\x00\xa7\xfc\xc4\x02\x4c\x1e\x18\x11\xbe\xe2\x70\x1c\x11\x49\x39\x29\x68\x59\xf1\x2c\xfc\x58\x7f\x4b\x21\xc7\xab\x76\xc1\x9c\xce\x27\xbc\x9a\x4a\x71\x01\x2e\x1a\x1f\x19\xc8\x06\x49\xcd\x99\xd2\x4a\x78\x6a\xae\x06\xb9\x07\x28\x71\x4e\x96\xe0\x14\xac\x6b\xfc\x3f\x00\xca\x33\xf9\x09\xad\xd7\xa6\x0d\x35\xb4\xa9\x
|
2017-11-22 13:40:54 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2018-02-02 19:53:28 +00:00
|
|
|
info := bindataFileInfo{name: "etc/nginx/template/nginx.tmpl", size: 40070, mode: os.FileMode(420), modTime: time.Unix(1517597409, 0)}
|
2017-11-22 13:40:54 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2018-02-02 19:53:28 +00:00
|
|
|
info := bindataFileInfo{name: "ingress-controller/clean-nginx-conf.sh", size: 901, mode: os.FileMode(493), modTime: time.Unix(1516916602, 0)}
|
2017-11-22 13:40:54 +00:00
|
|
|
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, "/")...)...)
|
|
|
|
}
|
|
|
|
|