revert: revert PR 1366 (#1588)

pull/1589/head
Anthony Lapenna 7 years ago committed by GitHub
parent c51db23c32
commit b1863430df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,6 @@ func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) {
flags := &portainer.CLIFlags{
Addr: kingpin.Flag("bind", "Address and port to serve Portainer").Default(defaultBindAddress).Short('p').String(),
Assets: kingpin.Flag("assets", "Path to the assets").Default(defaultAssetsDirectory).Short('a').String(),
CheckHealth: kingpin.Flag("check-health", "GET http://localhost:<port>/api/health endpoint").Default(defaultCheckHealth).Short('c').Bool(),
Data: kingpin.Flag("data", "Path to the folder where the data is stored").Default(defaultDataDirectory).Short('d').String(),
Endpoint: kingpin.Flag("host", "Dockerd endpoint").Short('H').String(),
ExternalEndpoints: kingpin.Flag("external-endpoints", "Path to a file defining available endpoints").String(),

@ -6,7 +6,6 @@ const (
defaultBindAddress = ":9000"
defaultDataDirectory = "/data"
defaultAssetsDirectory = "./"
defaultCheckHealth = "false"
defaultNoAuth = "false"
defaultNoAnalytics = "false"
defaultTLSVerify = "false"

@ -4,7 +4,6 @@ const (
defaultBindAddress = ":9000"
defaultDataDirectory = "C:\\data"
defaultAssetsDirectory = "./"
defaultCheckHealth = "false"
defaultNoAuth = "false"
defaultNoAnalytics = "false"
defaultTLSVerify = "false"

@ -14,7 +14,6 @@ import (
"github.com/portainer/portainer/ldap"
"log"
"os"
)
func initCLI() *portainer.CLIFlags {
@ -172,19 +171,6 @@ func retrieveFirstEndpointFromDatabase(endpointService portainer.EndpointService
func main() {
flags := initCLI()
if *flags.CheckHealth {
statuscode, err := http.HealthCheck(*flags.Addr)
if err == nil {
if statuscode == 200 {
log.Println(*flags.Addr, ": Online - response:", statuscode)
os.Exit(0)
} else {
log.Fatal(*flags.Addr, ": Error - response:", statuscode)
}
}
log.Fatal("Connection error:", err.Error())
}
fileService := initFileService(*flags.Data)
store := initStore(*flags.Data)

@ -1,11 +0,0 @@
package http
import (
"net/http"
)
// HealthCheck GETs /api/status
func HealthCheck(addr string) (int, error) {
resp, err := http.Get("http://" + addr + "/api/status")
return resp.StatusCode, err
}

@ -13,7 +13,6 @@ type (
CLIFlags struct {
Addr *string
Assets *string
CheckHealth *bool
Data *string
Endpoint *string
ExternalEndpoints *string

@ -9,5 +9,3 @@ WORKDIR /
EXPOSE 9000
ENTRYPOINT ["/portainer"]
HEALTHCHECK --start-period=10ms --interval=30s --timeout=5s --retries=3 CMD ["/portainer", "-c"]

Loading…
Cancel
Save