Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Hasan Turken <[email protected]>
  • Loading branch information
turkenh committed Feb 27, 2024
1 parent 9eb5c3b commit 672676d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"context"
"fmt"
"github.com/crossplane/function-sdk-go/resource"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/logging"
fnv1beta1 "github.com/crossplane/function-sdk-go/proto/v1beta1"
"github.com/crossplane/function-sdk-go/request"
"github.com/crossplane/function-sdk-go/resource"
"github.com/crossplane/function-sdk-go/response"
"github.com/crossplane/function-sequencer/input/v1beta1"
)
Expand All @@ -21,7 +21,7 @@ type Function struct {
}

// RunFunction runs the Function.
func (f *Function) RunFunction(_ context.Context, req *fnv1beta1.RunFunctionRequest) (*fnv1beta1.RunFunctionResponse, error) {
func (f *Function) RunFunction(_ context.Context, req *fnv1beta1.RunFunctionRequest) (*fnv1beta1.RunFunctionResponse, error) { //nolint:gocyclo // This function is unavoidably complex.
f.log.Info("Running function", "tag", req.GetMeta().GetTag())

rsp := response.To(req, response.DefaultTTL)
Expand Down
7 changes: 5 additions & 2 deletions input/v1beta1/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
package v1beta1

import (
"github.com/crossplane/function-sdk-go/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/crossplane/function-sdk-go/resource"
)

// This isn't a custom resource, in the sense that we never install its CRD.
// It is a KRM-like object, so we generate a CRD to describe its schema.

// SequencingRule is a rule that describes a sequence of resources.
type SequencingRule struct {
// TODO: InferFromUsages
// TODO: Should we add a way to infer sequencing from usages? e.g. InferFromUsages: true
// InferFromUsages bool `json:"inferFromUsages,omitempty"`
Sequence []resource.Name `json:"sequence,omitempty"`
}
Expand All @@ -26,5 +28,6 @@ type Input struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Rules is a list of rules that describe sequences of resources.
Rules []SequencingRule `json:"rules"`
}

0 comments on commit 672676d

Please sign in to comment.