@@ -148,6 +148,9 @@ func (f *Function) RunFunction(ctx context.Context, req *fnv1beta1.RunFunctionRe
148
148
// composed resource.
149
149
existing := 0
150
150
151
+ // Increments this for each resource template that has been skipped
152
+ skipped := 0
153
+
151
154
for _ , t := range cts {
152
155
log := log .WithValues ("resource-template-name" , t .Name )
153
156
log .Debug ("Processing resource template" )
@@ -258,6 +261,7 @@ func (f *Function) RunFunction(ctx context.Context, req *fnv1beta1.RunFunctionRe
258
261
// Skip adding this resource to the desired state because it doesn't
259
262
// exist yet, and a required FromFieldPath was not (yet) found.
260
263
if skip {
264
+ skipped ++
261
265
continue
262
266
}
263
267
@@ -269,6 +273,10 @@ func (f *Function) RunFunction(ctx context.Context, req *fnv1beta1.RunFunctionRe
269
273
return rsp , nil
270
274
}
271
275
276
+ if skipped > 0 {
277
+ rsp .GetDesired ().GetComposite ().Ready = fnv1beta1 .Ready_READY_FALSE
278
+ }
279
+
272
280
if err := response .SetDesiredComposedResources (rsp , desired ); err != nil {
273
281
response .Fatal (rsp , errors .Wrapf (err , "cannot set desired composed resources in %T" , rsp ))
274
282
return rsp , nil
@@ -284,7 +292,9 @@ func (f *Function) RunFunction(ctx context.Context, req *fnv1beta1.RunFunctionRe
284
292
log .Info ("Successfully processed patch-and-transform resources" ,
285
293
"resource-templates" , len (input .Resources ),
286
294
"existing-resources" , existing ,
287
- "warnings" , warnings )
295
+ "warnings" , warnings ,
296
+ "skipped" , skipped ,
297
+ )
288
298
289
299
return rsp , nil
290
300
}
0 commit comments