Skip to content

Commit

Permalink
Add support for audit v1 events
Browse files Browse the repository at this point in the history
  • Loading branch information
liggitt committed Oct 25, 2018
1 parent 84ae024 commit e448a40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/audit2rbac/audit2rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func NewAudit2RBACCommand(stdout, stderr io.Writer) *cobra.Command {

type Audit2RBACOptions struct {
// AuditSources is a list of files, URLs or - for STDIN.
// Format must be JSON event.v1alpha1.audit.k8s.io or event.v1beta1.audit.k8s.io objects, one per line
// Format must be JSON event.v1alpha1.audit.k8s.io, event.v1beta1.audit.k8s.io, event.v1.audit.k8s.io objects, one per line
AuditSources []string

// ExistingObjectFiles is a list of files or URLs.
Expand Down
4 changes: 4 additions & 0 deletions pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer/json"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/apis/audit"
auditv1 "k8s.io/apiserver/pkg/apis/audit/v1"
auditv1alpha1 "k8s.io/apiserver/pkg/apis/audit/v1alpha1"
auditv1beta1 "k8s.io/apiserver/pkg/apis/audit/v1beta1"
"k8s.io/apiserver/pkg/authentication/serviceaccount"
Expand Down Expand Up @@ -187,6 +188,9 @@ func init() {
panic(err)
}

if err := auditv1.AddToScheme(Scheme); err != nil {
panic(err)
}
if err := auditv1beta1.AddToScheme(Scheme); err != nil {
panic(err)
}
Expand Down

0 comments on commit e448a40

Please sign in to comment.