Skip to content
Open
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
3 changes: 0 additions & 3 deletions flytepropeller/events/local_eventsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,5 @@ func NewFileSink(path string) (EventSink, error) {

w := bufio.NewWriter(f)

if err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate check

return nil, err
}
return &localSink{writer: &FileWriter{ioWriter: w}}, nil
}
4 changes: 2 additions & 2 deletions flytepropeller/events/local_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type FileWriter struct {
ioWriter *bufio.Writer
}

func (fw *FileWriter) Write(ctx context.Context, content string) error {
func (fw *FileWriter) Write(_ context.Context, content string) error {
_, err := fw.ioWriter.WriteString(content)
return err
}
Expand All @@ -37,7 +37,7 @@ func (fw *FileWriter) Flush() error {
// Std Writer is just the default standard if no sink type is provided
type StdWriter struct{}

func (s *StdWriter) Write(ctx context.Context, content string) error {
func (s *StdWriter) Write(_ context.Context, content string) error {
_, err := fmt.Println(content)
return err
}
Expand Down
1 change: 0 additions & 1 deletion flytepropeller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ require (
)

replace (
github.com/aws/amazon-sagemaker-operator-for-k8s => github.com/aws/amazon-sagemaker-operator-for-k8s v1.0.1-0.20210303003444-0fb33b1fd49d
github.com/flyteorg/flyte/flyteidl => ../flyteidl
github.com/flyteorg/flyte/flyteplugins => ../flyteplugins
github.com/flyteorg/flyte/flytestdlib => ../flytestdlib
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var (
},
Spec: v1.PodSpec{
Containers: []v1.Container{
v1.Container{
{
Command: []string{"flytepropeller"},
Args: []string{"--config", "/etc/flyte/config/*.yaml"},
},
Expand Down
26 changes: 13 additions & 13 deletions flytepropeller/manager/shardstrategy/shard_strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ var (
projectShardStrategy = &EnvironmentShardStrategy{
EnvType: Project,
PerShardIDs: [][]string{
[]string{"flytesnacks"},
[]string{"flytefoo", "flytebar"},
{"flytesnacks"},
{"flytefoo", "flytebar"},
},
}

projectShardStrategyWildcard = &EnvironmentShardStrategy{
EnvType: Project,
PerShardIDs: [][]string{
[]string{"flytesnacks"},
[]string{"flytefoo", "flytebar"},
[]string{"*"},
{"flytesnacks"},
{"flytefoo", "flytebar"},
{"*"},
},
}

domainShardStrategy = &EnvironmentShardStrategy{
EnvType: Domain,
PerShardIDs: [][]string{
[]string{"production"},
[]string{"foo", "bar"},
{"production"},
{"foo", "bar"},
},
}

domainShardStrategyWildcard = &EnvironmentShardStrategy{
EnvType: Domain,
PerShardIDs: [][]string{
[]string{"production"},
[]string{"foo", "bar"},
[]string{"*"},
{"production"},
{"foo", "bar"},
{"*"},
},
}
)
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestUpdatePodSpec(t *testing.T) {
for podIndex := 0; podIndex < tt.shardStrategy.GetPodCount(); podIndex++ {
podSpec := v1.PodSpec{
Containers: []v1.Container{
v1.Container{
{
Name: "flytepropeller",
},
},
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestUpdatePodSpecInvalidPodIndex(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
podSpec := v1.PodSpec{
Containers: []v1.Container{
v1.Container{
{
Name: "flytepropeller",
},
},
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestUpdatePodSpecInvalidPodSpec(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
podSpec := v1.PodSpec{
Containers: []v1.Container{
v1.Container{
{
Name: "flytefoo",
},
},
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/pkg/apis/flyteworkflow/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (
},
Scope: apiextensionsv1.NamespaceScoped,
Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
apiextensionsv1.CustomResourceDefinitionVersion{
{
Name: "v1alpha1",
Served: true,
Storage: true,
Expand Down
6 changes: 3 additions & 3 deletions flytepropeller/pkg/apis/flyteworkflow/v1alpha1/branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func TestBranchNodeSpecMethods(t *testing.T) {
Message: "Test error",
}

ifNode := NodeID("ifNode")
elifNode := NodeID("elifNode")
elseNode := NodeID("elseNode")
ifNode := "ifNode"
elifNode := "elifNode"
elseNode := "elseNode"

// Creating a BranchNodeSpec instance for testing
branchNodeSpec := BranchNodeSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (in *WorkflowStatus) GetNodeExecutionStatus(ctx context.Context, id NodeID)

dataDir, err := in.ConstructNodeDataDir(ctx, id)
if err != nil {
logger.Errorf(ctx, "Failed to construct data dir for node [%v], exec id [%v]", id)
logger.Errorf(ctx, "Failed to construct data dir for node [%v]", id)
return n
}

Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/pkg/compiler/common/id_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ func (s IdentifierSet) List() []Identifier {
}

sort.Sort(res)
return []Identifier(res)
return res
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ type mockWorkflow struct {
upstream common.StringAdjacencyList
}

func (m mockWorkflow) GetCompiledSubWorkflow(id common.WorkflowID) (wf *core.CompiledWorkflow, found bool) {
func (m mockWorkflow) GetCompiledSubWorkflow(common.WorkflowID) (wf *core.CompiledWorkflow, found bool) {
panic("method invocation not expected")
}

func (m mockWorkflow) GetSubWorkflow(id common.WorkflowID) (wf *core.CompiledWorkflow, found bool) {
func (m mockWorkflow) GetSubWorkflow(common.WorkflowID) (wf *core.CompiledWorkflow, found bool) {
panic("method invocation not expected")
}

Expand Down
3 changes: 1 addition & 2 deletions flytepropeller/pkg/compiler/transformers/k8s/inputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors"
)

func TestValidateInputs_InvalidLiteralType(t *testing.T) {
nodeID := common.NodeID("test-node")
nodeID := "test-node"

iface := &core.TypedInterface{
Inputs: &core.VariableMap{
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/pkg/compiler/validators/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func ValidateUnderlyingInterface(w c.WorkflowBuilder, node c.NodeBuilder, errs e
iface = &core.TypedInterface{
Inputs: &core.VariableMap{Variables: map[string]*core.Variable{}},
Outputs: &core.VariableMap{Variables: map[string]*core.Variable{
signal.GetOutputVariableName(): &core.Variable{
signal.GetOutputVariableName(): {
Type: signal.GetType(),
},
}},
Expand Down
7 changes: 3 additions & 4 deletions flytepropeller/pkg/compiler/validators/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common/mocks"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors"
)
Expand All @@ -20,7 +19,7 @@ func TestValidateInterface(t *testing.T) {
t.Run("Happy path", func(t *testing.T) {
errs := errors.NewCompileErrors()
iface, ok := ValidateInterface(
c.NodeID("node1"),
"node1",
&core.TypedInterface{
Inputs: &core.VariableMap{
Variables: map[string]*core.Variable{},
Expand All @@ -38,7 +37,7 @@ func TestValidateInterface(t *testing.T) {
t.Run("Empty Inputs/Outputs", func(t *testing.T) {
errs := errors.NewCompileErrors()
iface, ok := ValidateInterface(
c.NodeID("node1"),
"node1",
&core.TypedInterface{},
errs.NewScope(),
)
Expand All @@ -49,7 +48,7 @@ func TestValidateInterface(t *testing.T) {
t.Run("Empty Interface", func(t *testing.T) {
errs := errors.NewCompileErrors()
iface, ok := ValidateInterface(
c.NodeID("node1"),
"node1",
nil,
errs.NewScope(),
)
Expand Down
Loading
Loading