Skip to content

Commit 7bac463

Browse files
committed
Add initial support for conditions
1 parent 4bebc4a commit 7bac463

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crossplane-function-base/src/main/java/io/crossplane/compositefunctions/base/CrossplaneCompositeFunctionBase.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ public void runFunction(RunFunctionRequest request, StreamObserver<RunFunctionRe
5454
responseBuilder.setRequirements(requirements);
5555
}
5656

57-
5857
if (! crossplaneFunctionResponse.results().isEmpty()) {
5958
responseBuilder.addAllResults(crossplaneFunctionResponse.results());
6059
}
6160

61+
if (! crossplaneFunctionResponse.conditions().isEmpty()) {
62+
responseBuilder.addAllConditions(crossplaneFunctionResponse.conditions());
63+
}
64+
6265
if (desiredBuilder.getResourcesCount() > 0) {
6366
responseBuilder.setDesired(desiredBuilder.build());
6467
}

crossplane-function-base/src/main/java/io/crossplane/compositefunctions/base/CrossplaneFunctionResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.crossplane.compositefunctions.base;
22

3+
import io.crossplane.compositefunctions.protobuf.v1.Condition;
34
import io.crossplane.compositefunctions.protobuf.v1.ResourceSelector;
45
import io.crossplane.compositefunctions.protobuf.v1.Result;
56

@@ -16,7 +17,7 @@
1617
*/
1718
public record CrossplaneFunctionResponse(Map<String, Object> desiredResources,
1819
Map<String, ResourceSelector> resourceSelectors,
19-
List<Result> results) {
20+
List<Result> results, List<Condition> conditions) {
2021

2122
//
2223
//
@@ -26,6 +27,6 @@ public record CrossplaneFunctionResponse(Map<String, Object> desiredResources,
2627
* Create an empty response with all fields initiated
2728
*/
2829
public CrossplaneFunctionResponse() {
29-
this(new HashMap<>(), new HashMap<>(), new ArrayList<>());
30+
this(new HashMap<>(), new HashMap<>(), new ArrayList<>(), new ArrayList<>());
3031
}
3132
}

0 commit comments

Comments
 (0)