mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
go fmt
This commit is contained in:
parent
e43154ea1c
commit
e59425dfcd
10 changed files with 33 additions and 43 deletions
|
@ -148,8 +148,6 @@ func main() {
|
|||
log.Log.WithName("ResourceWebhookRegister"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
// KYVERNO CRD INFORMER
|
||||
// watches CRD resources:
|
||||
// - Policy
|
||||
|
@ -186,7 +184,6 @@ func main() {
|
|||
// - Create Jobs for report
|
||||
jobController := jobs.NewJobsJob(client, log.Log.WithName("jobController"))
|
||||
|
||||
|
||||
// POLICY VIOLATION GENERATOR
|
||||
// -- generate policy violation
|
||||
pvgen := policyviolation.NewPVGenerator(pclient,
|
||||
|
|
|
@ -287,10 +287,8 @@ func applyRule(log logr.Logger, client *dclient.Client, rule kyverno.Rule, resou
|
|||
return newGenResource, nil
|
||||
}
|
||||
|
||||
|
||||
logger := log.WithValues("genKind", genKind, "genAPIVersion", genAPIVersion, "genNamespace", genNamespace, "genName", genName)
|
||||
|
||||
|
||||
// build the resource template
|
||||
newResource := &unstructured.Unstructured{}
|
||||
newResource.SetUnstructuredContent(rdata)
|
||||
|
|
|
@ -303,7 +303,6 @@ func CreateJob(args []string, jobType, scope string) *v1.Job {
|
|||
Image: "evalsocket/kyverno-cli:latest",
|
||||
ImagePullPolicy: "Always",
|
||||
Args: args,
|
||||
|
||||
},
|
||||
},
|
||||
RestartPolicy: "OnFailure",
|
||||
|
|
|
@ -2,8 +2,8 @@ package policy
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"os"
|
||||
"reflect"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package policy
|
||||
|
||||
import (
|
||||
"github.com/nirmata/kyverno/pkg/jobs"
|
||||
informers "k8s.io/client-go/informers/core/v1"
|
||||
"os"
|
||||
"context"
|
||||
"time"
|
||||
"github.com/go-logr/logr"
|
||||
kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1"
|
||||
kyvernoclient "github.com/nirmata/kyverno/pkg/client/clientset/versioned"
|
||||
|
@ -16,6 +12,7 @@ import (
|
|||
"github.com/nirmata/kyverno/pkg/constant"
|
||||
client "github.com/nirmata/kyverno/pkg/dclient"
|
||||
"github.com/nirmata/kyverno/pkg/event"
|
||||
"github.com/nirmata/kyverno/pkg/jobs"
|
||||
"github.com/nirmata/kyverno/pkg/policyviolation"
|
||||
"github.com/nirmata/kyverno/pkg/webhookconfig"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
|
@ -23,11 +20,14 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
informers "k8s.io/client-go/informers/core/v1"
|
||||
typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
listerv1 "k8s.io/client-go/listers/core/v1"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/tools/record"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -166,11 +166,9 @@ func NewPolicyController(kyvernoClient *kyvernoclient.Clientset,
|
|||
DeleteFunc: pc.deleteNsPolicy,
|
||||
})
|
||||
|
||||
|
||||
pc.pLister = pInformer.Lister()
|
||||
pc.npLister = npInformer.Lister()
|
||||
|
||||
|
||||
pc.nsLister = namespaces.Lister()
|
||||
|
||||
pc.pListerSynced = pInformer.Informer().HasSynced
|
||||
|
@ -330,7 +328,6 @@ func (pc *PolicyController) Run(workers int, stopCh <-chan struct{}) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
for i := 0; i < workers; i++ {
|
||||
go wait.Until(pc.worker, constant.PolicyControllerResync, stopCh)
|
||||
}
|
||||
|
@ -437,7 +434,6 @@ func (pc *PolicyController) syncPolicy(key string) error {
|
|||
|
||||
pc.cleanupAndReport(engineResponses)
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue