mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Remove swarm IDs from output
This commit is contained in:
parent
51ce690e1f
commit
bf7fd60550
@ -58,7 +58,6 @@ var stackDeployCmd = &cobra.Command{
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"stack": stackName,
|
||||
"endpoint": endpointId,
|
||||
"swarm": endpointSwarmClusterId,
|
||||
}).Debug("Getting stack")
|
||||
retrievedStack, stackRetrievalErr := common.GetStackByName(stackName, endpointSwarmClusterId, uint32(endpointId))
|
||||
switch stackRetrievalErr.(type) {
|
||||
@ -127,14 +126,12 @@ var stackDeployCmd = &cobra.Command{
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"stack": stackName,
|
||||
"endpoint": endpointId,
|
||||
"swarm": endpointSwarmClusterId,
|
||||
}).Info("Creating stack")
|
||||
stack, deploymentErr := portainerClient.CreateSwarmStack(stackName, loadedEnvironmentVariables, stackFileContent, endpointSwarmClusterId, uint32(endpointId))
|
||||
common.CheckError(deploymentErr)
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"stack": stack.Name,
|
||||
"endpoint": stack.EndpointID,
|
||||
"swarm": stack.SwarmID,
|
||||
"id": stack.Id,
|
||||
}).Info("Stack created")
|
||||
} else {
|
||||
|
@ -35,7 +35,6 @@ var stackListCmd = &cobra.Command{
|
||||
// It's a swarm cluster
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"endpoint": endpointId,
|
||||
"swarm": endpointSwarmClusterId,
|
||||
}).Debug("Getting stacks")
|
||||
stacks, err = portainerClient.GetStacks(endpointSwarmClusterId, uint32(endpointId))
|
||||
common.CheckError(err)
|
||||
@ -78,17 +77,15 @@ var stackListCmd = &cobra.Command{
|
||||
"NAME",
|
||||
"TYPE",
|
||||
"ENDPOINT ID",
|
||||
"SWARM ID",
|
||||
})
|
||||
common.CheckError(err)
|
||||
for _, s := range stacks {
|
||||
_, err := fmt.Fprintln(writer, fmt.Sprintf(
|
||||
"%v\t%s\t%v\t%v\t%s",
|
||||
"%v\t%s\t%v\t%v",
|
||||
s.Id,
|
||||
s.Name,
|
||||
s.GetTranslatedStackType(),
|
||||
s.EndpointID,
|
||||
s.SwarmID,
|
||||
))
|
||||
common.CheckError(err)
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ var stackRemoveCmd = &cobra.Command{
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"stack": stackName,
|
||||
"endpoint": endpointId,
|
||||
"swarm": endpointSwarmClusterId,
|
||||
}).Debug("Getting stack")
|
||||
stack, stackRetrievalErr = common.GetStackByName(stackName, endpointSwarmClusterId, uint32(endpointId))
|
||||
case *common.StackClusterNotFoundError:
|
||||
|
Loading…
Reference in New Issue
Block a user