Rename PortainerClient.UpdateStack() to StackUpdate()

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-26 01:19:41 -04:00
parent 00b7daae73
commit ea63f26ee0
2 changed files with 6 additions and 6 deletions

View File

@ -47,10 +47,10 @@ type PortainerClient interface {
StackCreateSwarm(stackName string, environmentVariables []portainer.Pair, stackFileContent string, swarmClusterID string, endpointID portainer.EndpointID) (stack portainer.Stack, err error)
// Create compose stack
CreateComposeStack(stackName string, environmentVariables []portainer.Pair, stackFileContent string, endpointID portainer.EndpointID) (stack portainer.Stack, err error)
StackCreateCompose(stackName string, environmentVariables []portainer.Pair, stackFileContent string, endpointID portainer.EndpointID) (stack portainer.Stack, err error)
// Update stack
UpdateStack(stack portainer.Stack, environmentVariables []portainer.Pair, stackFileContent string, prune bool, endpointID portainer.EndpointID) error
StackUpdate(stack portainer.Stack, environmentVariables []portainer.Pair, stackFileContent string, prune bool, endpointID portainer.EndpointID) error
// Delete stack
DeleteStack(stackID portainer.StackID) error
@ -256,7 +256,7 @@ func (n *portainerClientImp) StackCreateSwarm(stackName string, environmentVaria
return
}
func (n *portainerClientImp) CreateComposeStack(stackName string, environmentVariables []portainer.Pair, stackFileContent string, endpointID portainer.EndpointID) (stack portainer.Stack, err error) {
func (n *portainerClientImp) StackCreateCompose(stackName string, environmentVariables []portainer.Pair, stackFileContent string, endpointID portainer.EndpointID) (stack portainer.Stack, err error) {
reqBody := StackCreateRequest{
Name: stackName,
Env: environmentVariables,
@ -267,7 +267,7 @@ func (n *portainerClientImp) CreateComposeStack(stackName string, environmentVar
return
}
func (n *portainerClientImp) UpdateStack(stack portainer.Stack, environmentVariables []portainer.Pair, stackFileContent string, prune bool, endpointID portainer.EndpointID) (err error) {
func (n *portainerClientImp) StackUpdate(stack portainer.Stack, environmentVariables []portainer.Pair, stackFileContent string, prune bool, endpointID portainer.EndpointID) (err error) {
reqBody := StackUpdateRequest{
Env: environmentVariables,
StackFileContent: stackFileContent,

View File

@ -115,7 +115,7 @@ var stackDeployCmd = &cobra.Command{
logrus.WithFields(logrus.Fields{
"stack": retrievedStack.Name,
}).Info("Updating stack")
err := portainerClient.UpdateStack(retrievedStack, newEnvironmentVariables, stackFileContent, viper.GetBool("stack.deploy.prune"), endpoint.ID)
err := portainerClient.StackUpdate(retrievedStack, newEnvironmentVariables, stackFileContent, viper.GetBool("stack.deploy.prune"), endpoint.ID)
common.CheckError(err)
} else if stackRetrievalErr == common.ErrStackNotFound {
// We are deploying a new stack
@ -148,7 +148,7 @@ var stackDeployCmd = &cobra.Command{
"stack": stackName,
"endpoint": endpoint.Name,
}).Info("Creating stack")
stack, deploymentErr := portainerClient.CreateComposeStack(stackName, loadedEnvironmentVariables, stackFileContent, endpoint.ID)
stack, deploymentErr := portainerClient.StackCreateCompose(stackName, loadedEnvironmentVariables, stackFileContent, endpoint.ID)
common.CheckError(deploymentErr)
logrus.WithFields(logrus.Fields{
"stack": stack.Name,