Repository navigation
Conversation
4d194f4 to
8af9e54
Compare
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
786f253 to
3cc7194
Compare
7a67d0f to
d4626e2
Compare
|
This PR was marked as stale after 14 days of inactivity and will be closed after another 14 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
|
This PR was marked as stale after 14 days of inactivity and will be closed after another 14 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
d4626e2 to
e6c7500
Compare
d7e8dd2 to
cc021d1
Compare
STACKITCLI-382 Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
cc021d1 to
9260ade
Compare
Merging this branch changes the coverage (1 decrease, 20 increase)
Coverage detailsCompared to commit f0f2a01 (run #45576622666)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files:
|
| Payload: payload, | ||
| } | ||
|
|
||
| // The input model is deliberately not logged, as the payload may contain credentials |
There was a problem hiding this comment.
So far we always logged the model even if it contains any secrets. If you search through the code base "secretflag" you find some examples.
I think we should handle this consistent and I also think that it would be nice to log all other not sensitive values.
For me it's fine to just create a follow up ticket for this and leave it for this PR like it is
| return req | ||
| } | ||
|
|
||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *telemetryrouter.DestinationResponse) error { |
There was a problem hiding this comment.
I would replace here the parameter model *inputModel with outputFormat string. This keeps the function simpler because you can remove then some nil checks
There was a problem hiding this comment.
same applies for the other commands
| table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime)) | ||
| content = append(content, table) | ||
|
|
||
| if instance.Filter != nil && len(instance.Filter.Attributes) > 0 { | ||
| filterTable := tables.NewTable() | ||
| filterTable.SetTitle("FILTER ATTRIBUTES") | ||
| filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES") |
There was a problem hiding this comment.
Currently the output doesn't contain the information if the filter is disabled or not. I would probably add this to the the first table, because it applies to all defined filters. Something like this:
| table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime)) | |
| content = append(content, table) | |
| if instance.Filter != nil && len(instance.Filter.Attributes) > 0 { | |
| filterTable := tables.NewTable() | |
| filterTable.SetTitle("FILTER ATTRIBUTES") | |
| filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES") | |
| table.AddRow("CREATION TIME", instance.CreationTime.Format(time.DateTime)) | |
| if instance.Filter != nil { | |
| table.AddSeparator() | |
| table.AddRow("FILTER DISABLED", utils.PtrString(instance.Filter.Disabled)) | |
| } | |
| content = append(content, table) | |
| if instance.Filter != nil && len(instance.Filter.Attributes) > 0 { | |
| filterTable := tables.NewTable() | |
| filterTable.SetTitle("FILTER ATTRIBUTES") | |
| filterTable.SetHeader("KEY", "LEVEL", "MATCHER", "VALUES") |
| table := tables.NewTable() | ||
| table.AddRow("ID", instance.Id) |
There was a problem hiding this comment.
this table should also have a title otherwise the output looks a bit off.
STACKITCLI-382
Description
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)