| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
package kustomizationapi |
| 8 |
|
| 9 |
import ( |
| 10 |
"bytes" |
| 11 |
"compress/gzip" |
| 12 |
"fmt" |
| 13 |
"io" |
| 14 |
"os" |
| 15 |
"path/filepath" |
| 16 |
"strings" |
| 17 |
"time" |
| 18 |
) |
| 19 |
|
| 20 |
func bindataRead(data []byte, name string) ([]byte, error) { |
| 21 |
gz, err := gzip.NewReader(bytes.NewBuffer(data)) |
| 22 |
if err != nil { |
| 23 |
return nil, fmt.Errorf("Read %q: %v", name, err) |
| 24 |
} |
| 25 |
|
| 26 |
var buf bytes.Buffer |
| 27 |
_, err = io.Copy(&buf, gz) |
| 28 |
clErr := gz.Close() |
| 29 |
|
| 30 |
if err != nil { |
| 31 |
return nil, fmt.Errorf("Read %q: %v", name, err) |
| 32 |
} |
| 33 |
if clErr != nil { |
| 34 |
return nil, err |
| 35 |
} |
| 36 |
|
| 37 |
return buf.Bytes(), nil |
| 38 |
} |
| 39 |
|
| 40 |
type asset struct { |
| 41 |
bytes []byte |
| 42 |
info os.FileInfo |
| 43 |
} |
| 44 |
|
| 45 |
type bindataFileInfo struct { |
| 46 |
name string |
| 47 |
size int64 |
| 48 |
mode os.FileMode |
| 49 |
modTime time.Time |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
func (fi bindataFileInfo) Name() string { |
| 54 |
return fi.name |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
func (fi bindataFileInfo) Size() int64 { |
| 59 |
return fi.size |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
func (fi bindataFileInfo) Mode() os.FileMode { |
| 64 |
return fi.mode |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
func (fi bindataFileInfo) ModTime() time.Time { |
| 69 |
return fi.modTime |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
func (fi bindataFileInfo) IsDir() bool { |
| 74 |
return fi.mode&os.ModeDir != 0 |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
func (fi bindataFileInfo) Sys() interface{} { |
| 79 |
return nil |
| 80 |
} |
| 81 |
|
| 82 |
var _kustomizationapiSwaggerJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x56\xc1\x6e\xdb\x30\x0c\xbd\xe7\x2b\x04\x6d\xc7\xd8\x45\x6e\x43\x6e\xc3\x0e\x3b\x14\x05\x0a\x74\xb7\xa1\x07\xc6\xa1\x5d\xce\x8e\xa4\x51\xb4\xb1\x6c\xc8\xbf\x0f\xd6\x62\xd7\x4a\xec\x75\x0b\x1a\xac\x4b\x0f\x06\x0c\x99\x7c\x4f\xe4\x7b\x24\xfc\x63\xa6\x94\x5e\x63\x4e\x86\x84\xac\xf1\x7a\xa9\xda\x23\xa5\x34\xd9\xb4\x7c\xe7\x53\x70\x94\x82\x73\x3e\x6d\x16\xe9\x07\x6b\x72\x2a\x6e\xc0\xbd\xe7\xe2\x31\x52\x29\xed\xd8\x3a\x64\x21\x1c\x9e\x2a\xa5\x3f\xa2\x41\x06\xb1\x7c\x90\x10\x3e\xbe\x65\xcc\xf5\x52\xe9\x37\x57\x03\xfe\xab\x11\xda\x18\xa5\x87\xd8\xed\xdf\x76\xf3\xee\x1a\xb0\x5e\x07\x14\xa8\x6e\x87\x17\xca\xa1\xf2\xd8\x07\xc9\xd6\x61\x4b\x6b\x57\x5f\x30\x13\xdd\x9f\x7f\x4b\xca\x7a\x85\x6c\x50\xd0\x27\x05\xdb\xda\x25\x0d\xb2\x27\x6b\x92\x92\xcc\x5a\x2f\xd5\xe7\x9e\x3a\xaa\x23\xc4\xb6\x88\x65\xed\xc5\x6e\xe8\x3b\xa6\x59\x68\x54\x28\x84\x6c\x4f\x11\xa2\xf7\x58\x3a\xee\x65\x14\xb2\xa7\x6d\xa3\x9a\xc5\x0a\x05\x16\xc7\x45\xdf\xcf\x06\xa5\x8f\x69\x75\x87\x19\xa3\xbc\x0c\xa1\x1e\xab\xeb\xba\x1f\xe1\x77\x8a\x78\x61\x32\xc5\xa5\x08\x3c\x10\xe0\xf9\xd5\x9d\xd2\x6b\x52\x60\x03\x1b\xf4\x0e\xb2\x3f\x6f\xfe\x3c\x4e\x3e\x25\x6f\x85\x0f\xd0\x90\xe5\x53\x72\xaf\x9b\x5b\x20\xbe\xb3\x35\x67\x78\xba\x23\x63\x94\x0b\x71\x56\x2c\xfe\xf3\x9b\xeb\x7a\x7f\x19\x90\x5f\x50\xbd\xb9\x18\xbf\xd6\xc4\x18\x17\xa4\x3f\x6d\x1d\xde\xa0\x40\xc7\x74\x3f\x7f\xca\x8c\x59\xb7\xfb\xfa\x4a\x0e\x05\x26\xc1\xcd\xa1\xea\x7f\xa3\x7b\xbc\x5d\x07\x20\xbb\xf9\x98\x11\x81\x19\xb6\x71\x27\x23\x4d\x1d\x48\xf6\x90\x6c\x90\x0b\x4c\x4a\xdc\xb6\x29\x61\x26\x9e\xca\xf0\xc2\x20\x58\x84\x84\x90\x3d\xee\x75\x1f\x56\xc5\xd9\x9a\x31\xd8\x44\x2f\xb2\x13\xff\xf5\x30\xc6\xc3\x72\x86\x61\x9c\xd8\x83\x93\xc3\x55\x91\x20\x43\x75\xb4\x33\x27\x5c\x34\xb5\x8b\x7f\x6f\x90\x51\x1b\xe7\x54\x1d\xaf\xea\xf3\xd3\xa2\x69\xfe\x0d\xeb\xeb\xf8\x8f\x89\x0d\x78\xaa\xc1\x67\xed\xb3\xfb\x19\x00\x00\xff\xff\x2f\x39\x79\xd0\x6e\x0c\x00\x00") |
| 83 |
|
| 84 |
func kustomizationapiSwaggerJsonBytes() ([]byte, error) { |
| 85 |
return bindataRead( |
| 86 |
_kustomizationapiSwaggerJson, |
| 87 |
"kustomizationapi/swagger.json", |
| 88 |
) |
| 89 |
} |
| 90 |
|
| 91 |
func kustomizationapiSwaggerJson() (*asset, error) { |
| 92 |
bytes, err := kustomizationapiSwaggerJsonBytes() |
| 93 |
if err != nil { |
| 94 |
return nil, err |
| 95 |
} |
| 96 |
|
| 97 |
info := bindataFileInfo{name: "kustomizationapi/swagger.json", size: 3182, mode: os.FileMode(420), modTime: time.Unix(1615228558, 0)} |
| 98 |
a := &asset{bytes: bytes, info: info} |
| 99 |
return a, nil |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
func Asset(name string) ([]byte, error) { |
| 106 |
cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 107 |
if f, ok := _bindata[cannonicalName]; ok { |
| 108 |
a, err := f() |
| 109 |
if err != nil { |
| 110 |
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) |
| 111 |
} |
| 112 |
return a.bytes, nil |
| 113 |
} |
| 114 |
return nil, fmt.Errorf("Asset %s not found", name) |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
func MustAsset(name string) []byte { |
| 120 |
a, err := Asset(name) |
| 121 |
if err != nil { |
| 122 |
panic("asset: Asset(" + name + "): " + err.Error()) |
| 123 |
} |
| 124 |
|
| 125 |
return a |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
func AssetInfo(name string) (os.FileInfo, error) { |
| 132 |
cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 133 |
if f, ok := _bindata[cannonicalName]; ok { |
| 134 |
a, err := f() |
| 135 |
if err != nil { |
| 136 |
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) |
| 137 |
} |
| 138 |
return a.info, nil |
| 139 |
} |
| 140 |
return nil, fmt.Errorf("AssetInfo %s not found", name) |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
func AssetNames() []string { |
| 145 |
names := make([]string, 0, len(_bindata)) |
| 146 |
for name := range _bindata { |
| 147 |
names = append(names, name) |
| 148 |
} |
| 149 |
return names |
| 150 |
} |
| 151 |
|
| 152 |
|
| 153 |
var _bindata = map[string]func() (*asset, error){ |
| 154 |
"kustomizationapi/swagger.json": kustomizationapiSwaggerJson, |
| 155 |
} |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
func AssetDir(name string) ([]string, error) { |
| 171 |
node := _bintree |
| 172 |
if len(name) != 0 { |
| 173 |
cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 174 |
pathList := strings.Split(cannonicalName, "/") |
| 175 |
for _, p := range pathList { |
| 176 |
node = node.Children[p] |
| 177 |
if node == nil { |
| 178 |
return nil, fmt.Errorf("Asset %s not found", name) |
| 179 |
} |
| 180 |
} |
| 181 |
} |
| 182 |
if node.Func != nil { |
| 183 |
return nil, fmt.Errorf("Asset %s not found", name) |
| 184 |
} |
| 185 |
rv := make([]string, 0, len(node.Children)) |
| 186 |
for childName := range node.Children { |
| 187 |
rv = append(rv, childName) |
| 188 |
} |
| 189 |
return rv, nil |
| 190 |
} |
| 191 |
|
| 192 |
type bintree struct { |
| 193 |
Func func() (*asset, error) |
| 194 |
Children map[string]*bintree |
| 195 |
} |
| 196 |
|
| 197 |
var _bintree = &bintree{nil, map[string]*bintree{ |
| 198 |
"kustomizationapi": &bintree{nil, map[string]*bintree{ |
| 199 |
"swagger.json": &bintree{kustomizationapiSwaggerJson, map[string]*bintree{}}, |
| 200 |
}}, |
| 201 |
}} |
| 202 |
|
| 203 |
|
| 204 |
func RestoreAsset(dir, name string) error { |
| 205 |
data, err := Asset(name) |
| 206 |
if err != nil { |
| 207 |
return err |
| 208 |
} |
| 209 |
info, err := AssetInfo(name) |
| 210 |
if err != nil { |
| 211 |
return err |
| 212 |
} |
| 213 |
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) |
| 214 |
if err != nil { |
| 215 |
return err |
| 216 |
} |
| 217 |
err = os.WriteFile(_filePath(dir, name), data, info.Mode()) |
| 218 |
if err != nil { |
| 219 |
return err |
| 220 |
} |
| 221 |
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) |
| 222 |
if err != nil { |
| 223 |
return err |
| 224 |
} |
| 225 |
return nil |
| 226 |
} |
| 227 |
|
| 228 |
|
| 229 |
func RestoreAssets(dir, name string) error { |
| 230 |
children, err := AssetDir(name) |
| 231 |
|
| 232 |
if err != nil { |
| 233 |
return RestoreAsset(dir, name) |
| 234 |
} |
| 235 |
|
| 236 |
for _, child := range children { |
| 237 |
err = RestoreAssets(dir, filepath.Join(name, child)) |
| 238 |
if err != nil { |
| 239 |
return err |
| 240 |
} |
| 241 |
} |
| 242 |
return nil |
| 243 |
} |
| 244 |
|
| 245 |
func _filePath(dir, name string) string { |
| 246 |
cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 247 |
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) |
| 248 |
} |