mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Rename PortainerClient.GetStacks() to StackList()
This commit is contained in:
parent
623788b624
commit
87ba553153
@ -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,
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user