1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

refactor: move resource/convert in ext (#8769)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-10-29 10:39:39 +01:00 committed by GitHub
parent bd72e42bfe
commit 32d16059be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -6,8 +6,8 @@ import (
kyvernov2alpha1 "github.com/kyverno/kyverno/api/kyverno/v2alpha1"
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/data"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/convert"
resourceloader "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/loader"
"github.com/kyverno/kyverno/ext/resource/convert"
yamlutils "github.com/kyverno/kyverno/ext/yaml"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/kubectl-validate/pkg/openapiclient"

View file

@ -14,9 +14,9 @@ import (
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/data"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/experimental"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/convert"
resourceloader "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/loader"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/source"
"github.com/kyverno/kyverno/ext/resource/convert"
extyaml "github.com/kyverno/kyverno/ext/yaml"
"github.com/kyverno/kyverno/pkg/utils/git"
yamlutils "github.com/kyverno/kyverno/pkg/utils/yaml"

View file

@ -1,8 +1,8 @@
package resource
import (
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/convert"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/resource/loader"
"github.com/kyverno/kyverno/ext/resource/convert"
)
func Load[T any](l loader.Loader, content []byte) (*T, error) {

View file

@ -12,7 +12,7 @@ import (
func TestTo(t *testing.T) {
{
data, err := os.ReadFile("../../_testdata/policies/check-image.yaml")
data, err := os.ReadFile("../../../cmd/cli/kubectl-kyverno/_testdata/policies/check-image.yaml")
require.NoError(t, err)
json, err := yaml.YAMLToJSON(data)
@ -26,7 +26,7 @@ func TestTo(t *testing.T) {
require.Error(t, err)
}
{
data, err := os.ReadFile("../../_testdata/resources/namespace.yaml")
data, err := os.ReadFile("../../../cmd/cli/kubectl-kyverno/_testdata/resources/namespace.yaml")
require.NoError(t, err)
json, err := yaml.YAMLToJSON(data)