Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions crossplane/function/proto/v1beta1/run_function.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ message RunFunctionRequest {
// and that context will be passed to subsequent Functions. Crossplane
// discards all context returned by the last Function in the pipeline.
optional google.protobuf.Struct context = 5;

// Optional extra resources that the Function required.
// Note that extra resources is a map to Resources, plural.
// The map key corresponds to the key in a RunFunctionResponse's
// extra_resources field. If a Function requested extra resources that
// did not exist, Crossplane sets the map key to an empty Resources message to
// indicate that it attempted to satisfy the request.
map<string, Resources> extra_resources = 6;
}

// Resources represents the state of several Crossplane resources.
message Resources {
repeated Resource items = 1;
}

// A RunFunctionResponse contains the result of a Composition Function run.
Expand Down Expand Up @@ -88,6 +101,9 @@ message RunFunctionResponse {
// Optional context to be passed to the next Function in the pipeline as part
// of the RunFunctionRequest. Dropped on the last function in the pipeline.
optional google.protobuf.Struct context = 4;

// Requirements that must be satisfied for this Function to run successfully.
Requirements requirements = 5;
}

// RequestMeta contains metadata pertaining to a RunFunctionRequest.
Expand All @@ -97,6 +113,29 @@ message RequestMeta {
string tag = 1;
}

// Requirements that must be satisfied for a Function to run successfully.
message Requirements {
// Extra resources that this Function requires.
// The map key uniquely identifies the group of resources.
map<string, ResourceSelector> extra_resources = 1;
}

// ResourceSelector selects a group of resources, either by name or by label.
message ResourceSelector {
string api_version = 1;
string kind = 2;

oneof match {
string match_name = 3;
MatchLabels match_labels = 4;
}
}

// MatchLabels defines a set of labels to match resources against.
message MatchLabels {
map<string, string> labels = 1;
}

// ResponseMeta contains metadata pertaining to a RunFunctionResponse.
message ResponseMeta {
// An opaque string identifying the content of the request. Must match the
Expand Down
77 changes: 49 additions & 28 deletions crossplane/function/proto/v1beta1/run_function_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading