Skip to content

Commit

Permalink
Fix struct generation in execution file (flyteorg#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix authored Oct 19, 2023
1 parent 6898a8e commit 2657b26
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 10 deletions.
11 changes: 10 additions & 1 deletion flytectl/cmd/get/execution_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"io/ioutil"
"os"

structpb "github.com/golang/protobuf/ptypes/struct"

"gopkg.in/yaml.v3"

cmdUtil "github.com/flyteorg/flytectl/pkg/commandutils"
Expand Down Expand Up @@ -152,7 +154,14 @@ func ParamMapForWorkflow(lp *admin.LaunchPlan) (map[string]yaml.Node, error) {

func getCommentedYamlNode(input interface{}, comment string) (yaml.Node, error) {
var node yaml.Node
err := node.Encode(input)
var err error

if s, ok := input.(*structpb.Struct); ok {
err = node.Encode(s.AsMap())
} else {
err = node.Encode(input)
}

node.LineComment = comment
return node, err
}
Loading

0 comments on commit 2657b26

Please sign in to comment.