@@ -811,13 +811,13 @@ type fakeImageReactor struct {
811
811
err error
812
812
}
813
813
814
- type imageReactorFunc func (obj interface {} , tagRetriever trigger.TagRetriever ) error
814
+ type imageReactorFunc func (obj runtime. Object , tagRetriever trigger.TagRetriever ) error
815
815
816
- func (fn imageReactorFunc ) ImageChanged (obj interface {} , tagRetriever trigger.TagRetriever ) error {
816
+ func (fn imageReactorFunc ) ImageChanged (obj runtime. Object , tagRetriever trigger.TagRetriever ) error {
817
817
return fn (obj , tagRetriever )
818
818
}
819
819
820
- func (r * fakeImageReactor ) ImageChanged (obj interface {} , tagRetriever trigger.TagRetriever ) error {
820
+ func (r * fakeImageReactor ) ImageChanged (obj runtime. Object , tagRetriever trigger.TagRetriever ) error {
821
821
r .lock .Lock ()
822
822
defer r .lock .Unlock ()
823
823
err := r .err
@@ -972,10 +972,9 @@ func updateBuildConfigImages(bc *buildapi.BuildConfig, tagRetriever trigger.TagR
972
972
// alterBuildConfigFromTriggers will alter the incoming build config based on the trigger
973
973
// changes passed to it and send it back on the watch as a modification.
974
974
func alterBuildConfigFromTriggers (bcWatch * consistentWatch ) imageReactorFunc {
975
- return imageReactorFunc (func (obj interface {}, tagRetriever trigger.TagRetriever ) error {
976
- bc := obj .DeepCopy ()
977
-
978
- updated , err := updateBuildConfigImages (bc , tagRetriever )
975
+ return imageReactorFunc (func (obj runtime.Object , tagRetriever trigger.TagRetriever ) error {
976
+ bc := obj .DeepCopyObject ()
977
+ updated , err := updateBuildConfigImages (bc .(* buildapi.BuildConfig ), tagRetriever )
979
978
if err != nil {
980
979
return err
981
980
}
@@ -987,9 +986,9 @@ func alterBuildConfigFromTriggers(bcWatch *consistentWatch) imageReactorFunc {
987
986
}
988
987
989
988
func alterDeploymentConfigFromTriggers (dcWatch * consistentWatch ) imageReactorFunc {
990
- return imageReactorFunc (func (obj interface {} , tagRetriever trigger.TagRetriever ) error {
991
- dc := obj .DeepCopy ()
992
- updated , resolvable , err := deploymentconfigs .UpdateDeploymentConfigImages (dc , tagRetriever )
989
+ return imageReactorFunc (func (obj runtime. Object , tagRetriever trigger.TagRetriever ) error {
990
+ dc := obj .DeepCopyObject ()
991
+ updated , resolvable , err := deploymentconfigs .UpdateDeploymentConfigImages (dc .( * deployapi. DeploymentConfig ) , tagRetriever )
993
992
if err != nil {
994
993
return err
995
994
}
@@ -1004,10 +1003,10 @@ func alterDeploymentConfigFromTriggers(dcWatch *consistentWatch) imageReactorFun
1004
1003
// changes passed to it and send it back on the watch as a modification.
1005
1004
func alterPodFromTriggers (podWatch * watch.RaceFreeFakeWatcher ) imageReactorFunc {
1006
1005
count := 2
1007
- return imageReactorFunc (func (obj interface {} , tagRetriever trigger.TagRetriever ) error {
1008
- pod := obj .DeepCopy ()
1006
+ return imageReactorFunc (func (obj runtime. Object , tagRetriever trigger.TagRetriever ) error {
1007
+ pod := obj .DeepCopyObject ()
1009
1008
1010
- updated , err := annotations .UpdateObjectFromImages (pod , kapi .Scheme , tagRetriever )
1009
+ updated , err := annotations .UpdateObjectFromImages (pod .( * kapi. Pod ) , kapi .Scheme , tagRetriever )
1011
1010
if err != nil {
1012
1011
return err
1013
1012
}
@@ -1224,7 +1223,8 @@ func TestTriggerController(t *testing.T) {
1224
1223
if len (items ) == 0 {
1225
1224
continue
1226
1225
}
1227
- bc := items [rnd .Int31n (int32 (len (items )))].DeepCopy ()
1226
+ originalBc := items [rnd .Int31n (int32 (len (items )))].(* buildapi.BuildConfig )
1227
+ bc := originalBc .DeepCopy ()
1228
1228
if len (bc .Spec .Triggers ) > 0 {
1229
1229
index := rnd .Int31n (int32 (len (bc .Spec .Triggers )))
1230
1230
trigger := & bc .Spec .Triggers [index ]
0 commit comments