Skip to content

Commit

Permalink
Add operator versions (#1708)
Browse files Browse the repository at this point in the history
* Add operator versions

* Fix the indentation
  • Loading branch information
rdavid authored Dec 11, 2023
1 parent ac85eb0 commit 9dd9569
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 11 additions & 1 deletion cmd/tnf/claim/show/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func buildCSV(claimScheme *claim.Schema, cnfType string, catalogMap map[string]c
// add header if flag is present (defaults to no header)
if addHeaderFlag {
resultsCSVRecords = append(resultsCSVRecords, []string{
"CNFName", "testID", "Suite",
"CNFName", "OperatorVersion", "testID", "Suite",
"Description", "State",
"StartTime", "EndTime",
"FailureReason", "Output",
Expand All @@ -152,12 +152,22 @@ func buildCSV(claimScheme *claim.Schema, cnfType string, catalogMap map[string]c
})
}

opVers := ""
for i, op := range claimScheme.Claim.Configurations.TestOperators {
if i == 0 {
opVers = op.Version
} else {
opVers = opVers + ", " + op.Version
}
}

for testID := range claimScheme.Claim.Results {
// initialize record
record := []string{}
// creates and appends new CSV record
record = append(record,
CNFNameFlag,
opVers,
testID,
claimScheme.Claim.Results[testID].TestID.Suite,
claimScheme.Claim.Results[testID].CatalogInfo.Description,
Expand Down
11 changes: 9 additions & 2 deletions cmd/tnf/pkg/claim/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,16 @@ type Nodes struct {
CsiDriver interface{} `json:"csiDriver"`
}

type TestOperator struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Version string `json:"version"`
}

type Configurations struct {
Config interface{} `json:"Config"`
AbnormalEvents []interface{} `json:"AbnormalEvents"`
Config interface{} `json:"Config"`
AbnormalEvents []interface{} `json:"AbnormalEvents"`
TestOperators []TestOperator `json:"testOperators"`
}

type Schema struct {
Expand Down

0 comments on commit 9dd9569

Please sign in to comment.