Add endpoint to stack removal related logs

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-09 11:47:32 -04:00
parent ab7bc222aa
commit 2dc134e45d

View File

@ -64,7 +64,8 @@ var stackRemoveCmd = &cobra.Command{
stackId := stack.Id stackId := stack.Id
logrus.WithFields(logrus.Fields{ logrus.WithFields(logrus.Fields{
"stack": stackName, "stack": stackName,
"endpoint": endpointId,
}).Info("Removing stack") }).Info("Removing stack")
err := portainerClient.DeleteStack(stackId) err := portainerClient.DeleteStack(stackId)
common.CheckError(err) common.CheckError(err)
@ -75,11 +76,13 @@ var stackRemoveCmd = &cobra.Command{
case *common.StackNotFoundError: case *common.StackNotFoundError:
// The stack does not exist // The stack does not exist
logrus.WithFields(logrus.Fields{ logrus.WithFields(logrus.Fields{
"stack": stackName, "stack": stackName,
"endpoint": endpointId,
}).Debug("Stack not found") }).Debug("Stack not found")
if viper.GetBool("stack.remove.strict") { if viper.GetBool("stack.remove.strict") {
logrus.WithFields(logrus.Fields{ logrus.WithFields(logrus.Fields{
"stack": stackName, "stack": stackName,
"endpoint": endpointId,
}).Fatal("Stack does not exist") }).Fatal("Stack does not exist")
} }
default: default: