mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Get rid of statik and fix failing tests
This commit is contained in:
@@ -6,17 +6,18 @@ package krmfunction
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"embed"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/rakyll/statik/fs"
|
||||
// load embedded func wrapper
|
||||
_ "sigs.k8s.io/kustomize/cmd/pluginator/v2/internal/krmfunction/funcwrapper"
|
||||
)
|
||||
|
||||
//go:embed funcwrappersrc/go.mod.src
|
||||
//go:embed funcwrappersrc/main.go
|
||||
var fs embed.FS
|
||||
|
||||
// Converter is a converter to convert the
|
||||
// plugin file to KRM function
|
||||
type Converter struct {
|
||||
@@ -122,11 +123,7 @@ func (c *Converter) prepareWrapper(content string) string {
|
||||
// readEmbeddedFile read the file from embedded files with filename
|
||||
// name. Return the file content if it's successful.
|
||||
func (c *Converter) readEmbeddedFile(name string) (string, error) {
|
||||
statikFS, err := fs.New()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
r, err := statikFS.Open("/" + name)
|
||||
r, err := fs.Open("funcwrappersrc/" + name)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user