@@ -26,17 +26,8 @@ import (
26
26
27
27
"sigs.k8s.io/controller-runtime/pkg/cache"
28
28
"sigs.k8s.io/controller-runtime/pkg/client"
29
- logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
30
29
)
31
30
32
- // log is specifically to add a warning message for injectors.
33
- var log = logf .RuntimeLog .WithName ("injectors-warning" )
34
-
35
- // logWarningMsg logs a warning message if inject is used
36
- func logWarningMsg () {
37
- log .Info ("Injectors are deprecated, and will be removed in v0.10.x" )
38
- }
39
-
40
31
// Cache is used by the ControllerManager to inject Cache into Sources, EventHandlers, Predicates, and
41
32
// Reconciles
42
33
type Cache interface {
@@ -47,7 +38,6 @@ type Cache interface {
47
38
// false if i does not implement Cache.
48
39
func CacheInto (c cache.Cache , i interface {}) (bool , error ) {
49
40
if s , ok := i .(Cache ); ok {
50
- logWarningMsg ()
51
41
return true , s .InjectCache (c )
52
42
}
53
43
return false , nil
@@ -62,7 +52,6 @@ type APIReader interface {
62
52
// Returns false if i does not implement APIReader
63
53
func APIReaderInto (reader client.Reader , i interface {}) (bool , error ) {
64
54
if s , ok := i .(APIReader ); ok {
65
- logWarningMsg ()
66
55
return true , s .InjectAPIReader (reader )
67
56
}
68
57
return false , nil
@@ -78,7 +67,6 @@ type Config interface {
78
67
// false if i does not implement Config.
79
68
func ConfigInto (config * rest.Config , i interface {}) (bool , error ) {
80
69
if s , ok := i .(Config ); ok {
81
- logWarningMsg ()
82
70
return true , s .InjectConfig (config )
83
71
}
84
72
return false , nil
@@ -94,7 +82,6 @@ type Client interface {
94
82
// false if i does not implement Client.
95
83
func ClientInto (client client.Client , i interface {}) (bool , error ) {
96
84
if s , ok := i .(Client ); ok {
97
- logWarningMsg ()
98
85
return true , s .InjectClient (client )
99
86
}
100
87
return false , nil
@@ -110,7 +97,6 @@ type Scheme interface {
110
97
// false if i does not implement Scheme.
111
98
func SchemeInto (scheme * runtime.Scheme , i interface {}) (bool , error ) {
112
99
if is , ok := i .(Scheme ); ok {
113
- logWarningMsg ()
114
100
return true , is .InjectScheme (scheme )
115
101
}
116
102
return false , nil
@@ -126,7 +112,6 @@ type Stoppable interface {
126
112
// Returns false if i does not implement Stoppable.
127
113
func StopChannelInto (stop <- chan struct {}, i interface {}) (bool , error ) {
128
114
if s , ok := i .(Stoppable ); ok {
129
- logWarningMsg ()
130
115
return true , s .InjectStopChannel (stop )
131
116
}
132
117
return false , nil
@@ -141,7 +126,6 @@ type Mapper interface {
141
126
// Returns false if i does not implement Mapper.
142
127
func MapperInto (mapper meta.RESTMapper , i interface {}) (bool , error ) {
143
128
if m , ok := i .(Mapper ); ok {
144
- logWarningMsg ()
145
129
return true , m .InjectMapper (mapper )
146
130
}
147
131
return false , nil
@@ -159,7 +143,6 @@ type Injector interface {
159
143
// false if i does not implement Injector.
160
144
func InjectorInto (f Func , i interface {}) (bool , error ) {
161
145
if ii , ok := i .(Injector ); ok {
162
- logWarningMsg ()
163
146
return true , ii .InjectFunc (f )
164
147
}
165
148
return false , nil
@@ -175,7 +158,6 @@ type Logger interface {
175
158
// returning true if a InjectLogger was called, and false otherwise.
176
159
func LoggerInto (l logr.Logger , i interface {}) (bool , error ) {
177
160
if injectable , wantsLogger := i .(Logger ); wantsLogger {
178
- logWarningMsg ()
179
161
return true , injectable .InjectLogger (l )
180
162
}
181
163
return false , nil
0 commit comments