Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/nirmata/kyverno
  • Loading branch information
realshuting committed Feb 22, 2020
2 parents 24a7563 + d171f0e commit 07cb81f
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 1,028 deletions.
9 changes: 0 additions & 9 deletions cmd/cli/kubectl-kyverno/main.go

This file was deleted.

20 changes: 0 additions & 20 deletions cmd/kyverno/main.go
Expand Up @@ -5,10 +5,6 @@ import (
"flag"
"time"

"github.com/nirmata/kyverno/pkg/openapi"

"k8s.io/client-go/discovery"

"github.com/golang/glog"
"github.com/nirmata/kyverno/pkg/checker"
kyvernoclient "github.com/nirmata/kyverno/pkg/client/clientset/versioned"
Expand Down Expand Up @@ -204,22 +200,6 @@ func main() {
glog.Fatalf("Failed registering Admission Webhooks: %v\n", err)
}

// OpenAPI document
// Getting openApi document from kubernetes and overriding default openapi document
restClient, err := discovery.NewDiscoveryClientForConfig(clientConfig)
if err != nil {
glog.Fatalf("Could not get rest client to get openApi doc: %v\n", err)
}

openApiDoc, err := restClient.RESTClient().Get().RequestURI("/openapi/v2").Do().Raw()
if err != nil {
glog.Fatalf("OpenApiDoc request failed: %v\n", err)
}

if err := openapi.UseCustomOpenApiDocument(openApiDoc); err != nil {
glog.Fatalf("Could not set custom OpenApi document: %v\n", err)
}

// WEBHOOOK
// - https server to provide endpoints called based on rules defined in Mutating & Validation webhook configuration
// - reports the results based on the response from the policy engine:
Expand Down
5 changes: 4 additions & 1 deletion definitions/install.yaml
Expand Up @@ -627,6 +627,9 @@ rules:
- configmaps
- resourcequotas
- limitranges
- clusterroles
- rolebindings
- clusterrolebindings
verbs:
- create
- update
Expand All @@ -639,7 +642,7 @@ rules:
resources:
- namespaces
verbs:
- watch
- watch
---
apiVersion: v1
kind: ConfigMap
Expand Down
2 changes: 1 addition & 1 deletion documentation/installation.md
Expand Up @@ -124,7 +124,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kyvernoRoleGenerate # clusterRole defined above, to manage generated resources
name: kyverno:generatecontroller # clusterRole defined above, to manage generated resources
subjects:
- kind: ServiceAccount
name: kyverno-service-account # default kyverno serviceAccount
Expand Down

0 comments on commit 07cb81f

Please sign in to comment.