@@ -61,6 +61,19 @@ message RunFunctionRequest {
61
61
// and that context will be passed to subsequent Functions. Crossplane
62
62
// discards all context returned by the last Function in the pipeline.
63
63
optional google.protobuf.Struct context = 5 ;
64
+
65
+ // Optional extra resources that the Function required.
66
+ // Note that extra resources is a map to Resources, plural.
67
+ // The map key corresponds to the key in a RunFunctionResponse's
68
+ // extra_resources field. If a Function requested extra resources that
69
+ // did not exist, Crossplane sets the map key to an empty Resources message to
70
+ // indicate that it attempted to satisfy the request.
71
+ map <string , Resources > extra_resources = 6 ;
72
+ }
73
+
74
+ // Resources represents the state of several Crossplane resources.
75
+ message Resources {
76
+ repeated Resource items = 1 ;
64
77
}
65
78
66
79
// A RunFunctionResponse contains the result of a Composition Function run.
@@ -88,6 +101,9 @@ message RunFunctionResponse {
88
101
// Optional context to be passed to the next Function in the pipeline as part
89
102
// of the RunFunctionRequest. Dropped on the last function in the pipeline.
90
103
optional google.protobuf.Struct context = 4 ;
104
+
105
+ // Requirements that must be satisfied for this Function to run successfully.
106
+ Requirements requirements = 5 ;
91
107
}
92
108
93
109
// RequestMeta contains metadata pertaining to a RunFunctionRequest.
@@ -97,6 +113,29 @@ message RequestMeta {
97
113
string tag = 1 ;
98
114
}
99
115
116
+ // Requirements that must be satisfied for a Function to run successfully.
117
+ message Requirements {
118
+ // Extra resources that this Function requires.
119
+ // The map key uniquely identifies the group of resources.
120
+ map <string , ResourceSelector > extra_resources = 1 ;
121
+ }
122
+
123
+ // ResourceSelector selects a group of resources, either by name or by label.
124
+ message ResourceSelector {
125
+ string api_version = 1 ;
126
+ string kind = 2 ;
127
+
128
+ oneof match {
129
+ string match_name = 3 ;
130
+ MatchLabels match_labels = 4 ;
131
+ }
132
+ }
133
+
134
+ // MatchLabels defines a set of labels to match resources against.
135
+ message MatchLabels {
136
+ map <string , string > labels = 1 ;
137
+ }
138
+
100
139
// ResponseMeta contains metadata pertaining to a RunFunctionResponse.
101
140
message ResponseMeta {
102
141
// An opaque string identifying the content of the request. Must match the
0 commit comments