From eeb5266adcb1399e2537b1da8da73dc43f7e9ccb Mon Sep 17 00:00:00 2001 From: pmahindrakar-oss Date: Tue, 14 Sep 2021 15:21:43 +0530 Subject: [PATCH] Removing the ignore on start-node and minor bug fix (#176) Signed-off-by: Prafulla Mahindrakar --- flytectl/.gitignore | 3 ++- flytectl/cmd/get/node_execution.go | 8 +++----- flytectl/cmd/get/node_execution_test.go | 10 ++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/flytectl/.gitignore b/flytectl/.gitignore index 1715663b54e..c1b726f8127 100644 --- a/flytectl/.gitignore +++ b/flytectl/.gitignore @@ -5,4 +5,5 @@ bin .DS_Store _test ./config.yaml -docs/build/* \ No newline at end of file +docs/build/* +cmd/upgrade/flyte.ext diff --git a/flytectl/cmd/get/node_execution.go b/flytectl/cmd/get/node_execution.go index 6db868ed884..8700272c0f2 100644 --- a/flytectl/cmd/get/node_execution.go +++ b/flytectl/cmd/get/node_execution.go @@ -5,7 +5,6 @@ import ( "context" "sort" "strconv" - "strings" cmdCore "github.com/flyteorg/flytectl/cmd/core" "github.com/flyteorg/flytectl/pkg/printer" @@ -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 { @@ -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 { diff --git a/flytectl/cmd/get/node_execution_test.go b/flytectl/cmd/get/node_execution_test.go index ca58d26568e..05d5c2372fb 100644 --- a/flytectl/cmd/get/node_execution_test.go +++ b/flytectl/cmd/get/node_execution_test.go @@ -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) +}