Debian Codegraph @

pkg/admission/util.go

raw
1 /*
2 Copyright 2019 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package admission
18
19 import "k8s.io/apimachinery/pkg/runtime"
20
21 type RuntimeObjectInterfaces struct {
22 runtime.ObjectCreater
23 runtime.ObjectTyper
24 runtime.ObjectDefaulter
25 runtime.ObjectConvertor
26 runtime.EquivalentResourceMapper
27 }
28
29 func NewObjectInterfacesFromScheme(scheme *runtime.Scheme) ObjectInterfaces {
30 return &RuntimeObjectInterfaces{scheme, scheme, scheme, scheme, runtime.NewEquivalentResourceRegistry()}
31 }
32
33 func (r *RuntimeObjectInterfaces) GetObjectCreater() runtime.ObjectCreater {
34 return r.ObjectCreater
35 }
36 func (r *RuntimeObjectInterfaces) GetObjectTyper() runtime.ObjectTyper {
37 return r.ObjectTyper
38 }
39 func (r *RuntimeObjectInterfaces) GetObjectDefaulter() runtime.ObjectDefaulter {
40 return r.ObjectDefaulter
41 }
42 func (r *RuntimeObjectInterfaces) GetObjectConvertor() runtime.ObjectConvertor {
43 return r.ObjectConvertor
44 }
45 func (r *RuntimeObjectInterfaces) GetEquivalentResourceMapper() runtime.EquivalentResourceMapper {
46 return r.EquivalentResourceMapper
47 }