mirror of https://github.com/k3s-io/k3s
252 lines
1005 KiB
Go
252 lines
1005 KiB
Go
|
// Copyright 2021 The Kubernetes Authors.
|
||
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
|
||
|
// Code generated for package v1204 by go-bindata DO NOT EDIT. (@generated)
|
||
|
// sources:
|
||
|
// kubernetesapi/v1204/swagger.json
|
||
|
package v1204
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// Name return file name
|
||
|
func (fi bindataFileInfo) Name() string {
|
||
|
return fi.name
|
||
|
}
|
||
|
|
||
|
// Size return file size
|
||
|
func (fi bindataFileInfo) Size() int64 {
|
||
|
return fi.size
|
||
|
}
|
||
|
|
||
|
// Mode return file mode
|
||
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
||
|
return fi.mode
|
||
|
}
|
||
|
|
||
|
// Mode return file modify time
|
||
|
func (fi bindataFileInfo) ModTime() time.Time {
|
||
|
return fi.modTime
|
||
|
}
|
||
|
|
||
|
// IsDir return file whether a directory
|
||
|
func (fi bindataFileInfo) IsDir() bool {
|
||
|
return fi.mode&os.ModeDir != 0
|
||
|
}
|
||
|
|
||
|
// Sys return file is sys mode
|
||
|
func (fi bindataFileInfo) Sys() interface{} {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var _kubernetesapiV1204SwaggerJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\xff\x73\xdb\xb8\xd5\x37\xfa\xfb\xfb\x57\x60\xbc\xb7\x93\x64\x47\x96\x93\xdd\xb6\x4f\xdf\x74\x3a\xf7\xba\x49\xb6\x75\x9b\xcd\xfa\xb5\x9d\x76\xde\xfb\xb8\xf3\x06\x22\x21\x09\x8f\x49\x80\x0b\x80\x76\xd4\x3b\xcf\xff\x7e\x07\xe7\x00\x20\x48\x51\x22\x25\x4b\xb6\xec\xb0\x3f\x74\x63\x0a\x04\xf1\xf5\x7c\xfd\x9c\x73\xfe\xbf\xff\x41\xc8\x51\xca\xa6\x5c\x70\xc3\xa5\xd0\x47\x6f\x89\x7d\x44\xc8\x11\x97\xe3\x9b\x3f\xe8\x31\x2d\xf8\x98\xa6\x39\xd7\x9a\x4b\xa1\xd8\x8c\x6b\xa3\xa8\x6d\x3a\xbe\x7d\x33\xfe\xb9\x34\xd4\x70\x31\xfb\x27\x9b\xcc\xa5\xbc\x09\x2f\x43\x9f\x3a\x51\xbc\xb0\x2d\x8f\xde\x92\xa3\x46\x4b\x82\x3f\x4f\x98\x26\x54\x90\xd0\x3f\xb9\x73\x3f\x53\x91\x12\x33\x67\x44\x31\x2d\x4b\x95\x40\xb3\x94\xc8\x82\xe1\xb7\x35\xe1\x86\xd0\xa2\xc8\x38\xd3\xc4\xc8\xf1\xd1\xc8\x7f\xb6\x50\xb6\x91\xe1\x4c\x47\x83\x21\xe4\x28\x7c\xe2\x82\xdd\x72\x76\xf7\x0f\xa6\x74\x6d\xba\xed\xa3\x3e\x6d\x7f\x8b\x70\x18\xb6\x54\x29\x53\x2c\x25\x19\xd7\x86\xc8\x29\x29\x14\x9b\x32\x65\x9f\x7c\x69\xbc\xf8\x85\xdc\xfa\x57\xed\xac\xfc\x22\xb0\xaf\x05\x4b\x8c\x1e\x93\xd3\xf3\x33\xa2\x99\xba\x65\x8a\xdc\xf1\x2c\x23\x46\x2d\x88\x91\xa4\xd4\x8c\x4c\xb9\xd2\xc6\xbf\x4e\xb8\x80\x0e\xe0\x8b\x77\x73\x9e\xcc\xed\x42\xe8\xb2\x28\xa4\xb2\xfd\x9c\x4d\x89\x90\x82\xd9\xc1\xd8\x66\xe1\xa3\xba\x60\x09\x9f\x72\x96\x62\x07\x5c\x63\x0f\xee\x45\x96\x92\xc9\x22\x1a\xc3\x88\xdc\xd2\x8c\xa7\xb0\xd2\x38\x9e\x29\xe5\x19\x99\x4a\x85\xef\xca\xc9\x7f\xb1\xc4\xc0\xd7\x28\x29\xec\x37\xb4\xed\xc3\xef\x5d\x22\xc5\x94\xcf\x4a\xdc\xa9\xf0\x69\x4d\x68\x96\xc9\x3b\x96\x56\xa3\xb2\x5b\x9a\x4a\xa6\x89\x90\x86\x70\x91\x64\x65\xca\x08\x15\x8b\xaa\xc5\x8d\x90\x77\xc2\xae\x84\x9d\x8d\x1d\xe0\xa5\x1b\x60\x42\xb3\x4c\xfb\x1f\xfc\x87\xab\xa1\xda\x9e\x27\x8c\xe8\x12\x46\xea\xdb\xd9\x9f\x4a\xc5\x48\x21\x33\x9e\x2c\xaa\x43\x83\xc7\xdd\xb0\xbc\x79\x1c\x08\x39\x32\x8b\x82\xd9\x93\xa0\x8d\xe2\x62\x76\x14\xfd\xf8\xdf\xb5\xd7\x7d\x3b\xaa\x14\x5d\x54\xcd\xa2\x46\x47\x49\xc6\x99\x30\xef\x60\x75\x9a\xe7\xee\xff\x52\x6c\x6a\x5f\xff\xee\x24\xba\x8b\x27\x7d\xae\xa0\x3b\x4b\xef\xe2\xce\x47\x6b\x8e\x74\xdc\x90\xc0\xc7\x98\x26\x73\x79\x67\x17\x29\x91\x79\x5e\x0a\x9e\x50\xc3\xc8\x1d\x37\x73\x58\x35\xdb\xfb\x98\x5c\xb0\x5f\x4b\xae\x58\xda\x3e\x35\xb7\xb2\xe7\xb0\xb0\x1d\x77\xea\xa7\xb8\x6d\x6d\x04\xa5\x50\x2c\x91\x33\xc1\xff\xcd\x52\xc2\x94\x92\x4a\x93\xa9\x92\x39\x0c\xa3\xa2\x11\x4c\xa4\x85\xe4\xc2\x10\xaa\x18\x99\x53\x91\x66\x2c\x25\xc7\xd5\xf1\xa2\x59\x69\x4f\x9b\x62\xe4\x6c\x26\xa4\x62\x44\x2a\x62\x3f\x3a\x26\xef\xd9\x94\x96\x99\x81\x83\x03\x4f\x8e\x5a\xf7\xb0\xb9\xd7\xf1\x4c\x73\x6a\x92\x79\xaf\x79\x46\x2d\xeb\xeb\x3c\x67\xe4\xfa\x48\x95\x19\xd3\xd7\x47\x78\x0f\xb9\xb6\x57\x3d\xb5\xc3\x82\xb7\xec\x65\x90\x39\x17\x33\xa2\xd8\xaf\x25\xd3\x40\x22\x96\xa7\x77\x7d\xf4\xe1\x2b\x4d\xcc\xf5\x91\x9d\xe1\xf5\xd1\x87\x5f\x4b\x7e\x4b\x33\x26\xcc\xf5\xd1\xf8\x5a\x5c\x8b\x63\x02\xbf\xbf\x75\x9d\x52\xdf\x1b\x91\x22\x5b\x10\x3e\xb5\xb4\x83\xd9\x16\xd9\x02\x9b\xd8\x7e\x23\x5a\x61\xc7\x38\x26\x3f\x49\x65\x5b\xe5\x45\xc6\x46\xf6\xa5\x94\x15\x99\x5c\xe4\x4c\x18\x4d\x12\x2a\xec\x3d\xcb\x65\x8a\x6f\xdc\x72\x6a\xc9\xb2\x3e\xb9\x7d\x33\xf2\xff\x98\x30\x43\xed\x5f\x22\x25\xec\xab\x61\x02\x6e\x76\xf5\x7c\x52\x9a\x68\x39\x70\x64\x48\x0a\x52\xf2\x85\x16\xfc\x2f\x4a\x96\x85\x7e\xfb\x9f\xd7\x47\xb6\xbf\xeb\xa3\x7f\xd9\x8e\xb9\xa7\xc4\xf6\xf9\xed\x1b\x78\x1a\x58\xc5\x5b\xf2\x9f\xd7\x47\xd1\x28\xaf\x8f\xfe\xf5\x65\x14\xcd\xde\xc8\xda\xd0\x08\xcc\xaf\x39\x30\x72\x27\xcb\x2c\x05\xca\x64\x09\x09\x13\xa6\x41\x6d\xfc\x0a\x87\x45\x5f\x5e\x66\x3e\xf5\x2b\xa3\xe1\x29\x8e\x0f\xb6\x1c\x29\x31\xcc\x7a\x44\xd8\x2d\x13\xb8\x74\x42\x9a\x39\x53\x40\xe9\x66\x76\xde\x76\x6c\x8e\x18\xee\x7d\x23\xec\xf3\xc3\xdd\x88\x09\xb3\x7c\xe5\x96\x01\xb7\xaa\x5e\x84\x51\xaf\xda\x9d\xf8\xba\xd7\xaf\xc7\xe6\xf7\x5e\xd0\x9c\x75\x5c\xf8\xab\x39\x23\xb6\x99\xe7\xbe\x4b\x52\xcd\x98\x7c\xb2\x3f\xeb\xb9\x9f\xd1\xb4\xcc\xb2\x05\xf9\xb5\xa4\x19\xec\xda\x88\xb0\xf1\x6c\x3c\x22\x3c\xa7\x33\xe6\x98\xd4\x4d\x39\x61\x4a\x30\xc3\xf4\x98\xcb\x11\xb9\x9b\x33\xb8\xf8\x51\x93\xeb\x23\x4b\x3f\x4c\xe3\xe3\xee\x93\x
|
||
|
|
||
|
func kubernetesapiV1204SwaggerJsonBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_kubernetesapiV1204SwaggerJson,
|
||
|
"kubernetesapi/v1204/swagger.json",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func kubernetesapiV1204SwaggerJson() (*asset, error) {
|
||
|
bytes, err := kubernetesapiV1204SwaggerJsonBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "kubernetesapi/v1204/swagger.json", size: 4853484, mode: os.FileMode(420), modTime: time.Unix(1614718756, 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){
|
||
|
"kubernetesapi/v1204/swagger.json": kubernetesapiV1204SwaggerJson,
|
||
|
}
|
||
|
|
||
|
// 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{
|
||
|
"kubernetesapi": &bintree{nil, map[string]*bintree{
|
||
|
"v1204": &bintree{nil, map[string]*bintree{
|
||
|
"swagger.json": &bintree{kubernetesapiV1204SwaggerJson, 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, "/")...)...)
|
||
|
}
|