Skip to content

Commit bf401b1

Browse files
authored
Commands generating warnings about non existing table fields (#106)
There are three commands that are generating warnings about table fields that do not exist. The output table configuration for would reference fields not returned from the API call. This change addresses those issues and properly returns a table output
1 parent 1748ead commit bf401b1

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

internal/runners/methods.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
package runners
66

77
import (
8-
"fmt"
9-
108
"github.com/itential/ipctl/pkg/client"
119
"github.com/itential/ipctl/pkg/config"
1210
"github.com/itential/ipctl/pkg/logger"
@@ -33,14 +31,8 @@ func (r *MethodRunner) Get(in Request) (*Response, error) {
3331
return nil, err
3432
}
3533

36-
display := []string{"NAME\tTYPE"}
37-
for _, ele := range methods {
38-
line := fmt.Sprintf("%s\t%s", ele.Name, ele.Provenance)
39-
display = append(display, line)
40-
}
41-
4234
return &Response{
43-
Keys: []string{"name", "type"},
35+
Keys: []string{"name", "provenance"},
4436
Object: methods,
4537
}, nil
4638
}

internal/runners/roles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (r *RoleRunner) Get(in Request) (*Response, error) {
5454
}
5555

5656
return &Response{
57-
Keys: []string{"name", "type"},
57+
Keys: []string{"name", "provenance"},
5858
Object: filtered,
5959
}, nil
6060

internal/runners/workflows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (r *WorkflowRunner) Get(in Request) (*Response, error) {
5757
}
5858

5959
return &Response{
60-
Keys: []string{"name", "description"},
60+
Keys: []string{"name"},
6161
Object: workflows,
6262
}, nil
6363

0 commit comments

Comments
 (0)