Skip to content

Commit

Permalink
fix: control the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsinai committed May 16, 2024
1 parent 3af5596 commit dbe6564
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/crd/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ func convertToPortSchemas(crd v1.CustomResourceDefinition) ([]port.Action, *port
if !slices.Contains(as.Required, k) {
v.Visible = new(bool)
*v.Visible = false
v.Default = nil
as.Properties[k] = v
}

Expand Down Expand Up @@ -299,7 +300,7 @@ func convertToPortSchemas(crd v1.CustomResourceDefinition) ([]port.Action, *port
"{{if (.entity.properties | has(\"namespace\")) then \"namespace\" else null end}}": "{{.entity.properties.\"namespace\"}}",
"{{if (.inputs | has(\"namespace\")) then \"namespace\" else null end}}": "{{.inputs.\"namespace\"}}",
},
"spec": "{{ .inputs | to_entries | mapif .key | contains(\"__\") then .key |= split(\"__\") else . end) | reduce .[] as $item ({}; if $item.key | type == \"array\" then setpath($item.key;$item.value) else setpath([$item.key];$item.value) end) | del(.name) | del (.namespace) }}",
"spec": "{{ .inputs | to_entries | map(if .key | contains(\"__\") then .key |= split(\"__\") else . end) | reduce .[] as $item ({}; if $item.key | type == \"array\" then setpath($item.key;$item.value) else setpath([$item.key];$item.value) end) | del(.name) | del (.namespace) }}",
},
},
}
Expand Down

0 comments on commit dbe6564

Please sign in to comment.