Skip to content

Commit

Permalink
fixed lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw committed Oct 4, 2023
1 parent c3b177e commit 54902c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion flytepropeller/pkg/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ type Config struct {
ExcludeDomainLabel []string `json:"exclude-domain-label" pflag:",Exclude the specified domain label from the k8s FlyteWorkflow CRD label selector"`
ClusterID string `json:"cluster-id" pflag:",Unique cluster id running this flytepropeller instance with which to annotate execution events"`
CreateFlyteWorkflowCRD bool `json:"create-flyteworkflow-crd" pflag:",Enable creation of the FlyteWorkflow CRD on startup"`
ArrayNodeEventVersion int `json:"array-node-event-version" pflag:",ArrayNode eventing version. 0 => legacy (drop-in replacement for maptask), 1 => new"`
ArrayNodeEventVersion int `json:"array-node-event-version" pflag:",ArrayNode eventing version. 0 => legacy (drop-in replacement for maptask), 1 => new"`
}

// KubeClientConfig contains the configuration used by flytepropeller to configure its internal Kubernetes Client.
Expand Down
21 changes: 11 additions & 10 deletions flytepropeller/pkg/controller/nodes/array/event_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
idlcore "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/common"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces"
idlcore "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
"github.com/golang/protobuf/ptypes"
)

Expand All @@ -22,10 +22,10 @@ type arrayEventRecorder interface {
}

type externalResourcesEventRecorder struct {
interfaces.EventRecorder
interfaces.EventRecorder
externalResources []*event.ExternalResourceInfo
nodeEvents []*event.NodeExecutionEvent
taskEvents []*event.TaskExecutionEvent
nodeEvents []*event.NodeExecutionEvent
taskEvents []*event.TaskExecutionEvent
}

func (e *externalResourcesEventRecorder) RecordNodeEvent(ctx context.Context, event *event.NodeExecutionEvent, eventConfig *config.EventConfig) error {
Expand Down Expand Up @@ -136,7 +136,8 @@ type passThroughEventRecorder struct {
interfaces.EventRecorder
}

func (*passThroughEventRecorder) process(ctx context.Context, nCtx interfaces.NodeExecutionContext, index int, retryAttempt uint32) {}
func (*passThroughEventRecorder) process(ctx context.Context, nCtx interfaces.NodeExecutionContext, index int, retryAttempt uint32) {

Check warning on line 139 in flytepropeller/pkg/controller/nodes/array/event_recorder.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/event_recorder.go#L139

Added line #L139 was not covered by tests
}

func (*passThroughEventRecorder) finalize(ctx context.Context, nCtx interfaces.NodeExecutionContext,
taskPhase idlcore.TaskExecution_Phase, taskPhaseVersion uint32, eventConfig *config.EventConfig) error {
Expand Down Expand Up @@ -166,16 +167,16 @@ func sendEvents(ctx context.Context, nCtx interfaces.NodeExecutionContext, index
timestamp := ptypes.TimestampNow()
workflowExecutionID := nCtx.ExecutionContext().GetExecutionID().WorkflowExecutionIdentifier

// send NodeExecutionEvent with UNDEFINED phase
// send NodeExecutionEvent
nodeExecutionEvent := &event.NodeExecutionEvent{
Id: &idlcore.NodeExecutionIdentifier{
NodeId: subNodeID,
ExecutionId: workflowExecutionID,
},
Phase: nodePhase,
Phase: nodePhase,
OccurredAt: timestamp,
ParentNodeMetadata: &event.ParentNodeExecutionMetadata{
NodeId: nCtx.NodeID(),
NodeId: nCtx.NodeID(),
},
ReportedAt: timestamp,
}
Expand All @@ -184,7 +185,7 @@ func sendEvents(ctx context.Context, nCtx interfaces.NodeExecutionContext, index
return err
}

Check warning on line 186 in flytepropeller/pkg/controller/nodes/array/event_recorder.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/event_recorder.go#L185-L186

Added lines #L185 - L186 were not covered by tests

// send TaskExeucutionEvent with UNDEFINED phase
// send TaskExeucutionEvent
taskExecutionEvent := &event.TaskExecutionEvent{
TaskId: &idlcore.Identifier{
ResourceType: idlcore.ResourceType_TASK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package array
import (
"context"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
)

type bufferedEventRecorder struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package array
import (
"context"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
)

type staticInputReader struct {
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/pkg/controller/nodes/array/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"context"
"fmt"

idlcore "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/interfaces"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/codex"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task/k8s"
"github.com/flyteorg/flyte/flytestdlib/storage"
idlcore "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
)

func appendLiteral(name string, literal *idlcore.Literal, outputLiterals map[string]*idlcore.Literal, length int) {
Expand Down

0 comments on commit 54902c7

Please sign in to comment.