Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Fix struct generation in execution file (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix authored Oct 19, 2023
1 parent 043a611 commit cdfa222
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 10 deletions.
11 changes: 10 additions & 1 deletion 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 cdfa222

Please sign in to comment.