File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ package main
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "github.com/crossplane/function-sdk-go/resource"
7
6
8
7
"github.com/crossplane/crossplane-runtime/pkg/errors"
9
8
"github.com/crossplane/crossplane-runtime/pkg/logging"
10
9
fnv1beta1 "github.com/crossplane/function-sdk-go/proto/v1beta1"
11
10
"github.com/crossplane/function-sdk-go/request"
11
+ "github.com/crossplane/function-sdk-go/resource"
12
12
"github.com/crossplane/function-sdk-go/response"
13
13
"github.com/crossplane/function-sequencer/input/v1beta1"
14
14
)
@@ -21,7 +21,7 @@ type Function struct {
21
21
}
22
22
23
23
// RunFunction runs the Function.
24
- func (f * Function ) RunFunction (_ context.Context , req * fnv1beta1.RunFunctionRequest ) (* fnv1beta1.RunFunctionResponse , error ) {
24
+ func (f * Function ) RunFunction (_ context.Context , req * fnv1beta1.RunFunctionRequest ) (* fnv1beta1.RunFunctionResponse , error ) { //nolint:gocyclo // This function is unavoidably complex.
25
25
f .log .Info ("Running function" , "tag" , req .GetMeta ().GetTag ())
26
26
27
27
rsp := response .To (req , response .DefaultTTL )
Original file line number Diff line number Diff line change 5
5
package v1beta1
6
6
7
7
import (
8
- "github.com/crossplane/function-sdk-go/resource"
9
8
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9
+
10
+ "github.com/crossplane/function-sdk-go/resource"
10
11
)
11
12
12
13
// This isn't a custom resource, in the sense that we never install its CRD.
13
14
// It is a KRM-like object, so we generate a CRD to describe its schema.
14
15
16
+ // SequencingRule is a rule that describes a sequence of resources.
15
17
type SequencingRule struct {
16
- // TODO: InferFromUsages
18
+ // TODO: Should we add a way to infer sequencing from usages? e.g. InferFromUsages: true
17
19
// InferFromUsages bool `json:"inferFromUsages,omitempty"`
18
20
Sequence []resource.Name `json:"sequence,omitempty"`
19
21
}
@@ -26,5 +28,6 @@ type Input struct {
26
28
metav1.TypeMeta `json:",inline"`
27
29
metav1.ObjectMeta `json:"metadata,omitempty"`
28
30
31
+ // Rules is a list of rules that describe sequences of resources.
29
32
Rules []SequencingRule `json:"rules"`
30
33
}
You can’t perform that action at this time.
0 commit comments