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