Remove swarm IDs from output

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-09 12:55:03 -04:00
parent 51ce690e1f
commit bf7fd60550
3 changed files with 1 additions and 8 deletions

View File

@ -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 {

View File

@ -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)
}

View File

@ -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: