7
7
"strconv"
8
8
"strings"
9
9
10
+ "github.com/golang/glog"
11
+
10
12
"k8s.io/apimachinery/pkg/api/meta"
11
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
14
"k8s.io/apimachinery/pkg/runtime"
@@ -125,12 +127,14 @@ func UpdateObjectFromImages(obj runtime.Object, copier runtime.ObjectCopier, tag
125
127
if err != nil {
126
128
return nil , err
127
129
}
130
+ glog .V (5 ).Infof ("%T/%s has triggers: %#v" , obj , m .GetName (), triggers )
128
131
for _ , trigger := range triggers {
129
132
if trigger .Paused {
130
133
continue
131
134
}
132
135
fieldPath := trigger .FieldPath
133
136
if ! strings .HasPrefix (trigger .FieldPath , basePath ) {
137
+ glog .V (5 ).Infof ("%T/%s trigger %s did not match base path %s" , obj , m .GetName (), trigger .FieldPath , basePath )
134
138
continue
135
139
}
136
140
fieldPath = strings .TrimPrefix (fieldPath , basePath )
@@ -141,6 +145,7 @@ func UpdateObjectFromImages(obj runtime.Object, copier runtime.ObjectCopier, tag
141
145
}
142
146
ref , _ , ok := tagRetriever .ImageStreamTag (namespace , trigger .From .Name )
143
147
if ! ok {
148
+ glog .V (5 ).Infof ("%T/%s detected no pending image on %s from %#v" , obj , m .GetName (), trigger .FieldPath , trigger .From )
144
149
continue
145
150
}
146
151
@@ -163,6 +168,7 @@ func UpdateObjectFromImages(obj runtime.Object, copier runtime.ObjectCopier, tag
163
168
spec , _ = ometa .GetPodSpecReferenceMutator (updated )
164
169
container , _ = findContainerBySelector (spec , init , selector )
165
170
}
171
+ glog .V (5 ).Infof ("%T/%s detected change on %s = %s" , obj , m .GetName (), trigger .FieldPath , ref )
166
172
container .SetImage (ref )
167
173
}
168
174
}
0 commit comments