chore: remove unused code in ps plugin
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
|||||||
|
|
||||||
"github.com/dokku/dokku/plugins/common"
|
"github.com/dokku/dokku/plugins/common"
|
||||||
dockeroptions "github.com/dokku/dokku/plugins/docker-options"
|
dockeroptions "github.com/dokku/dokku/plugins/docker-options"
|
||||||
"github.com/ryanuber/columnize"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func canScaleApp(appName string) bool {
|
func canScaleApp(appName string) bool {
|
||||||
@@ -20,24 +19,6 @@ func canScaleApp(appName string) bool {
|
|||||||
return common.ToBool(canScale)
|
return common.ToBool(canScale)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getProcessStatus(appName string) map[string]string {
|
|
||||||
statuses := make(map[string]string)
|
|
||||||
containerFiles := common.ListFilesWithPrefix(common.AppRoot(appName), "CONTAINER.")
|
|
||||||
for _, filename := range containerFiles {
|
|
||||||
containerID := common.ReadFirstLine(filename)
|
|
||||||
containerStatus, _ := common.DockerInspect(containerID, "{{ .State.Status }}")
|
|
||||||
process := strings.TrimPrefix(filename, fmt.Sprintf("%s/CONTAINER.", common.AppRoot(appName)))
|
|
||||||
|
|
||||||
if containerStatus == "" {
|
|
||||||
containerStatus = "missing"
|
|
||||||
}
|
|
||||||
|
|
||||||
statuses[process] = fmt.Sprintf("%s (CID: %s)", containerStatus, containerID[0:11])
|
|
||||||
}
|
|
||||||
|
|
||||||
return statuses
|
|
||||||
}
|
|
||||||
|
|
||||||
func getProcfileCommand(procfilePath string, processType string, port int) (string, error) {
|
func getProcfileCommand(procfilePath string, processType string, port int) (string, error) {
|
||||||
if !common.FileExists(procfilePath) {
|
if !common.FileExists(procfilePath) {
|
||||||
return "", errors.New("No procfile found")
|
return "", errors.New("No procfile found")
|
||||||
@@ -229,11 +210,6 @@ func scaleReport(appName string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
common.LogInfo1Quiet(fmt.Sprintf("Scaling for %s", appName))
|
common.LogInfo1Quiet(fmt.Sprintf("Scaling for %s", appName))
|
||||||
config := columnize.DefaultConfig()
|
|
||||||
config.Delim = "="
|
|
||||||
config.Glue = ": "
|
|
||||||
config.Prefix = " "
|
|
||||||
config.Empty = ""
|
|
||||||
|
|
||||||
content := []string{}
|
content := []string{}
|
||||||
if os.Getenv("DOKKU_QUIET_OUTPUT") == "" {
|
if os.Getenv("DOKKU_QUIET_OUTPUT") == "" {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ require (
|
|||||||
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
|
github.com/dokku/dokku/plugins/config v0.0.0-00010101000000-000000000000
|
||||||
github.com/dokku/dokku/plugins/docker-options v0.0.0-00010101000000-000000000000
|
github.com/dokku/dokku/plugins/docker-options v0.0.0-00010101000000-000000000000
|
||||||
github.com/gofrs/flock v0.8.1
|
github.com/gofrs/flock v0.8.1
|
||||||
github.com/ryanuber/columnize v2.1.2+incompatible
|
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -26,6 +25,7 @@ require (
|
|||||||
github.com/otiai10/copy v1.14.0 // indirect
|
github.com/otiai10/copy v1.14.0 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pkg/sftp v1.13.5 // indirect
|
github.com/pkg/sftp v1.13.5 // indirect
|
||||||
|
github.com/ryanuber/columnize v2.1.2+incompatible // indirect
|
||||||
golang.org/x/crypto v0.19.0 // indirect
|
golang.org/x/crypto v0.19.0 // indirect
|
||||||
golang.org/x/sync v0.6.0 // indirect
|
golang.org/x/sync v0.6.0 // indirect
|
||||||
golang.org/x/sys v0.17.0 // indirect
|
golang.org/x/sys v0.17.0 // indirect
|
||||||
|
|||||||
Reference in New Issue
Block a user