Conversation
| @@ -32,6 +32,7 @@ stackit beta sfs [flags] | |||
| * [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands | |||
There was a problem hiding this comment.
I can't comment it here in the right line and it also doesn't relate directly to your PR, but can you change the description of the $ stackit beta sfs command?
Provides functionality for SFS (stackit file storage)
change it to
Provides functionality for SFS (STACKIT File Storage)
| req := buildRequest(ctx, model, apiClient) | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| oapiErr, _ := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped |
There was a problem hiding this comment.
You can actually use errors.As here and remove the nolint comment. We decided a few months ago to use errors.As, but there are probably still a lot of lines where we didn't changed it yet.
stackit-cli/internal/pkg/errors/errors.go
Lines 619 to 620 in d6c7108
| if err != nil { | ||
| oapiErr, _ := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped | ||
| if oapiErr.StatusCode == http.StatusNotFound { | ||
| fmt.Printf("No active lock found for project %s\n", projectLabel) |
There was a problem hiding this comment.
In case someone sets the output format yaml or json, it will be ignored in this output.
And avoid using fmt.Print and use instead our params.Printer
| if err != nil { | ||
| return fmt.Errorf("enable SFS project lock: %w", err) |
There was a problem hiding this comment.
In case some executes this lock command on a project which has already a lock, the API responds with 409. I would suggest to catch it here, similar like you did it in the describe command with the 404
Co-authored-by: Marcel Jacek <72880145+marceljk@users.noreply.github.com>
Co-authored-by: Marcel Jacek <72880145+marceljk@users.noreply.github.com>
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
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
|
Description
relates to STACKITCLI-381
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)