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