From 0bc93445161deda2f0ed09258b365257b04c622a Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 2 Apr 2025 09:38:21 -0400 Subject: [PATCH] Commands generating warnings about non existing table fields 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 --- internal/runners/methods.go | 10 +--------- internal/runners/roles.go | 2 +- internal/runners/workflows.go | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/internal/runners/methods.go b/internal/runners/methods.go index 57fc6306..97fa9314 100644 --- a/internal/runners/methods.go +++ b/internal/runners/methods.go @@ -5,8 +5,6 @@ package runners import ( - "fmt" - "github.com/itential/ipctl/pkg/client" "github.com/itential/ipctl/pkg/config" "github.com/itential/ipctl/pkg/logger" @@ -33,14 +31,8 @@ func (r *MethodRunner) Get(in Request) (*Response, error) { return nil, err } - display := []string{"NAME\tTYPE"} - for _, ele := range methods { - line := fmt.Sprintf("%s\t%s", ele.Name, ele.Provenance) - display = append(display, line) - } - return &Response{ - Keys: []string{"name", "type"}, + Keys: []string{"name", "provenance"}, Object: methods, }, nil } diff --git a/internal/runners/roles.go b/internal/runners/roles.go index 6642dfbe..8e25103a 100644 --- a/internal/runners/roles.go +++ b/internal/runners/roles.go @@ -54,7 +54,7 @@ func (r *RoleRunner) Get(in Request) (*Response, error) { } return &Response{ - Keys: []string{"name", "type"}, + Keys: []string{"name", "provenance"}, Object: filtered, }, nil diff --git a/internal/runners/workflows.go b/internal/runners/workflows.go index 632948e8..4d362feb 100644 --- a/internal/runners/workflows.go +++ b/internal/runners/workflows.go @@ -57,7 +57,7 @@ func (r *WorkflowRunner) Get(in Request) (*Response, error) { } return &Response{ - Keys: []string{"name", "description"}, + Keys: []string{"name"}, Object: workflows, }, nil