1// Copyright 2019 The Kubernetes Authors. 2// SPDX-License-Identifier: Apache-2.0 3 4// Code generated for package kustomizationapi by go-bindata DO NOT EDIT. (@generated) 5// sources: 6// kustomizationapi/swagger.json 7package kustomizationapi 8 9import ( 10 "bytes" 11 "compress/gzip" 12 "fmt" 13 "io" 14 "io/ioutil" 15 "os" 16 "path/filepath" 17 "strings" 18 "time" 19) 20 21func bindataRead(data []byte, name string) ([]byte, error) { 22 gz, err := gzip.NewReader(bytes.NewBuffer(data)) 23 if err != nil { 24 return nil, fmt.Errorf("Read %q: %v", name, err) 25 } 26 27 var buf bytes.Buffer 28 _, err = io.Copy(&buf, gz) 29 clErr := gz.Close() 30 31 if err != nil { 32 return nil, fmt.Errorf("Read %q: %v", name, err) 33 } 34 if clErr != nil { 35 return nil, err 36 } 37 38 return buf.Bytes(), nil 39} 40 41type asset struct { 42 bytes []byte 43 info os.FileInfo 44} 45 46type bindataFileInfo struct { 47 name string 48 size int64 49 mode os.FileMode 50 modTime time.Time 51} 52 53// Name return file name 54func (fi bindataFileInfo) Name() string { 55 return fi.name 56} 57 58// Size return file size 59func (fi bindataFileInfo) Size() int64 { 60 return fi.size 61} 62 63// Mode return file mode 64func (fi bindataFileInfo) Mode() os.FileMode { 65 return fi.mode 66} 67 68// Mode return file modify time 69func (fi bindataFileInfo) ModTime() time.Time { 70 return fi.modTime 71} 72 73// IsDir return file whether a directory 74func (fi bindataFileInfo) IsDir() bool { 75 return fi.mode&os.ModeDir != 0 76} 77 78// Sys return file is sys mode 79func (fi bindataFileInfo) Sys() interface{} { 80 return nil 81} 82 83var _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") 84 85func kustomizationapiSwaggerJsonBytes() ([]byte, error) { 86 return bindataRead( 87 _kustomizationapiSwaggerJson, 88 "kustomizationapi/swagger.json", 89 ) 90} 91 92func kustomizationapiSwaggerJson() (*asset, error) { 93 bytes, err := kustomizationapiSwaggerJsonBytes() 94 if err != nil { 95 return nil, err 96 } 97 98 info := bindataFileInfo{name: "kustomizationapi/swagger.json", size: 3182, mode: os.FileMode(420), modTime: time.Unix(1615228558, 0)} 99 a := &asset{bytes: bytes, info: info} 100 return a, nil 101} 102 103// Asset loads and returns the asset for the given name. 104// It returns an error if the asset could not be found or 105// could not be loaded. 106func Asset(name string) ([]byte, error) { 107 cannonicalName := strings.Replace(name, "\\", "/", -1) 108 if f, ok := _bindata[cannonicalName]; ok { 109 a, err := f() 110 if err != nil { 111 return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) 112 } 113 return a.bytes, nil 114 } 115 return nil, fmt.Errorf("Asset %s not found", name) 116} 117 118// MustAsset is like Asset but panics when Asset would return an error. 119// It simplifies safe initialization of global variables. 120func MustAsset(name string) []byte { 121 a, err := Asset(name) 122 if err != nil { 123 panic("asset: Asset(" + name + "): " + err.Error()) 124 } 125 126 return a 127} 128 129// AssetInfo loads and returns the asset info for the given name. 130// It returns an error if the asset could not be found or 131// could not be loaded. 132func AssetInfo(name string) (os.FileInfo, error) { 133 cannonicalName := strings.Replace(name, "\\", "/", -1) 134 if f, ok := _bindata[cannonicalName]; ok { 135 a, err := f() 136 if err != nil { 137 return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) 138 } 139 return a.info, nil 140 } 141 return nil, fmt.Errorf("AssetInfo %s not found", name) 142} 143 144// AssetNames returns the names of the assets. 145func AssetNames() []string { 146 names := make([]string, 0, len(_bindata)) 147 for name := range _bindata { 148 names = append(names, name) 149 } 150 return names 151} 152 153// _bindata is a table, holding each asset generator, mapped to its name. 154var _bindata = map[string]func() (*asset, error){ 155 "kustomizationapi/swagger.json": kustomizationapiSwaggerJson, 156} 157 158// AssetDir returns the file names below a certain 159// directory embedded in the file by go-bindata. 160// For example if you run go-bindata on data/... and data contains the 161// following hierarchy: 162// data/ 163// foo.txt 164// img/ 165// a.png 166// b.png 167// then AssetDir("data") would return []string{"foo.txt", "img"} 168// AssetDir("data/img") would return []string{"a.png", "b.png"} 169// AssetDir("foo.txt") and AssetDir("notexist") would return an error 170// AssetDir("") will return []string{"data"}. 171func AssetDir(name string) ([]string, error) { 172 node := _bintree 173 if len(name) != 0 { 174 cannonicalName := strings.Replace(name, "\\", "/", -1) 175 pathList := strings.Split(cannonicalName, "/") 176 for _, p := range pathList { 177 node = node.Children[p] 178 if node == nil { 179 return nil, fmt.Errorf("Asset %s not found", name) 180 } 181 } 182 } 183 if node.Func != nil { 184 return nil, fmt.Errorf("Asset %s not found", name) 185 } 186 rv := make([]string, 0, len(node.Children)) 187 for childName := range node.Children { 188 rv = append(rv, childName) 189 } 190 return rv, nil 191} 192 193type bintree struct { 194 Func func() (*asset, error) 195 Children map[string]*bintree 196} 197 198var _bintree = &bintree{nil, map[string]*bintree{ 199 "kustomizationapi": &bintree{nil, map[string]*bintree{ 200 "swagger.json": &bintree{kustomizationapiSwaggerJson, map[string]*bintree{}}, 201 }}, 202}} 203 204// RestoreAsset restores an asset under the given directory 205func RestoreAsset(dir, name string) error { 206 data, err := Asset(name) 207 if err != nil { 208 return err 209 } 210 info, err := AssetInfo(name) 211 if err != nil { 212 return err 213 } 214 err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) 215 if err != nil { 216 return err 217 } 218 err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) 219 if err != nil { 220 return err 221 } 222 err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 223 if err != nil { 224 return err 225 } 226 return nil 227} 228 229// RestoreAssets restores an asset under the given directory recursively 230func RestoreAssets(dir, name string) error { 231 children, err := AssetDir(name) 232 // File 233 if err != nil { 234 return RestoreAsset(dir, name) 235 } 236 // Dir 237 for _, child := range children { 238 err = RestoreAssets(dir, filepath.Join(name, child)) 239 if err != nil { 240 return err 241 } 242 } 243 return nil 244} 245 246func _filePath(dir, name string) string { 247 cannonicalName := strings.Replace(name, "\\", "/", -1) 248 return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) 249} 250