1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(transactions): remove the feature flag EE-6080 (#10257)

This commit is contained in:
andres-portainer 2023-09-05 20:27:20 -03:00 committed by GitHub
parent e83aa4d88d
commit c748385879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 123 additions and 384 deletions

View file

@ -6,7 +6,6 @@ import (
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
"github.com/portainer/portainer/pkg/featureflags"
httperror "github.com/portainer/portainer/pkg/libhttp/error"
"github.com/portainer/portainer/pkg/libhttp/request"
"github.com/portainer/portainer/pkg/libhttp/response"
@ -37,14 +36,9 @@ func (handler *Handler) endpointGroupAddEndpoint(w http.ResponseWriter, r *http.
return httperror.BadRequest("Invalid environment identifier route variable", err)
}
if featureflags.IsEnabled(portainer.FeatureNoTx) {
err = handler.addEndpoint(handler.DataStore, portainer.EndpointGroupID(endpointGroupID), portainer.EndpointID(endpointID))
} else {
err = handler.DataStore.UpdateTx(func(tx dataservices.DataStoreTx) error {
return handler.addEndpoint(tx, portainer.EndpointGroupID(endpointGroupID), portainer.EndpointID(endpointID))
})
}
err = handler.DataStore.UpdateTx(func(tx dataservices.DataStoreTx) error {
return handler.addEndpoint(tx, portainer.EndpointGroupID(endpointGroupID), portainer.EndpointID(endpointID))
})
if err != nil {
var httpErr *httperror.HandlerError
if errors.As(err, &httpErr) {