mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 10:00:56 +00:00
Collect existing internal pkgs under one roof.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// Package error has contextual error types.
|
||||
package error
|
||||
|
||||
import "fmt"
|
||||
|
||||
// ConfigmapError represents error with a configmap.
|
||||
type ConfigmapError struct {
|
||||
Path string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
func (e ConfigmapError) Error() string {
|
||||
return fmt.Sprintf("Kustomization file [%s] encounters a configmap error: %s\n", e.Path, e.ErrorMsg)
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestConfigmapError_Error(t *testing.T) {
|
||||
errorMsg := "configmap name is missing"
|
||||
me := ConfigmapError{Path: filepath, ErrorMsg: errorMsg}
|
||||
|
||||
if !strings.Contains(me.Error(), filepath) {
|
||||
t.Errorf("Incorrect ConfigmapError.Error() message \n")
|
||||
t.Errorf("Expected filepath %s, but unfound\n", filepath)
|
||||
}
|
||||
|
||||
if !strings.Contains(me.Error(), errorMsg) {
|
||||
t.Errorf("Incorrect ConfigmapError.Error() message \n")
|
||||
t.Errorf("Expected errorMsg %s, but unfound\n", errorMsg)
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// PatchError represents error during Patch.
|
||||
type PatchError struct {
|
||||
KustomizationPath string
|
||||
PatchFilepath string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
func (e PatchError) Error() string {
|
||||
return fmt.Sprintf("Kustomization file [%s] encounters a patch error for [%s]: %s\n", e.KustomizationPath, e.PatchFilepath, e.ErrorMsg)
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPatchError_Error(t *testing.T) {
|
||||
patchfilepath := "/path/to/patch/patch.yaml"
|
||||
errorMsg := "file not found"
|
||||
me := PatchError{KustomizationPath: filepath, PatchFilepath: patchfilepath, ErrorMsg: errorMsg}
|
||||
if !strings.Contains(me.Error(), filepath) {
|
||||
t.Errorf("Incorrect PatchError.Error() message \n")
|
||||
t.Errorf("Expected filepath %s, but unfound\n", filepath)
|
||||
}
|
||||
if !strings.Contains(me.Error(), patchfilepath) {
|
||||
t.Errorf("Incorrect PatchError.Error() message \n")
|
||||
t.Errorf("Expected patchfilepath %s, but unfound\n", patchfilepath)
|
||||
}
|
||||
if !strings.Contains(me.Error(), errorMsg) {
|
||||
t.Errorf("Incorrect PatchError.Error() message \n")
|
||||
t.Errorf("Expected errorMsg %s, but unfound\n", errorMsg)
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import "fmt"
|
||||
|
||||
// ResourceError represents error in a resource.
|
||||
type ResourceError struct {
|
||||
KustomizationPath string
|
||||
ResourceFilepath string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
func (e ResourceError) Error() string {
|
||||
return fmt.Sprintf("Kustomization file [%s] encounters a resource error for [%s]: %s\n", e.KustomizationPath, e.ResourceFilepath, e.ErrorMsg)
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestResourceError_Error(t *testing.T) {
|
||||
resourcefilepath := "/path/to/resource/deployment.yaml"
|
||||
errorMsg := "file not found"
|
||||
me := ResourceError{KustomizationPath: filepath, ResourceFilepath: resourcefilepath, ErrorMsg: errorMsg}
|
||||
if !strings.Contains(me.Error(), filepath) {
|
||||
t.Errorf("Incorrect ResourceError.Error() message \n")
|
||||
t.Errorf("Expected filepath %s, but unfound\n", filepath)
|
||||
}
|
||||
if !strings.Contains(me.Error(), resourcefilepath) {
|
||||
t.Errorf("Incorrect ResourceError.Error() message \n")
|
||||
t.Errorf("Expected resourcefilepath %s, but unfound\n", resourcefilepath)
|
||||
}
|
||||
if !strings.Contains(me.Error(), errorMsg) {
|
||||
t.Errorf("Incorrect ResourceError.Error() message \n")
|
||||
t.Errorf("Expected errorMsg %s, but unfound\n", errorMsg)
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import "fmt"
|
||||
|
||||
// SecretError represents error with a secret.
|
||||
type SecretError struct {
|
||||
KustomizationPath string
|
||||
// ErrorMsg is an error message
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
func (e SecretError) Error() string {
|
||||
return fmt.Sprintf("Kustomization file [%s] encounters a secret error: %s\n", e.KustomizationPath, e.ErrorMsg)
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSecretError_Error(t *testing.T) {
|
||||
errorMsg := "missing a command"
|
||||
me := SecretError{KustomizationPath: filepath, ErrorMsg: errorMsg}
|
||||
if !strings.Contains(me.Error(), filepath) {
|
||||
t.Errorf("Incorrect SecretError.Error() message \n")
|
||||
t.Errorf("Expected filepath %s, but unfound\n", filepath)
|
||||
}
|
||||
|
||||
if !strings.Contains(me.Error(), errorMsg) {
|
||||
t.Errorf("Incorrect SecretError.Error() message \n")
|
||||
t.Errorf("Expected errorMsg %s, but unfound\n", errorMsg)
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// Package error has contextual error types.
|
||||
package error
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// YamlFormatError represents error with yaml file name where json/yaml format error happens.
|
||||
type YamlFormatError struct {
|
||||
Path string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
func (e YamlFormatError) Error() string {
|
||||
return fmt.Sprintf("YAML file [%s] encounters a format error.\n%s\n", e.Path, e.ErrorMsg)
|
||||
}
|
||||
|
||||
// Handler handles YamlFormatError
|
||||
func Handler(e error, path string) error {
|
||||
if isYAMLSyntaxError(e) {
|
||||
return YamlFormatError{
|
||||
Path: path,
|
||||
ErrorMsg: e.Error(),
|
||||
}
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
func isYAMLSyntaxError(e error) bool {
|
||||
return strings.Contains(e.Error(), "error converting YAML to JSON") || strings.Contains(e.Error(), "error unmarshaling JSON")
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
package error
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
filepath = "/path/to/whatever"
|
||||
expected = "YAML file [/path/to/whatever] encounters a format error.\n" +
|
||||
"error converting YAML to JSON: yaml: line 2: found character that cannot start any token\n"
|
||||
)
|
||||
|
||||
func TestYamlFormatError_Error(t *testing.T) {
|
||||
testErr := YamlFormatError{
|
||||
Path: filepath,
|
||||
ErrorMsg: "error converting YAML to JSON: yaml: line 2: found character that cannot start any token",
|
||||
}
|
||||
if testErr.Error() != expected {
|
||||
t.Errorf("Expected : %s\n, but found : %s\n", expected, testErr.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestErrorHandler(t *testing.T) {
|
||||
err := fmt.Errorf("error converting YAML to JSON: yaml: line 2: found character that cannot start any token")
|
||||
testErr := Handler(err, filepath)
|
||||
expectedErr := fmt.Errorf("format error message")
|
||||
fmtErr := Handler(expectedErr, filepath)
|
||||
if fmtErr.Error() != expectedErr.Error() {
|
||||
t.Errorf("Expected returning fmt.Error, but found %T", fmtErr)
|
||||
}
|
||||
if _, ok := testErr.(YamlFormatError); !ok {
|
||||
t.Errorf("Expected returning YamlFormatError, but found %T", testErr)
|
||||
}
|
||||
if testErr == nil || testErr.Error() != expected {
|
||||
t.Errorf("Expected : %s\n, but found : %s\n", expected, testErr.Error())
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// Package loadertest holds a fake for the Loader interface.
|
||||
package loadertest
|
||||
|
||||
import (
|
||||
"log"
|
||||
"sigs.k8s.io/kustomize/pkg/fs"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/pkg/loader"
|
||||
)
|
||||
|
||||
// FakeLoader encapsulates the delegate Loader and the fake file system.
|
||||
type FakeLoader struct {
|
||||
fs fs.FileSystem
|
||||
delegate ifc.Loader
|
||||
}
|
||||
|
||||
// NewFakeLoader returns a Loader that uses a fake filesystem.
|
||||
// The loader will be restricted to root only.
|
||||
// The initialDir argument should be an absolute file path.
|
||||
func NewFakeLoader(initialDir string) FakeLoader {
|
||||
return NewFakeLoaderWithRestrictor(
|
||||
loader.RestrictionRootOnly, initialDir)
|
||||
}
|
||||
|
||||
// NewFakeLoaderWithRestrictor returns a Loader that
|
||||
// uses a fake filesystem.
|
||||
// The initialDir argument should be an absolute file path.
|
||||
func NewFakeLoaderWithRestrictor(
|
||||
lr loader.LoadRestrictorFunc, initialDir string) FakeLoader {
|
||||
// Create fake filesystem and inject it into initial Loader.
|
||||
fSys := fs.MakeFakeFS()
|
||||
fSys.Mkdir(initialDir)
|
||||
ldr, err := loader.NewLoader(lr, initialDir, fSys)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to make loader: %v", err)
|
||||
}
|
||||
return FakeLoader{fs: fSys, delegate: ldr}
|
||||
}
|
||||
|
||||
// AddFile adds a fake file to the file system.
|
||||
func (f FakeLoader) AddFile(fullFilePath string, content []byte) error {
|
||||
return f.fs.WriteFile(fullFilePath, content)
|
||||
}
|
||||
|
||||
// AddDirectory adds a fake directory to the file system.
|
||||
func (f FakeLoader) AddDirectory(fullDirPath string) error {
|
||||
return f.fs.Mkdir(fullDirPath)
|
||||
}
|
||||
|
||||
// Root returns root.
|
||||
func (f FakeLoader) Root() string {
|
||||
return f.delegate.Root()
|
||||
}
|
||||
|
||||
// New creates a new loader from a new root.
|
||||
func (f FakeLoader) New(newRoot string) (ifc.Loader, error) {
|
||||
l, err := f.delegate.New(newRoot)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return FakeLoader{fs: f.fs, delegate: l}, nil
|
||||
}
|
||||
|
||||
// Load performs load from a given location.
|
||||
func (f FakeLoader) Load(location string) ([]byte, error) {
|
||||
return f.delegate.Load(location)
|
||||
}
|
||||
|
||||
// Cleanup does nothing
|
||||
func (f FakeLoader) Cleanup() error {
|
||||
return nil
|
||||
}
|
||||
@@ -22,9 +22,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/patch"
|
||||
"sigs.k8s.io/kustomize/pkg/resid"
|
||||
"sigs.k8s.io/kustomize/pkg/resmap"
|
||||
|
||||
@@ -17,9 +17,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kv/plugin"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/pkg/resource"
|
||||
)
|
||||
|
||||
@@ -19,10 +19,10 @@ package plugins_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/internal/plugintest"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kv/plugin"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/plugins"
|
||||
"sigs.k8s.io/kustomize/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/pkg/resource"
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"sigs.k8s.io/kustomize/internal/kusterr"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
internal "sigs.k8s.io/kustomize/pkg/internal/error"
|
||||
"sigs.k8s.io/kustomize/pkg/resource"
|
||||
"sigs.k8s.io/kustomize/pkg/types"
|
||||
)
|
||||
@@ -50,7 +50,7 @@ func (rmF *Factory) FromFile(
|
||||
}
|
||||
res, err := rmF.NewResMapFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, path)
|
||||
return nil, kusterr.Handler(err, path)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/fs"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/pkg/resid"
|
||||
. "sigs.k8s.io/kustomize/pkg/resmap"
|
||||
|
||||
@@ -22,8 +22,8 @@ import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/kusterr"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
internal "sigs.k8s.io/kustomize/pkg/internal/error"
|
||||
"sigs.k8s.io/kustomize/pkg/patch"
|
||||
"sigs.k8s.io/kustomize/pkg/types"
|
||||
)
|
||||
@@ -78,7 +78,7 @@ func (rf *Factory) SliceFromPatches(
|
||||
}
|
||||
res, err := rf.SliceFromBytes(content)
|
||||
if err != nil {
|
||||
return nil, internal.Handler(err, string(path))
|
||||
return nil, kusterr.Handler(err, string(path))
|
||||
}
|
||||
result = append(result, res...)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/patch"
|
||||
. "sigs.k8s.io/kustomize/pkg/resource"
|
||||
)
|
||||
|
||||
@@ -23,9 +23,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/resid"
|
||||
"sigs.k8s.io/kustomize/pkg/resmap"
|
||||
"sigs.k8s.io/kustomize/pkg/resource"
|
||||
|
||||
@@ -24,10 +24,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kv/plugin"
|
||||
"sigs.k8s.io/kustomize/k8sdeps/transformer"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/loader"
|
||||
"sigs.k8s.io/kustomize/pkg/pgmconfig"
|
||||
"sigs.k8s.io/kustomize/pkg/plugins"
|
||||
|
||||
@@ -20,9 +20,9 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/internal/loadertest"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
)
|
||||
|
||||
// This defines two CRD's: Bee and MyKind.
|
||||
|
||||
Reference in New Issue
Block a user