diff --git a/client/client.go b/client/client.go index 6f4238f..d09129b 100644 --- a/client/client.go +++ b/client/client.go @@ -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, diff --git a/cmd/stackDeploy.go b/cmd/stackDeploy.go index 21dfe5f..44376c6 100644 --- a/cmd/stackDeploy.go +++ b/cmd/stackDeploy.go @@ -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,