From 87ba553153766fc7b76aa16659f12f380e5e01f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Mej=C3=ADas=20Rodr=C3=ADguez?= Date: Mon, 26 Aug 2019 01:17:41 -0400 Subject: [PATCH] Rename PortainerClient.GetStacks() to StackList() --- client/client.go | 4 ++-- cmd/stackList.go | 6 +++--- common/utils.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/client.go b/client/client.go index 746a92f..03e9ed3 100644 --- a/client/client.go +++ b/client/client.go @@ -41,7 +41,7 @@ type PortainerClient interface { EndpointGroupList() ([]portainer.EndpointGroup, error) // Get stacks, optionally filtered by swarmId and endpointId - GetStacks(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error) + StackList(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error) // Create swarm stack CreateSwarmStack(stackName string, environmentVariables []portainer.Pair, stackFileContent string, swarmClusterID string, endpointID portainer.EndpointID) (stack portainer.Stack, err error) @@ -231,7 +231,7 @@ func (n *portainerClientImp) EndpointGroupList() (endpointGroups []portainer.End return } -func (n *portainerClientImp) GetStacks(swarmID string, endpointID portainer.EndpointID) (stacks []portainer.Stack, err error) { +func (n *portainerClientImp) StackList(swarmID string, endpointID portainer.EndpointID) (stacks []portainer.Stack, err error) { filter := StackListFilter{ SwarmID: swarmID, EndpointID: endpointID, diff --git a/cmd/stackList.go b/cmd/stackList.go index 172b694..d073427 100644 --- a/cmd/stackList.go +++ b/cmd/stackList.go @@ -53,14 +53,14 @@ var stackListCmd = &cobra.Command{ logrus.WithFields(logrus.Fields{ "endpoint": endpoint.Name, }).Debug("Getting stacks") - stacks, err = portainerClient.GetStacks(endpointSwarmClusterID, endpoint.ID) + stacks, err = portainerClient.StackList(endpointSwarmClusterID, endpoint.ID) common.CheckError(err) } else if selectionErr == common.ErrStackClusterNotFound { // It's not a swarm cluster logrus.WithFields(logrus.Fields{ "endpoint": endpoint.Name, }).Debug("Getting stacks") - stacks, err = portainerClient.GetStacks("", endpoint.ID) + stacks, err = portainerClient.StackList("", endpoint.ID) common.CheckError(err) } else { // Something else happened @@ -68,7 +68,7 @@ var stackListCmd = &cobra.Command{ } } else { logrus.Debug("Getting stacks") - stacks, err = portainerClient.GetStacks("", 0) + stacks, err = portainerClient.StackList("", 0) common.CheckError(err) } diff --git a/common/utils.go b/common/utils.go index 81f272a..0c1e026 100644 --- a/common/utils.go +++ b/common/utils.go @@ -63,7 +63,7 @@ func GetStackByName(name string, swarmID string, endpointID portainer.EndpointID return } - stacks, err := portainerClient.GetStacks(swarmID, endpointID) + stacks, err := portainerClient.StackList(swarmID, endpointID) if err != nil { return }