Skip to content

Commit e972db4

Browse files
authored
fix(core): values list should properly render table output (#220)
1 parent 4dfa756 commit e972db4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

cmd/policy-attributeValues.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import (
1212

1313
// TODO: add metadata to outputs once [https://github.com/opentdf/otdfctl/issues/73] is addressed
1414

15-
var (
16-
policy_attributeValuesCmd *cobra.Command
17-
)
15+
var policy_attributeValuesCmd *cobra.Command
1816

1917
func policy_createAttributeValue(cmd *cobra.Command, args []string) {
2018
flagHelper := cli.NewFlagHelper(cmd)
@@ -66,7 +64,7 @@ func policy_listAttributeValue(cmd *cobra.Command, args []string) {
6664
}
6765
t := cli.NewTable(
6866
cli.NewUUIDColumn(),
69-
table.NewColumn("fqn", "Fqn", 16),
67+
table.NewColumn("fqn", "Fqn", 37),
7068
table.NewColumn("members", "Members", 16),
7169
table.NewColumn("active", "Active", 16),
7270
table.NewColumn("labels", "Labels", 16),
@@ -86,6 +84,7 @@ func policy_listAttributeValue(cmd *cobra.Command, args []string) {
8684
"updated_at": v.Metadata["Updated At"],
8785
}))
8886
}
87+
t = t.WithRows(rows)
8988
HandleSuccess(cmd, "", t, vals)
9089
}
9190

pkg/cli/sdkHelpers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ func GetSimpleAttribute(a *policy.Attribute) SimpleAttribute {
6666

6767
func GetSimpleAttributeValue(v *policy.Value) SimpleAttributeValue {
6868
memberIds := []string{}
69-
for _, m := range v.Members {
70-
memberIds = append(memberIds, m.Id)
69+
for _, m := range v.GetMembers() {
70+
memberIds = append(memberIds, m.GetId())
7171
}
7272
return SimpleAttributeValue{
73-
Id: v.Id,
74-
FQN: v.Fqn,
73+
Id: v.GetId(),
74+
FQN: v.GetFqn(),
7575
Members: memberIds,
7676
Active: strconv.FormatBool(v.Active.GetValue()),
7777
Metadata: ConstructMetadata(v.GetMetadata()),

0 commit comments

Comments
 (0)