Skip to content

Commit

Permalink
Removing the ignore on start-node and minor bug fix (flyteorg#176)
Browse files Browse the repository at this point in the history
Signed-off-by: Prafulla Mahindrakar <[email protected]>
  • Loading branch information
pmahindrakar-oss authored and austin362667 committed May 7, 2024
1 parent 6dd8d9b commit eeb5266
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion flytectl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ bin
.DS_Store
_test
./config.yaml
docs/build/*
docs/build/*
cmd/upgrade/flyte.ext
8 changes: 3 additions & 5 deletions flytectl/cmd/get/node_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"sort"
"strconv"
"strings"

cmdCore "github.com/flyteorg/flytectl/cmd/core"
"github.com/flyteorg/flytectl/pkg/printer"
Expand Down Expand Up @@ -149,10 +148,6 @@ func getNodeExecDetailsInt(ctx context.Context, project, domain, execName, nodeN
return nil, err
}
} else {
// Bug in admin https://github.com/flyteorg/flyte/issues/1221
if strings.HasSuffix(nodeExec.Id.NodeId, "start-node") {
continue
}
taskExecList, err := cmdCtx.AdminFetcherExt().FetchTaskExecutionsOnNode(ctx,
nodeExec.Id.NodeId, execName, project, domain)
if err != nil {
Expand Down Expand Up @@ -260,6 +255,9 @@ func createNodeDetailsTreeView(rootView gotree.Tree, nodeExecutionClosures []*No

func extractLiteralMap(literalMap *core.LiteralMap) (map[string]interface{}, error) {
m := make(map[string]interface{})
if literalMap == nil || literalMap.Literals == nil {
return m, nil
}
for key, literalVal := range literalMap.Literals {
extractedLiteralVal, err := coreutils.ExtractFromLiteral(literalVal)
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions flytectl/cmd/get/node_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,13 @@ func TestGetExecutionDetails(t *testing.T) {
assert.Equal(t, fmt.Errorf("unable to fetch task exec details"), err)
})
}

func TestExtractLiteralMapError(t *testing.T) {
literalMap, err := extractLiteralMap(nil)
assert.Nil(t, err)
assert.Equal(t, len(literalMap), 0)

literalMap, err = extractLiteralMap(&core.LiteralMap{})
assert.Nil(t, err)
assert.Equal(t, len(literalMap), 0)
}

0 comments on commit eeb5266

Please sign in to comment.