Skip to content

Commit

Permalink
CLI: Support more datasource type labels
Browse files Browse the repository at this point in the history
This commit adds support in the `minder datasource` CLI to
handle more labels beyond just "REST".

Signed-off-by: Adolfo García Veytia (Puerco) <puerco@stacklok.com>
  • Loading branch information
puerco committed Dec 3, 2024
1 parent 8f561da commit c7dc76b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/cli/app/datasource/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,18 @@ func appendDataSourcePropertiesToName(ds *minderv1.DataSource) string {

// getDataSourceType returns the type of data source
func getDataSourceType(ds *minderv1.DataSource) string {
dsTypes := []string{}
if ds.GetRest() != nil {
return "REST"
dsTypes = append(dsTypes, "REST")
}
return "Unknown"
if ds.GetDeps() != nil {
dsTypes = append(dsTypes, "Dependencies")
}

if len(dsTypes) == 0 {
return "Unknown"
}
return strings.Join(dsTypes, "\n")
}

// initializeTableForList initializes the table for listing data sources
Expand Down

0 comments on commit c7dc76b

Please sign in to comment.