1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

removing scheme dependencies

This commit is contained in:
NoSkillGirl 2020-11-05 23:14:58 +05:30
parent ef8970ddac
commit 0a7be578ea
4 changed files with 5 additions and 11 deletions

View file

@ -27,8 +27,6 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
)
var Scheme = runtime.NewScheme()
@ -38,8 +36,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{
kyvernov1.AddToScheme,
kyvernov1alpha1.AddToScheme,
policyv1alpha1.AddToScheme,
appsv1.AddToScheme,
corev1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View file

@ -10,10 +10,8 @@ import (
"reflect"
"strings"
"time"
"github.com/kyverno/kyverno/pkg/engine/response"
yaml1 "sigs.k8s.io/yaml"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
client "github.com/kyverno/kyverno/pkg/dclient"
"github.com/kyverno/kyverno/pkg/engine"
@ -205,8 +203,8 @@ func Command() *cobra.Command {
cmd.Flags().BoolVarP(&cluster, "cluster", "c", false, "Checks if policies should be applied to cluster in the current context")
cmd.Flags().StringVarP(&mutateLogPath, "output", "o", "", "Prints the mutated resources in provided file/directory")
cmd.Flags().StringVarP(&variablesString, "set", "s", "", "Variables that are required")
cmd.Flags().StringVarP(&valuesFile, "values_file", "f", "", "File containing values for policy variables")
cmd.Flags().BoolVarP(&policyReport, "policy_report", "", false, "Generates policy report when passed (default policyviolation r")
cmd.Flags().StringVarP(&valuesFile, "values-file", "f", "", "File containing values for policy variables")
cmd.Flags().BoolVarP(&policyReport, "policy-report", "", false, "Generates policy report when passed (default policyviolation r")
cmd.Flags().StringVarP(&namespace, "namespace", "n", "", "Optional Policy parameter passed with cluster flag")
return cmd
}

View file

@ -9,7 +9,7 @@ import (
"github.com/kyverno/kyverno/pkg/kyverno/sanitizedError"
v1 "github.com/kyverno/kyverno/pkg/api/kyverno/v1"
"github.com/kyverno/kyverno/pkg/client/clientset/versioned/scheme"
"k8s.io/client-go/kubernetes/scheme"
client "github.com/kyverno/kyverno/pkg/dclient"
engineutils "github.com/kyverno/kyverno/pkg/engine/utils"
"github.com/kyverno/kyverno/pkg/utils"

View file

@ -132,13 +132,13 @@ func (o *Controller) ParseCRD(crd unstructured.Unstructured) {
}
if openV3schema == nil {
log.Log.V(3).Info("skip adding schema, CRD has no properties", "name", crdName)
log.Log.V(4).Info("skip adding schema, CRD has no properties", "name", crdName)
return
}
schemaRaw, _ := json.Marshal(openV3schema)
if len(schemaRaw) < 1 {
log.Log.V(3).Info("could not parse crd schema", "name", crdName)
log.Log.V(4).Info("could not parse crd schema", "name", crdName)
return
}