@@ -23,6 +23,9 @@ import (
23
23
"k8s.io/client-go/restmapper"
24
24
)
25
25
26
+ // Deprecated: DynamicRESTMapper exists for historical compatibility
27
+ // and should not be used. See that it was implemented in the controller-runtime.
28
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
26
29
type DynamicRESTMapper struct {
27
30
client discovery.DiscoveryInterface
28
31
delegate meta.RESTMapper
@@ -32,6 +35,10 @@ type DynamicRESTMapper struct {
32
35
// types at runtime. This is in contrast to controller-manager's default RESTMapper, which
33
36
// only checks resource types at startup, and so can't handle the case of first creating a
34
37
// CRD and then creating an instance of that CRD.
38
+ //
39
+ // Deprecated: NewDynamicRESTMapper exists for historical compatibility
40
+ // and should not be used. See that it was implemented in the controller-runtime.
41
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
35
42
func NewDynamicRESTMapper (cfg * rest.Config ) (meta.RESTMapper , error ) {
36
43
client , err := discovery .NewDiscoveryClientForConfig (cfg )
37
44
if err != nil {
@@ -67,6 +74,9 @@ func (drm *DynamicRESTMapper) reloadOnError(err error) bool {
67
74
return err == nil
68
75
}
69
76
77
+ // Deprecated: KindFor exists for historical compatibility
78
+ // and should not be used. See that it was implemented in the controller-runtime.
79
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
70
80
func (drm * DynamicRESTMapper ) KindFor (resource schema.GroupVersionResource ) (schema.GroupVersionKind , error ) {
71
81
gvk , err := drm .delegate .KindFor (resource )
72
82
if drm .reloadOnError (err ) {
@@ -75,6 +85,9 @@ func (drm *DynamicRESTMapper) KindFor(resource schema.GroupVersionResource) (sch
75
85
return gvk , err
76
86
}
77
87
88
+ // Deprecated: KindsFor exists for historical compatibility
89
+ // and should not be used. See that it was implemented in the controller-runtime.
90
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
78
91
func (drm * DynamicRESTMapper ) KindsFor (resource schema.GroupVersionResource ) ([]schema.GroupVersionKind , error ) {
79
92
gvks , err := drm .delegate .KindsFor (resource )
80
93
if drm .reloadOnError (err ) {
@@ -83,6 +96,9 @@ func (drm *DynamicRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]
83
96
return gvks , err
84
97
}
85
98
99
+ // Deprecated: ResourceFor exists for historical compatibility
100
+ // and should not be used. See that it was implemented in the controller-runtime.
101
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
86
102
func (drm * DynamicRESTMapper ) ResourceFor (input schema.GroupVersionResource ) (schema.GroupVersionResource , error ) {
87
103
gvr , err := drm .delegate .ResourceFor (input )
88
104
if drm .reloadOnError (err ) {
@@ -91,6 +107,9 @@ func (drm *DynamicRESTMapper) ResourceFor(input schema.GroupVersionResource) (sc
91
107
return gvr , err
92
108
}
93
109
110
+ // Deprecated: ResourcesFor exists for historical compatibility
111
+ // and should not be used. See that it was implemented in the controller-runtime.
112
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
94
113
func (drm * DynamicRESTMapper ) ResourcesFor (input schema.GroupVersionResource ) ([]schema.GroupVersionResource , error ) {
95
114
gvrs , err := drm .delegate .ResourcesFor (input )
96
115
if drm .reloadOnError (err ) {
@@ -99,6 +118,9 @@ func (drm *DynamicRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([
99
118
return gvrs , err
100
119
}
101
120
121
+ // Deprecated: RESTMapping exists for historical compatibility
122
+ // and should not be used. See that it was implemented in the controller-runtime.
123
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
102
124
func (drm * DynamicRESTMapper ) RESTMapping (gk schema.GroupKind , versions ... string ) (* meta.RESTMapping , error ) {
103
125
m , err := drm .delegate .RESTMapping (gk , versions ... )
104
126
if drm .reloadOnError (err ) {
@@ -107,6 +129,9 @@ func (drm *DynamicRESTMapper) RESTMapping(gk schema.GroupKind, versions ...strin
107
129
return m , err
108
130
}
109
131
132
+ // Deprecated: RESTMappings exists for historical compatibility
133
+ // and should not be used. See that it was implemented in the controller-runtime.
134
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
110
135
func (drm * DynamicRESTMapper ) RESTMappings (gk schema.GroupKind , versions ... string ) ([]* meta.RESTMapping , error ) {
111
136
ms , err := drm .delegate .RESTMappings (gk , versions ... )
112
137
if drm .reloadOnError (err ) {
@@ -115,6 +140,9 @@ func (drm *DynamicRESTMapper) RESTMappings(gk schema.GroupKind, versions ...stri
115
140
return ms , err
116
141
}
117
142
143
+ // Deprecated: ResourceSingularizer exists for historical compatibility
144
+ // and should not be used. See that it was implemented in the controller-runtime.
145
+ // More info: https://github.com/kubernetes-sigs/controller-runtime/pull/554
118
146
func (drm * DynamicRESTMapper ) ResourceSingularizer (resource string ) (singular string , err error ) {
119
147
s , err := drm .delegate .ResourceSingularizer (resource )
120
148
if drm .reloadOnError (err ) {
0 commit comments