-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a synchronous purge endpoint #711
Implement a synchronous purge endpoint #711
Conversation
- Added a new API endpoint `POST /deployments/<id>/purge[?force]` - Added a purge command on CLI - Added a PURGE_FAILED deployment status
} | ||
if len(errs.Errors) > 0 { | ||
w.WriteHeader(http.StatusInternalServerError) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set the status in case of success ?
} else {
w.WriteHeader(http.StatusOK)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary:
// If WriteHeader has not yet been called, Write calls
// WriteHeader(http.StatusOK) before writing the data.
https://pkg.go.dev/net/http#ResponseWriter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you are right if we do not set it we do not record it in the telemetry handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
even in nominal mode. In case of error then the deployment status is set to PURGE_FAILED
Kudos, SonarCloud Quality Gate passed!
|
Kudos, SonarCloud Quality Gate passed! |
Pull Request description
Description of the change
What I did
POST /deployments/<id>/purge[?force]
How to verify it
undeployed
statework/deployments/<depid>
folder in order to generate an error when purging the deploymentyorc d list
) but with an errorwork/deployments/<depid>
folderwork/deployments/<depid>
folder should not exist anymoreDescription for the changelog
Applicable Issues
Fixes #707