Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ad230812
Commit
ad230812
authored
Jul 06, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audit: fix deepcopy registration
parent
954c356d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
35 deletions
+15
-35
doc.go
staging/src/k8s.io/apiserver/pkg/apis/audit/doc.go
+1
-1
register.go
staging/src/k8s.io/apiserver/pkg/apis/audit/register.go
+1
-0
zz_generated.deepcopy.go
.../k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go
+12
-17
webhook.go
.../src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go
+1
-17
No files found.
staging/src/k8s.io/apiserver/pkg/apis/audit/doc.go
View file @
ad230812
...
...
@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:deepcopy-gen=package
,register
// +k8s:deepcopy-gen=package
// +groupName=audit.k8s.io
package
audit
// import "k8s.io/apiserver/pkg/apis/audit"
staging/src/k8s.io/apiserver/pkg/apis/audit/register.go
View file @
ad230812
...
...
@@ -49,5 +49,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&
Policy
{},
&
PolicyList
{},
)
scheme
.
AddGeneratedDeepCopyFuncs
(
GetGeneratedDeepCopyFuncs
()
...
)
return
nil
}
staging/src/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go
View file @
ad230812
...
...
@@ -27,23 +27,18 @@ import (
reflect
"reflect"
)
func
init
()
{
SchemeBuilder
.
Register
(
RegisterDeepCopies
)
}
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
// to allow building arbitrary schemes.
func
RegisterDeepCopies
(
scheme
*
runtime
.
Scheme
)
error
{
return
scheme
.
AddGeneratedDeepCopyFuncs
(
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_Event
,
InType
:
reflect
.
TypeOf
(
&
Event
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_EventList
,
InType
:
reflect
.
TypeOf
(
&
EventList
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_GroupResources
,
InType
:
reflect
.
TypeOf
(
&
GroupResources
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_ObjectReference
,
InType
:
reflect
.
TypeOf
(
&
ObjectReference
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_Policy
,
InType
:
reflect
.
TypeOf
(
&
Policy
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_PolicyList
,
InType
:
reflect
.
TypeOf
(
&
PolicyList
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_PolicyRule
,
InType
:
reflect
.
TypeOf
(
&
PolicyRule
{})},
conversion
.
GeneratedDeepCopyFunc
{
Fn
:
DeepCopy_audit_UserInfo
,
InType
:
reflect
.
TypeOf
(
&
UserInfo
{})},
)
// GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
func
GetGeneratedDeepCopyFuncs
()
[]
conversion
.
GeneratedDeepCopyFunc
{
return
[]
conversion
.
GeneratedDeepCopyFunc
{
{
Fn
:
DeepCopy_audit_Event
,
InType
:
reflect
.
TypeOf
(
&
Event
{})},
{
Fn
:
DeepCopy_audit_EventList
,
InType
:
reflect
.
TypeOf
(
&
EventList
{})},
{
Fn
:
DeepCopy_audit_GroupResources
,
InType
:
reflect
.
TypeOf
(
&
GroupResources
{})},
{
Fn
:
DeepCopy_audit_ObjectReference
,
InType
:
reflect
.
TypeOf
(
&
ObjectReference
{})},
{
Fn
:
DeepCopy_audit_Policy
,
InType
:
reflect
.
TypeOf
(
&
Policy
{})},
{
Fn
:
DeepCopy_audit_PolicyList
,
InType
:
reflect
.
TypeOf
(
&
PolicyList
{})},
{
Fn
:
DeepCopy_audit_PolicyRule
,
InType
:
reflect
.
TypeOf
(
&
PolicyRule
{})},
{
Fn
:
DeepCopy_audit_UserInfo
,
InType
:
reflect
.
TypeOf
(
&
UserInfo
{})},
}
}
// DeepCopy_audit_Event is an autogenerated deepcopy function.
...
...
staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go
View file @
ad230812
...
...
@@ -19,7 +19,6 @@ package webhook
import
(
"fmt"
"reflect"
"strings"
"time"
...
...
@@ -136,20 +135,6 @@ func (b *blockingBackend) processEvents(ev ...*auditinternal.Event) error {
return
b
.
w
.
RestClient
.
Post
()
.
Body
(
&
list
)
.
Do
()
.
Error
()
}
// Copied from generated code in k8s.io/apiserver/pkg/apis/audit.
//
// TODO(ericchiang): Have the generated code expose these methods like metav1.GetGeneratedDeepCopyFuncs().
var
auditDeepCopyFuncs
=
[]
conversion
.
GeneratedDeepCopyFunc
{
{
Fn
:
auditinternal
.
DeepCopy_audit_Event
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
Event
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_EventList
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
EventList
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_GroupResources
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
GroupResources
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_ObjectReference
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
ObjectReference
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_Policy
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
Policy
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_PolicyList
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
PolicyList
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_PolicyRule
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
PolicyRule
{})},
{
Fn
:
auditinternal
.
DeepCopy_audit_UserInfo
,
InType
:
reflect
.
TypeOf
(
&
auditinternal
.
UserInfo
{})},
}
func
newBatchWebhook
(
configFile
string
)
(
*
batchBackend
,
error
)
{
w
,
err
:=
loadWebhook
(
configFile
)
if
err
!=
nil
{
...
...
@@ -162,8 +147,7 @@ func newBatchWebhook(configFile string) (*batchBackend, error) {
return
nil
,
fmt
.
Errorf
(
"registering meta deep copy method: %v"
,
err
)
}
}
for
_
,
f
:=
range
auditDeepCopyFuncs
{
for
_
,
f
:=
range
auditinternal
.
GetGeneratedDeepCopyFuncs
()
{
if
err
:=
c
.
RegisterGeneratedDeepCopyFunc
(
f
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"registering audit deep copy method: %v"
,
err
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment