mirror of
https://github.com/k3s-io/k3s.git
synced 2026-04-06 18:05:05 -04:00
* Pass GOOS into Dockerfile.local build args Fixes issue with build-windows job not actually building for windows * Remove `go generate` from package-cli We no longer use codegen in this repo * Fix go:embed path separator on Windows * Bump hcsshim for containerd 2.1 compat on windows * Include failing lister in error message * Bump k3s-io/api and k3s-io/helm-controller for embedded CRD windows path fix Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
35 lines
974 B
Go
35 lines
974 B
Go
package bindata
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"path"
|
|
"sort"
|
|
"strings"
|
|
)
|
|
|
|
// Bindata is a wrapper around embed.FS that allows us to continue to use
|
|
// go-bindata style Asset and AssetNames functions to access the embedded FS.
|
|
type Bindata struct {
|
|
FS *embed.FS
|
|
Prefix string
|
|
}
|
|
|
|
func (b Bindata) Asset(name string) ([]byte, error) {
|
|
return b.FS.ReadFile(path.Join(b.Prefix, name))
|
|
}
|
|
|
|
func (b Bindata) AssetNames() []string {
|
|
var assets []string
|
|
fs.WalkDir(b.FS, ".", func(path string, entry fs.DirEntry, err error) error {
|
|
// do not list hidden files - there is a .empty file checked in as a
|
|
// placeholder for files that are generated at build time to satisy
|
|
// `go vet`, but these should not be include when listing assets.
|
|
if n := entry.Name(); entry.Type().IsRegular() && !strings.HasPrefix(n, ".") && !strings.HasPrefix(n, "_") {
|
|
assets = append(assets, strings.TrimPrefix(path, b.Prefix))
|
|
}
|
|
return nil
|
|
})
|
|
sort.Strings(assets)
|
|
return assets
|
|
}
|