Created
August 6, 2018 10:53
-
-
Save wayneashleyberry/50e5b03772b1021fcd3ddf4c3ff13536 to your computer and use it in GitHub Desktop.
Go command for a Kubernetes liveness probe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package live | |
import ( | |
"os" | |
"github.com/overhq/over-stories-api/pkg/probe" | |
"github.com/spf13/cobra" | |
) | |
// Command contains the livee command | |
var Command = &cobra.Command{ | |
Use: "live", | |
Short: "Check if application is live", | |
Run: func(cmd *cobra.Command, args []string) { | |
if probe.Exists() { | |
os.Exit(0) | |
} | |
os.Exit(1) | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment