@@ -26,17 +26,8 @@ import (
2626
2727 "sigs.k8s.io/controller-runtime/pkg/cache"
2828 "sigs.k8s.io/controller-runtime/pkg/client"
29- logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
3029)
3130
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-
4031// Cache is used by the ControllerManager to inject Cache into Sources, EventHandlers, Predicates, and
4132// Reconciles
4233type Cache interface {
@@ -47,7 +38,6 @@ type Cache interface {
4738// false if i does not implement Cache.
4839func CacheInto (c cache.Cache , i interface {}) (bool , error ) {
4940 if s , ok := i .(Cache ); ok {
50- logWarningMsg ()
5141 return true , s .InjectCache (c )
5242 }
5343 return false , nil
@@ -62,7 +52,6 @@ type APIReader interface {
6252// Returns false if i does not implement APIReader
6353func APIReaderInto (reader client.Reader , i interface {}) (bool , error ) {
6454 if s , ok := i .(APIReader ); ok {
65- logWarningMsg ()
6655 return true , s .InjectAPIReader (reader )
6756 }
6857 return false , nil
@@ -78,7 +67,6 @@ type Config interface {
7867// false if i does not implement Config.
7968func ConfigInto (config * rest.Config , i interface {}) (bool , error ) {
8069 if s , ok := i .(Config ); ok {
81- logWarningMsg ()
8270 return true , s .InjectConfig (config )
8371 }
8472 return false , nil
@@ -94,7 +82,6 @@ type Client interface {
9482// false if i does not implement Client.
9583func ClientInto (client client.Client , i interface {}) (bool , error ) {
9684 if s , ok := i .(Client ); ok {
97- logWarningMsg ()
9885 return true , s .InjectClient (client )
9986 }
10087 return false , nil
@@ -110,7 +97,6 @@ type Scheme interface {
11097// false if i does not implement Scheme.
11198func SchemeInto (scheme * runtime.Scheme , i interface {}) (bool , error ) {
11299 if is , ok := i .(Scheme ); ok {
113- logWarningMsg ()
114100 return true , is .InjectScheme (scheme )
115101 }
116102 return false , nil
@@ -126,7 +112,6 @@ type Stoppable interface {
126112// Returns false if i does not implement Stoppable.
127113func StopChannelInto (stop <- chan struct {}, i interface {}) (bool , error ) {
128114 if s , ok := i .(Stoppable ); ok {
129- logWarningMsg ()
130115 return true , s .InjectStopChannel (stop )
131116 }
132117 return false , nil
@@ -141,7 +126,6 @@ type Mapper interface {
141126// Returns false if i does not implement Mapper.
142127func MapperInto (mapper meta.RESTMapper , i interface {}) (bool , error ) {
143128 if m , ok := i .(Mapper ); ok {
144- logWarningMsg ()
145129 return true , m .InjectMapper (mapper )
146130 }
147131 return false , nil
@@ -159,7 +143,6 @@ type Injector interface {
159143// false if i does not implement Injector.
160144func InjectorInto (f Func , i interface {}) (bool , error ) {
161145 if ii , ok := i .(Injector ); ok {
162- logWarningMsg ()
163146 return true , ii .InjectFunc (f )
164147 }
165148 return false , nil
@@ -175,7 +158,6 @@ type Logger interface {
175158// returning true if a InjectLogger was called, and false otherwise.
176159func LoggerInto (l logr.Logger , i interface {}) (bool , error ) {
177160 if injectable , wantsLogger := i .(Logger ); wantsLogger {
178- logWarningMsg ()
179161 return true , injectable .InjectLogger (l )
180162 }
181163 return false , nil
0 commit comments