Skip to content

Commit 711fad0

Browse files
committed
Keep extra_resources support at the proto level
We still add required_resources though, as the new (preferred) way to do the same thing. Signed-off-by: Nic Cope <[email protected]>
1 parent 12be880 commit 711fad0

File tree

6 files changed

+233
-137
lines changed

6 files changed

+233
-137
lines changed

crossplane/function/proto/v1/run_function.proto

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package apiextensions.fn.proto.v1;
2727
import "google/protobuf/duration.proto";
2828
import "google/protobuf/struct.proto";
2929

30-
option go_package = "github.com/crossplane/crossplane/proto/fn/v1";
30+
option go_package = "github.com/crossplane/crossplane/v2/proto/fn/v1";
3131

3232
// A FunctionRunnerService is a function.
3333
service FunctionRunnerService {
@@ -69,15 +69,27 @@ message RunFunctionRequest {
6969

7070
// Optional resources that the function specified in its requirements. Note
7171
// that resources is a map to Resources, plural. The map key corresponds to
72-
// the key in a RunFunctionResponse's requirements.resources field. If a
73-
// function requested required resources that did not exist, Crossplane sets
72+
// the key in a RunFunctionResponse's requirements.extra_resources field. If a
73+
// function requested extra resources that did not exist, Crossplane sets
7474
// the map key to an empty Resources message to indicate that it attempted to
75-
// satisfy the request.
76-
map<string, Resources> required_resources = 6;
75+
// satisfy the request. This field is only populated when the function uses
76+
// extra_resources in its requirements.
77+
//
78+
// Deprecated: Use required_resources instead.
79+
map<string, Resources> extra_resources = 6 [deprecated = true];
7780

7881
// Optional credentials that this function may use to communicate with an
7982
// external system.
8083
map<string, Credentials> credentials = 7;
84+
85+
// Optional resources that the function specified in its requirements. Note
86+
// that resources is a map to Resources, plural. The map key corresponds to
87+
// the key in a RunFunctionResponse's requirements.resources field. If a
88+
// function requested required resources that did not exist, Crossplane sets
89+
// the map key to an empty Resources message to indicate that it attempted to
90+
// satisfy the request. This field is only populated when the function uses
91+
// resources in its requirements.
92+
map<string, Resources> required_resources = 8;
8193
}
8294

8395
// Credentials that a function may use to communicate with an external system.
@@ -150,7 +162,13 @@ message RequestMeta {
150162
message Requirements {
151163
// Resources that this function requires. The map key uniquely identifies the
152164
// group of resources.
153-
map<string, ResourceSelector> resources = 1;
165+
//
166+
// Deprecated: Use resources instead.
167+
map<string, ResourceSelector> extra_resources = 1 [deprecated = true];
168+
169+
// Resources that this function requires. The map key uniquely identifies the
170+
// group of resources.
171+
map<string, ResourceSelector> resources = 2;
154172
}
155173

156174
// ResourceSelector selects a group of resources, either by name or by label.
@@ -349,4 +367,4 @@ enum Status {
349367
STATUS_CONDITION_TRUE = 2;
350368

351369
STATUS_CONDITION_FALSE = 3;
352-
}
370+
}

0 commit comments

Comments
 (0)