From 3d3dd08e6b303bef9d6245509f2afd4d9ae6b23c Mon Sep 17 00:00:00 2001 From: fabriziopandini Date: Tue, 6 Apr 2021 16:25:14 +0200 Subject: [PATCH] remove go-bindata --- Makefile | 37 +-- cmd/clusterctl/client/cluster/inventory.go | 10 +- .../clusterctl/config/embedded_manifest.go | 8 +- .../config/manifest/clusterctl-api.yaml | 66 ++++ cmd/clusterctl/config/zz_generated.bindata.go | 268 ---------------- hack/tools/go.mod | 1 - hack/tools/go.sum | 2 - hack/tools/tools.go | 1 - .../zz_generated.bindata.go | 285 ------------------ 9 files changed, 77 insertions(+), 601 deletions(-) rename test/framework/kubernetesversions/bindata.go => cmd/clusterctl/config/embedded_manifest.go (62%) create mode 100644 cmd/clusterctl/config/manifest/clusterctl-api.yaml delete mode 100644 cmd/clusterctl/config/zz_generated.bindata.go delete mode 100644 test/framework/kubernetesversions/zz_generated.bindata.go diff --git a/Makefile b/Makefile index 0752cdd3a9c6..65dfe451361f 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,8 @@ GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint) CONVERSION_GEN := $(abspath $(TOOLS_BIN_DIR)/conversion-gen) ENVSUBST := $(abspath $(TOOLS_BIN_DIR)/envsubst) -# Bindata. -GOBINDATA := $(abspath $(TOOLS_BIN_DIR)/go-bindata) -GOBINDATA_CLUSTERCTL_DIR := cmd/clusterctl/config +# clusterctl. +CLUSTERCTL_MANIFEST_DIR := cmd/clusterctl/config # Define Docker related variables. Releases should modify and double check these vars. REGISTRY ?= gcr.io/$(shell gcloud config get-value project) @@ -176,9 +175,6 @@ $(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod # Build golangci-lint from tools folder. $(CONVERSION_GEN): $(TOOLS_DIR)/go.mod cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/conversion-gen k8s.io/code-generator/cmd/conversion-gen -$(GOBINDATA): $(TOOLS_DIR)/go.mod # Build go-bindata from tools folder. - cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/go-bindata github.com/go-bindata/go-bindata/go-bindata - $(RELEASE_NOTES): $(TOOLS_DIR)/go.mod cd $(TOOLS_DIR) && go build -tags=tools -o $(RELEASE_NOTES_BIN) ./release @@ -230,7 +226,7 @@ ALL_GENERATE_MODULES = core cabpk kcp .PHONY: generate generate: ## Generate code - $(MAKE) generate-manifests generate-go generate-bindata + $(MAKE) generate-manifests generate-go $(MAKE) -C test/infrastructure/docker generate .PHONY: generate-go @@ -299,7 +295,7 @@ generate-go-conversions-kcp: $(CONVERSION_GEN) generate-manifests: $(addprefix generate-manifests-,$(ALL_GENERATE_MODULES)) ## Generate manifests e.g. CRD, RBAC etc. .PHONY: generate-manifests-core -generate-manifests-core: $(CONTROLLER_GEN) +generate-manifests-core: $(CONTROLLER_GEN) $(KUSTOMIZE) $(CONTROLLER_GEN) \ paths=./api/... \ paths=./controllers/... \ @@ -316,6 +312,7 @@ generate-manifests-core: $(CONTROLLER_GEN) paths=./cmd/clusterctl/api/... \ crd:crdVersions=v1 \ output:crd:dir=./cmd/clusterctl/config/crd/bases + $(KUSTOMIZE) build $(CLUSTERCTL_MANIFEST_DIR)/crd > $(CLUSTERCTL_MANIFEST_DIR)/manifest/clusterctl-api.yaml .PHONY: generate-manifests-cabpk generate-manifests-cabpk: $(CONTROLLER_GEN) @@ -341,26 +338,6 @@ generate-manifests-kcp: $(CONTROLLER_GEN) output:webhook:dir=./controlplane/kubeadm/config/webhook \ webhook -## -------------------------------------- -## Bindata generation -## TODO(community): Figure out a way to remove this target in favor of go embed. -## -------------------------------------- - -.PHONY: generate-bindata -generate-bindata: $(KUSTOMIZE) $(GOBINDATA) clean-bindata ## Generate code for embedding the clusterctl api manifest - # We're running go generate here, because the only target actually generates bindata in test/framework/kubernetesversions - # This directive should be removed in favor of go embed. - go generate ./... - # Package manifest YAML into a single file. - mkdir -p $(GOBINDATA_CLUSTERCTL_DIR)/manifest/ - $(KUSTOMIZE) build $(GOBINDATA_CLUSTERCTL_DIR)/crd > $(GOBINDATA_CLUSTERCTL_DIR)/manifest/clusterctl-api.yaml - # Generate go-bindata, add boilerplate, then cleanup. - $(GOBINDATA) -mode=420 -modtime=1 -pkg=config -o=$(GOBINDATA_CLUSTERCTL_DIR)/zz_generated.bindata.go $(GOBINDATA_CLUSTERCTL_DIR)/manifest/ - cat ./hack/boilerplate/boilerplate.generatego.txt $(GOBINDATA_CLUSTERCTL_DIR)/zz_generated.bindata.go > $(GOBINDATA_CLUSTERCTL_DIR)/manifest/manifests.go - cp $(GOBINDATA_CLUSTERCTL_DIR)/manifest/manifests.go $(GOBINDATA_CLUSTERCTL_DIR)/zz_generated.bindata.go - # Cleanup the manifest folder. - $(MAKE) clean-bindata - ## -------------------------------------- ## Modules ## -------------------------------------- @@ -603,10 +580,6 @@ clean-release-git: ## Restores the git files usually modified during a release clean-book: ## Remove all generated GitBook files rm -rf ./docs/book/_book -.PHONY: clean-bindata -clean-bindata: ## Remove bindata generated folder - rm -rf $(GOBINDATA_CLUSTERCTL_DIR)/manifest - .PHONY: clean-manifests ## Reset manifests in config directories back to master clean-manifests: @read -p "WARNING: This will reset all config directories to local master. Press [ENTER] to continue." diff --git a/cmd/clusterctl/client/cluster/inventory.go b/cmd/clusterctl/client/cluster/inventory.go index 23ced556988c..19490a85123f 100644 --- a/cmd/clusterctl/client/cluster/inventory.go +++ b/cmd/clusterctl/client/cluster/inventory.go @@ -34,8 +34,6 @@ import ( ) const ( - embeddedCustomResourceDefinitionPath = "cmd/clusterctl/config/manifest/clusterctl-api.yaml" - waitInventoryCRDInterval = 250 * time.Millisecond waitInventoryCRDTimeout = 1 * time.Minute ) @@ -162,14 +160,8 @@ func (p *inventoryClient) EnsureCustomResourceDefinitions() error { log.V(1).Info("Installing the clusterctl inventory CRD") - // Get the CRDs manifest from the embedded assets. - yaml, err := config.Asset(embeddedCustomResourceDefinitionPath) - if err != nil { - return err - } - // Transform the yaml in a list of objects. - objs, err := utilyaml.ToUnstructured(yaml) + objs, err := utilyaml.ToUnstructured(config.ClusterctlAPIManifest) if err != nil { return errors.Wrap(err, "failed to parse yaml for clusterctl inventory CRDs") } diff --git a/test/framework/kubernetesversions/bindata.go b/cmd/clusterctl/config/embedded_manifest.go similarity index 62% rename from test/framework/kubernetesversions/bindata.go rename to cmd/clusterctl/config/embedded_manifest.go index 2938e2350bc3..312bebe5e4a7 100644 --- a/test/framework/kubernetesversions/bindata.go +++ b/cmd/clusterctl/config/embedded_manifest.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +package config -package kubernetesversions +import _ "embed" -//go:generate sh -c "go-bindata -nometadata -pkg kubernetesversions -o zz_generated.bindata.go.tmp data && cat ../../../hack/boilerplate/boilerplate.generatego.txt zz_generated.bindata.go.tmp > zz_generated.bindata.go && rm zz_generated.bindata.go.tmp" +//go:embed manifest/clusterctl-api.yaml +var ClusterctlAPIManifest []byte diff --git a/cmd/clusterctl/config/manifest/clusterctl-api.yaml b/cmd/clusterctl/config/manifest/clusterctl-api.yaml new file mode 100644 index 000000000000..9c3aa4187900 --- /dev/null +++ b/cmd/clusterctl/config/manifest/clusterctl-api.yaml @@ -0,0 +1,66 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: providers.clusterctl.cluster.x-k8s.io +spec: + group: clusterctl.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: Provider + listKind: ProviderList + plural: providers + singular: provider + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .type + name: Type + type: string + - jsonPath: .providerName + name: Provider + type: string + - jsonPath: .version + name: Version + type: string + - jsonPath: .watchedNamespace + name: Watch Namespace + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: Provider defines an entry in the provider inventory. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + providerName: + description: ProviderName indicates the name of the provider. + type: string + type: + description: Type indicates the type of the provider. See ProviderType for a list of supported values + type: string + version: + description: Version indicates the component version. + type: string + watchedNamespace: + description: WatchedNamespace indicates the namespace where the provider controller is is watching. if empty the provider controller is watching for objects in all namespaces. + type: string + type: object + served: true + storage: true + subresources: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/clusterctl/config/zz_generated.bindata.go b/cmd/clusterctl/config/zz_generated.bindata.go deleted file mode 100644 index a1eb42f91c5b..000000000000 --- a/cmd/clusterctl/config/zz_generated.bindata.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated for package config by go-bindata DO NOT EDIT. (@generated) -// sources: -// cmd/clusterctl/config/manifest/clusterctl-api.yaml -package config - -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 _cmdClusterctlConfigManifestClusterctlApiYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\x4d\x8f\x1b\x37\x0f\xbe\xfb\x57\x10\x79\x0f\xb9\xbc\x1e\x27\x08\x0a\x14\x73\x2b\xb6\x3d\x04\xfd\xc0\x22\xbb\xd8\x1c\x8a\x1e\x64\x89\xb6\x99\xd5\x50\xaa\x48\x39\x71\x8b\xfe\xf7\x42\x92\xc7\x9e\xf1\xb6\x8e\x2f\x9d\x93\xf5\x88\x1f\x8f\x1e\x91\x94\x4d\xa4\x27\x4c\x42\x81\x7b\x30\x91\xf0\x8b\x22\x97\x95\x74\xcf\xdf\x4a\x47\x61\xb5\x7f\xbb\x78\x26\x76\x3d\xdc\x65\xd1\x30\x7c\x40\x09\x39\x59\xfc\x1e\x37\xc4\xa4\x14\x78\x31\xa0\x1a\x67\xd4\xf4\x0b\x00\xc3\x1c\xd4\x14\x58\xca\x12\xc0\x06\xd6\x14\xbc\xc7\xb4\xdc\x22\x77\xcf\x79\x8d\xeb\x4c\xde\x61\xaa\xc1\xc7\xd4\xfb\x37\xdd\x37\xdd\x9b\x05\x80\x4d\x58\xdd\x1f\x69\x40\x51\x33\xc4\x1e\x38\x7b\xbf\x00\x60\x33\x60\x0f\x31\x85\x3d\x39\x4c\xd2\x59\x9f\x45\x31\x59\xf5\xe3\xcf\xee\xcb\xb2\x91\x5e\x48\x44\x5b\xf2\x6f\x53\xc8\xb1\x87\x6b\xa6\x2d\xf0\xc8\xd6\x28\x6e\x43\xa2\x71\xbd\x1c\x5d\x97\x26\x52\x45\x9a\x16\xf7\x47\x16\x15\xf2\x24\xfa\xe3\x0c\xfe\x89\x44\xeb\x56\xf4\x39\x19\x3f\x61\x5d\x51\x21\xde\x66\x6f\xd2\x19\x5f\x00\x88\x0d\x11\x7b\xf8\xa5\x90\x89\xc6\xa2\x5b\x00\x1c\xe5\xa9\x64\x96\x60\x9c\xab\x82\x1b\x7f\x9f\x88\x15\xd3\x5d\xf0\x79\xe0\x13\xd5\x4f\x12\xf8\xde\xe8\xae\x87\x4e\x0f\x11\x2b\x3a\xca\xf6\x78\x06\xca\x5e\x0f\xa2\x89\x78\xfb\xd2\x73\x64\x54\x78\xcc\x22\xcc\x8e\xfc\xb5\x28\x47\xe2\xb3\x00\x4f\x33\xec\xba\xff\x67\xa3\x76\x87\xee\x24\xc6\x2c\xd0\xc7\xb2\x09\x97\x7b\x2f\x02\x36\xe3\xfd\x5b\xe3\xe3\xce\xbc\x6b\xc2\xdb\x1d\x0e\xa6\x3f\x7a\x84\x88\xfc\xdd\xfd\xfb\xa7\x77\x0f\x33\x18\xc0\xa1\xd8\x44\x51\x6b\x65\x8e\xe7\x06\x57\x2a\x1e\x05\x0c\x03\xb2\xa6\x03\x10\x83\xee\xf0\x74\x87\x40\xbc\x47\xd6\x90\x0e\xdd\x29\x52\x4c\x21\x62\xd2\x53\x3d\xb5\x6f\xd2\x73\x13\xf4\x22\xef\xeb\x42\xad\x59\x9d\x52\x97\x74\x47\x69\xd1\x1d\x4f\x03\x61\x03\xba\x23\x81\x84\x31\xa1\x20\xb7\xf6\x2b\xb0\x61\x08\xeb\x4f\x68\xb5\x83\x07\x4c\xc5\x11\x64\x17\xb2\x77\xa5\x2b\xf7\x98\x14\x12\xda\xb0\x65\xfa\xe3\x14\x4d\x40\x43\x4d\xe3\x8d\xa2\x28\xd4\x3a\x63\xe3\x61\x6f\x7c\xc6\xff\x83\x61\x07\x83\x39\x40\xc2\x12\x17\x32\x4f\x22\x54\x13\xe9\xe0\xe7\x90\x10\x88\x37\xa1\x87\x9d\x6a\x94\x7e\xb5\xda\x92\x8e\xf3\xc4\x86\x61\xc8\x4c\x7a\x58\xd5\xd1\x40\xeb\xac\x21\xc9\xca\xe1\x1e\xfd\x4a\x68\xbb\x34\xc9\xee\x48\xd1\x6a\x4e\xb8\x32\x91\x96\x95\x2c\xd7\x99\xd2\x0d\xee\x7f\xe9\x38\x81\xe4\xf5\x4c\xbc\x17\xf7\xdf\xbe\xda\xaf\x57\x54\x2e\x8d\x0b\x24\x60\x8e\xae\xed\x14\x67\x31\x0b\x54\xf4\xf8\xf0\xc3\xc3\x23\x8c\xa9\x9b\xe0\x4d\xdb\xb3\xa9\x9c\x65\x2e\x12\x11\x6f\x30\x35\xcb\x4d\x0a\x43\x8d\x82\xec\x62\x20\xd6\xba\xb0\x9e\x90\x15\x24\xaf\x07\xd2\x72\x7f\xbf\x67\x14\x2d\x37\xd0\xc1\x5d\x1d\xa4\xb0\x46\xc8\xd1\x19\x45\xd7\xc1\x7b\x86\x3b\x33\xa0\xbf\x33\x82\xff\xb9\xc8\x45\x4d\x59\x16\xf1\x6e\x93\x79\xfa\x06\x5c\x1a\x37\x9d\x26\x1b\xd3\x19\x73\xe5\x6e\xee\x27\x66\x40\xec\xa8\x4c\xe7\xd6\x04\xa5\xb7\x5b\xe1\x9f\xfb\xaf\xbb\x85\x67\x85\xff\x3d\x65\x19\x93\x17\xa9\x8a\xc7\x8b\x54\xf0\x80\x78\xe2\x57\x9d\x36\x21\x81\xa9\x4f\x41\x31\x96\x1c\x63\x48\x7a\x6a\x8a\x5b\xa8\xed\xbf\x3a\x12\xc6\x71\x30\x27\x68\xc3\x10\x03\x97\x4a\x3a\x46\xb8\x49\x88\xcb\x09\x7b\x25\xed\xc7\x0b\xd3\x7f\xb8\x8b\x86\x7f\xde\x61\xc2\xf9\x4c\x3c\x3f\xff\xa5\xc9\x48\x5a\x5e\xe2\x6d\x07\xb4\x01\x1c\xa2\x1e\xae\x39\x8c\xd6\x55\xde\x56\x47\x52\xe6\xae\xf1\xfe\x9c\x57\x6e\x38\xf0\x8b\x4a\x94\xd2\xa9\xae\x07\x4d\xb9\xbd\x20\xa2\x21\x99\x2d\x4e\x91\xbc\x3e\xcd\x9a\x1e\xfe\xfc\x6b\x21\x6a\x34\xd7\x49\x6e\xac\xc5\xa8\x47\x4d\xfa\xc9\x1f\x83\x57\xaf\x66\xef\x7e\x5d\xda\xc0\xed\xe1\x96\x1e\x7e\xfd\x6d\xd1\x52\xa1\x7b\x1a\x1f\xf7\x02\xfe\x1d\x00\x00\xff\xff\xb4\x73\xf0\x1a\x87\x09\x00\x00") - -func cmdClusterctlConfigManifestClusterctlApiYamlBytes() ([]byte, error) { - return bindataRead( - _cmdClusterctlConfigManifestClusterctlApiYaml, - "cmd/clusterctl/config/manifest/clusterctl-api.yaml", - ) -} - -func cmdClusterctlConfigManifestClusterctlApiYaml() (*asset, error) { - bytes, err := cmdClusterctlConfigManifestClusterctlApiYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "cmd/clusterctl/config/manifest/clusterctl-api.yaml", size: 2439, mode: os.FileMode(420), modTime: time.Unix(1, 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){ - "cmd/clusterctl/config/manifest/clusterctl-api.yaml": cmdClusterctlConfigManifestClusterctlApiYaml, -} - -// 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{ - "cmd": &bintree{nil, map[string]*bintree{ - "clusterctl": &bintree{nil, map[string]*bintree{ - "config": &bintree{nil, map[string]*bintree{ - "manifest": &bintree{nil, map[string]*bintree{ - "clusterctl-api.yaml": &bintree{cmdClusterctlConfigManifestClusterctlApiYaml, 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, "/")...)...) -} diff --git a/hack/tools/go.mod b/hack/tools/go.mod index ba246e451b25..5ad363e4b3ce 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -5,7 +5,6 @@ go 1.16 require ( github.com/blang/semver v3.5.1+incompatible github.com/drone/envsubst/v2 v2.0.0-20210305151453-490366e43a3c - github.com/go-bindata/go-bindata v3.1.2+incompatible github.com/golangci/golangci-lint v1.32.0 github.com/joelanford/go-apidiff v0.1.0 github.com/onsi/ginkgo v1.15.0 diff --git a/hack/tools/go.sum b/hack/tools/go.sum index f6e418704232..9ae7ec8e46fd 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -131,8 +131,6 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE= -github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-critic/go-critic v0.5.2 h1:3RJdgf6u4NZUumoP8nzbqiiNT8e1tC2Oc7jlgqre/IA= github.com/go-critic/go-critic v0.5.2/go.mod h1:cc0+HvdE3lFpqLecgqMaJcvWWH77sLdBp+wLGPM1Yyo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= diff --git a/hack/tools/tools.go b/hack/tools/tools.go index f77f95610351..3bf65197f6b8 100644 --- a/hack/tools/tools.go +++ b/hack/tools/tools.go @@ -21,7 +21,6 @@ package tools import ( _ "github.com/drone/envsubst/v2/cmd/envsubst" - _ "github.com/go-bindata/go-bindata" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/joelanford/go-apidiff" _ "github.com/onsi/ginkgo/ginkgo" diff --git a/test/framework/kubernetesversions/zz_generated.bindata.go b/test/framework/kubernetesversions/zz_generated.bindata.go deleted file mode 100644 index 2346cceca756..000000000000 --- a/test/framework/kubernetesversions/zz_generated.bindata.go +++ /dev/null @@ -1,285 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated for package kubernetesversions by go-bindata DO NOT EDIT. (@generated) -// sources: -// data/debian_injection_script.envsubst.sh -// data/kustomization.yaml -package kubernetesversions - -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 _dataDebian_injection_scriptEnvsubstSh = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x57\x6d\x6f\xdb\x38\x12\xfe\xae\x5f\x31\x95\x8d\x4d\xb3\x1b\x49\x69\xba\x28\xba\x29\xb4\x38\xd7\x51\x7b\x42\x03\xbb\xb0\x9d\x7d\x41\x9a\x33\x68\x6a\x2c\x13\xa6\x49\x1d\x49\xd9\x31\x1a\xdf\x6f\x3f\x90\x92\x1c\x3b\x71\xb3\xe9\x1e\x70\xf9\xe2\x88\xe2\xbc\xf0\x19\x3e\xcf\x8c\x5a\x2f\xa2\x09\x13\xd1\x84\xe8\x99\xe7\xb5\xa0\x2b\x8b\xb5\x62\xf9\xcc\xc0\xd9\xe9\xd9\x29\x8c\x66\x08\x9f\xca\x09\x2a\x81\x06\x35\x74\x4a\x33\x93\x4a\x87\x5e\xcb\x6b\xc1\x25\xa3\x28\x34\x66\x50\x8a\x0c\x15\x98\x19\x42\xa7\x20\x74\x86\xcd\x9b\x13\xf8\x0d\x95\x66\x52\xc0\x59\x78\x0a\x2f\xed\x06\xbf\x7e\xe5\x1f\xbf\xf3\x5a\xb0\x96\x25\x2c\xc8\x1a\x84\x34\x50\x6a\x04\x33\x63\x1a\xa6\x8c\x23\xe0\x2d\xc5\xc2\x00\x13\x40\xe5\xa2\xe0\x8c\x08\x8a\xb0\x62\x66\xe6\xc2\xd4\x4e\x42\xaf\x05\x7f\xd6\x2e\xe4\xc4\x10\x26\x80\x00\x95\xc5\x1a\xe4\x74\x77\x1f\x10\xe3\x12\xb6\x7f\x33\x63\x8a\xf3\x28\x5a\xad\x56\x21\x71\xc9\x86\x52\xe5\x11\xaf\x36\xea\xe8\x32\xed\x26\xbd\x61\x12\x9c\x85\xa7\xce\xe4\x4a\x70\xd4\x1a\x14\xfe\xbb\x64\x0a\x33\x98\xac\x81\x14\x05\x67\x94\x4c\x38\x02\x27\x2b\x90\x0a\x48\xae\x10\x33\x30\xd2\xe6\xbb\x52\xcc\x30\x91\x9f\x80\x96\x53\xb3\x22\x0a\xbd\x16\x64\x4c\x1b\xc5\x26\xa5\xd9\x03\xab\xc9\x8e\xe9\xbd\x0d\x52\x00\x11\xe0\x77\x86\x90\x0e\x7d\x78\xdf\x19\xa6\xc3\x13\xaf\x05\xbf\xa7\xa3\x7f\xf6\xaf\x46\xf0\x7b\x67\x30\xe8\xf4\x46\x69\x32\x84\xfe\x00\xba\xfd\xde\x45\x3a\x4a\xfb\xbd\x21\xf4\x3f\x40\xa7\xf7\x27\x7c\x4a\x7b\x17\x27\x80\xcc\xcc\x50\x01\xde\x16\xca\xe6\x2f\x15\x30\x0b\x23\x66\x16\xb3\x21\xe2\x5e\x02\x53\x59\x25\xa4\x0b\xa4\x6c\xca\x28\x70\x22\xf2\x92\xe4\x08\xb9\x5c\xa2\x12\x4c\xe4\x50\xa0\x5a\x30\x6d\x8b\xa9\x81\x88\xcc\x6b\x01\x67\x0b\x66\x88\x71\x2b\x8f\x0e\x15\x7a\x5e\xab\x05\x9f\x39\x12\x8d\xb6\xbc\x36\x20\x31\x3b\x05\x16\x88\x99\xb6\x90\x4d\x10\x50\x53\x52\x60\xe6\xf2\x40\xb1\xd4\xe5\x44\x1b\xfb\x6a\x5a\x0a\x6a\xfd\xdb\x7b\xa9\x67\xc8\x39\x9d\x21\x9d\x5b\xb0\x2c\xfa\xf1\xb0\xfb\xea\xf4\xed\xeb\x93\x61\xf7\xec\xf4\xf5\xcf\xee\xe7\xcd\x1b\xfb\xf3\xea\x97\xd7\x9e\xa7\xd1\x40\x20\x41\xc8\x52\x68\x34\xcd\x63\xc1\x0a\x9c\x12\xc6\x9b\x67\x54\x0a\x6f\x99\xf1\xbc\xeb\x6b\x68\xbf\x64\x19\x04\xe5\x31\xbc\x88\xe1\x14\x6e\x6e\xe0\x87\x1f\x60\x78\x75\xd1\x8f\x7d\x5d\x66\xd2\x87\xbb\xbb\xfa\xd1\xf7\xbc\xab\x61\x32\xee\xa6\xe3\xce\x60\x94\x7e\xe8\x74\x47\xc3\xb8\xfd\xf5\xe1\xd2\x79\x3c\x25\x5c\xe3\xc6\xf3\xd8\x14\xae\xe1\x05\xf8\x8f\xf7\x6c\x7c\x88\xc1\xa8\x12\xe1\xe6\x9d\x45\x4f\x78\x00\x48\x67\x12\xfc\x9e\x84\x6e\x0a\x1d\x65\xd8\x94\x50\xa3\x81\x09\x6d\x08\xe7\x0e\xee\x13\xb0\x39\x33\x91\xfb\x76\xfb\x2d\x33\x70\xea\x4d\x99\xe7\x7d\x1c\x5e\x8d\xd2\xcb\x38\xd7\xa5\x61\xdc\x85\x7d\x61\xd9\xb3\x20\x22\x83\x60\x09\xed\xf6\xd7\x6a\xc7\x06\x7e\x8d\x32\x5c\x46\xa2\xe4\x7c\x1b\x96\x14\x26\xc8\xd1\x40\x59\x64\xc4\xe0\xce\x42\x1d\x19\x82\xb5\x5b\x32\x8a\x08\x5d\x48\x65\x02\xcb\x24\x0d\x94\x04\x14\x6d\x9a\x8c\x12\xab\x10\xb9\x28\x8b\x1c\x68\xa9\xf8\xf6\x2c\x19\x4e\xe0\x5a\xb3\x5c\x60\x16\x4c\xd6\x71\x54\x6a\x15\xe9\x19\x51\x18\xcd\x71\xad\x98\xc8\x75\x44\xb9\x2c\xb3\x30\x97\x32\xe7\x18\xe6\x45\x7e\xe3\x78\xaa\xcf\xa3\xa8\x20\x74\x4e\x72\xd4\xe1\xde\x16\x2a\x17\x11\x29\x0c\xb8\xc5\x40\x67\x73\x58\x10\x26\x7c\xb8\xb3\xa7\xb4\x55\xda\x80\x41\x84\x80\x40\x84\x86\xda\xad\x91\x96\xa5\xa2\xa8\x43\xce\xb4\x09\xb3\xa8\x72\x14\x6c\x1d\xb8\x75\x0f\x5c\xe6\xcf\x0b\x1e\x65\xd2\x79\x0e\xe6\xb8\xb6\x39\xef\x06\xaf\x97\x21\x08\xea\x23\xc2\x73\x4e\x0d\x24\xcb\x20\x78\x66\x31\x1e\x1e\xc0\x5d\x81\x9d\x1a\x2f\x2b\xe9\xb5\xdc\x19\x59\xd6\x19\xd4\x5b\x7b\x2b\x68\x15\x35\x9b\x13\x5a\x85\x98\x30\x41\x14\x43\x5d\x51\x95\x28\x04\x02\x0a\x75\xc9\x4d\xa3\xa7\xdd\xd4\x72\x7f\x6b\x3c\x29\x19\xcf\x6c\x33\x80\xd4\x80\x2a\x85\x86\xa3\x30\x0c\x21\x08\xea\xd8\x47\xcd\xf5\x73\x44\x5f\xa2\x62\xd3\x75\xa3\x03\x78\x1f\xce\x46\xa2\x52\x29\xa4\x86\xaf\x9b\x14\xd1\x4a\x8c\x0d\x36\x65\x82\x70\xbe\x86\x52\x6c\x93\xb7\xd6\xdb\xd2\x78\x2d\xf8\x50\xeb\xd7\xa3\x43\x31\xe3\x8e\xad\xc1\x62\x56\x27\x65\xb9\x54\xa9\x5d\x59\xd8\x7b\x0c\x7a\x8e\xab\xd0\xbb\x4c\x7b\xc9\x78\x98\x7c\xee\x0c\x3a\xa3\xfe\x20\xf6\x7f\xfc\xde\x3f\xdf\xab\x6e\x7b\xbb\xfd\x75\xdf\xd7\xc6\x77\x5a\xd8\xe5\xa5\x36\xa8\xa8\xe1\x60\xc5\x67\x49\x14\xb3\x2a\xa6\xbd\x96\xed\x33\xed\xf6\xd7\x4f\x57\xef\x93\x41\x2f\x19\x25\xc3\xf1\x6f\xc9\x60\x98\xf6\x7b\x1b\x58\x31\xce\xad\x42\x2a\x2c\x38\xa1\x55\xff\xa1\x5b\x47\xde\x63\x93\xf8\xa0\x1f\x17\xa3\x05\x89\xc8\x76\xac\x1f\xa4\xe1\x64\xea\xda\xe5\x7f\xc0\x83\x6f\x55\xd1\xf7\xe1\xe6\x5e\xa8\xba\xe9\xf8\x22\x1d\xc4\x91\x59\x14\xd1\xfc\xad\x0e\x28\xf3\x00\x16\xf3\x8c\x29\x08\x0a\xe7\xa7\xda\xb1\xb1\x32\x95\x21\xe5\xb6\xce\x01\x81\xcf\x9d\xee\xa7\xce\xc7\x64\x38\x1e\xf5\xc7\xa3\x64\x38\x8a\x5f\xfa\xf3\x72\x62\x8b\xef\x83\xfb\x8f\xa3\xa9\xff\x23\xd9\xc2\x3f\xde\xb7\xee\xf6\x7b\xa3\x4e\xda\x4b\x06\x0f\xed\x03\x52\x30\x8d\x6a\x89\xaa\x36\x0e\xa8\x14\x46\x49\xce\x51\x05\x0b\x22\x48\x7e\xff\xa6\x50\xf2\x76\xdd\x3c\x68\x3a\xc3\xac\xe4\xa8\x5c\xa8\xad\xff\x71\xf2\xc7\x28\xf6\x0d\x51\xfe\x56\xc8\x7e\x74\xb7\xc9\xb2\xb9\x9b\x36\xd7\xe9\x1b\x95\xb3\x46\x2d\xe8\xba\x7e\x65\xdb\x9a\xc6\xc5\x12\x95\x07\xf0\x17\x28\xc7\xff\x81\x7f\x2d\xaf\x4f\x83\x5f\x6e\x7e\xfa\x12\xee\xff\xb6\x77\xc1\x77\xf0\x5f\x0d\x2e\x63\x3f\xb7\x42\x35\xdf\x8e\x68\x41\x4d\x82\xa8\xf9\x3d\x1c\xc9\xcd\x7c\x9c\x89\xf2\x36\x22\x8b\xec\xcd\xcf\xbe\xf3\x59\xbf\x1d\xd7\xb3\xc6\xf8\xf3\x20\xf9\x90\xfe\x11\x1f\xce\xb6\xb5\xdc\x54\x56\x17\xc9\xfb\xb4\xd3\x1b\x7f\x18\xf4\x7b\xa3\xa4\x77\x11\x0b\x29\x98\x30\xa8\x08\x35\x6c\x89\xcf\x6e\x24\x55\xcb\xa8\x15\x38\xd0\x7f\x5b\x84\x1b\xed\x6d\xc4\xb4\xae\xde\x91\x6d\x43\x8d\x4f\x52\x98\xf0\x1e\xb3\x90\xc9\x08\x76\x20\xbc\x45\xc1\x08\x77\x2d\xe5\x08\x7e\xfd\x56\x07\xd9\xb1\xaf\x7b\xc7\x01\xe1\xb6\xb7\xa0\x26\x2f\x84\xd5\x00\xfb\x25\xdc\xc3\x7a\x90\x7c\x4c\x2a\x88\x0f\xa3\x1f\x45\x61\xf4\xe5\x4b\x58\x63\x5d\x93\x67\x4b\x77\xbf\xfd\xd2\xc6\xa4\x6e\xec\x5e\x90\x8c\x69\x29\xa0\x26\x11\xdc\x41\xae\xb0\xa2\xe2\x5e\xb4\x4d\x60\x3b\xe5\x0c\x49\x06\x81\x78\x05\x77\x40\x4b\x03\x41\x06\x47\x77\x47\x10\x4c\xe1\x0c\xee\xc0\x28\xb7\x70\x7d\xae\x0b\x42\xf1\xfc\xe6\xe8\xb8\x8a\x6f\xef\x72\x37\x1d\xd7\x69\x58\x29\xb5\xde\x1f\x52\xfa\xfa\x1f\x37\x1b\xff\x1d\x64\xd2\xd9\xdc\xd3\xa7\xbe\x02\x6e\x9e\xac\xaa\x7a\x0e\x95\x4e\xd4\x1e\x36\x70\xef\x6d\x8f\x4b\x7f\xef\x9e\xf9\xfb\xce\xe3\x6f\x3a\xcf\xa4\xb0\xd5\x42\xae\xf1\x39\xe4\x0a\xec\xf8\x44\xd9\x77\x71\xeb\x7f\x43\x2e\x93\x2b\xc1\x25\xc9\x2c\x74\xae\x71\xae\x1b\xe4\xae\x06\x97\x9b\x68\xff\x9c\x0d\x60\x3b\xd3\x00\xdd\x2a\xf2\xa1\xfd\xbb\x6a\xfd\x0d\x5f\x74\xb6\x90\x19\xfc\x74\xfb\x8c\xad\x8b\xe5\x53\x9b\xc0\x77\xa3\x90\xc5\xe8\x90\x79\x5d\x09\x00\xbd\xd6\x06\x17\xb6\x4f\x29\xd4\x86\x28\xd3\x5c\x6b\x0f\x60\x6a\x5b\x4d\x0d\xe8\x56\xb0\x1b\x48\x1f\x77\x88\x7d\x50\x0f\x41\xfa\xe0\x36\xee\x60\xb4\xf5\xb6\x09\x77\x7d\xdb\xee\x50\x67\xfc\x57\x28\x3f\xe9\xe1\x00\x52\xcf\x8a\x58\x8d\x99\xd4\xd2\x54\xc0\xfc\xad\x95\x30\x60\x8b\x6a\xe8\x59\xb8\xb1\xe6\x3b\x1d\xdb\xcf\x9b\x2d\x4d\x73\x21\xdd\xd0\x8a\xb7\x05\x52\xfb\x4d\x7a\x64\x23\xed\xf9\x3f\xaa\x47\xc3\xe7\x64\x64\x48\x0e\xbe\x5d\xca\xa9\xb2\x5a\xfb\x30\x9d\xc0\xd1\xe4\xfc\x20\x9b\xa2\xe8\xa7\x68\x6c\x71\x7a\xc2\xfe\x49\xcb\xff\x57\x7e\xb5\xed\x8e\x58\x50\x16\x54\x01\xbe\x3b\x61\x47\x82\x29\xf3\x9a\x82\xb8\xef\xde\x7b\xea\x6f\x47\xd9\x66\xe6\xb4\xa7\xaa\xd7\xce\xc1\xde\xa9\x97\x3b\x2b\xc7\xcd\xae\x7a\xa2\x7a\xb0\xf3\xc1\x2a\x04\x32\xd6\x33\xa9\xcc\x9e\x99\xa5\xe1\x63\xb3\x9d\x55\x08\x02\xca\x19\x0a\x13\xbb\xcf\xd9\x20\x70\x3e\xdc\xc3\x9e\x23\xdb\x96\x1e\x3b\xb2\xab\xdb\xaf\x86\xe3\xa7\x26\xe9\xff\x06\x00\x00\xff\xff\xd7\x38\x51\x53\xae\x12\x00\x00") - -func dataDebian_injection_scriptEnvsubstShBytes() ([]byte, error) { - return bindataRead( - _dataDebian_injection_scriptEnvsubstSh, - "data/debian_injection_script.envsubst.sh", - ) -} - -func dataDebian_injection_scriptEnvsubstSh() (*asset, error) { - bytes, err := dataDebian_injection_scriptEnvsubstShBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/debian_injection_script.envsubst.sh", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataKustomizationYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x4c\x8e\x4d\x0a\xc2\x30\x10\x46\xf7\x39\x45\x2e\x90\x48\x77\x92\x2b\x88\x2b\xc1\xfd\x98\x4e\xea\x90\xe6\x87\x99\x69\x41\x4f\x2f\x25\x22\xae\xdf\xf7\x3e\x1e\x74\xba\x23\x0b\xb5\x1a\x6c\xde\x44\x5b\xa1\x37\xfa\xd8\x6a\xa2\xc5\xe7\xb3\x78\x6a\xa7\x7d\x7a\xa0\xc2\x64\x32\xd5\x39\xd8\xcb\x77\x05\x4a\xad\x9a\x0a\x05\xa5\x43\xc4\x60\x67\x4c\xb0\xad\x6a\x18\xa5\x6d\x1c\x51\x82\xb1\xd6\xd9\x48\x0e\x58\x29\x41\x54\x71\x83\x38\xc5\xd2\x57\x50\xf4\x2f\x28\xab\xe9\xa0\xf1\x89\x72\x53\x06\xc5\x85\xe2\x15\x79\xc1\x21\xff\x92\xf6\x11\x29\xc3\x38\xd0\x71\x90\x1a\x17\x97\xff\x83\x06\xff\x04\x00\x00\xff\xff\x16\x92\x86\x00\xd6\x00\x00\x00") - -func dataKustomizationYamlBytes() ([]byte, error) { - return bindataRead( - _dataKustomizationYaml, - "data/kustomization.yaml", - ) -} - -func dataKustomizationYaml() (*asset, error) { - bytes, err := dataKustomizationYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/kustomization.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 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){ - "data/debian_injection_script.envsubst.sh": dataDebian_injection_scriptEnvsubstSh, - "data/kustomization.yaml": dataKustomizationYaml, -} - -// 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{ - "data": &bintree{nil, map[string]*bintree{ - "debian_injection_script.envsubst.sh": &bintree{dataDebian_injection_scriptEnvsubstSh, map[string]*bintree{}}, - "kustomization.yaml": &bintree{dataKustomizationYaml, 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, "/")...)...) -}