fix: correct stickler issues
This commit is contained in:
@@ -395,7 +395,7 @@ func ReportSingleApp(reportType string, appName string, infoFlag string, infoFla
|
|||||||
strkeys[i] = keys[i].String()
|
strkeys[i] = keys[i].String()
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.New(fmt.Sprintf("Invalid flag passed, valid flags: %s", strings.Join(strkeys, ", ")))
|
return fmt.Errorf("Invalid flag passed, valid flags: %s", strings.Join(strkeys, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
// RightPad right-pads the string with pad up to len runes
|
// RightPad right-pads the string with pad up to len runes
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
columnize "github.com/ryanuber/columnize"
|
columnize "github.com/ryanuber/columnize"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// PortMap is a struct that contains a scheme:host-port:container-port mapping
|
||||||
type PortMap struct {
|
type PortMap struct {
|
||||||
ContainerPort int
|
ContainerPort int
|
||||||
HostPort int
|
HostPort int
|
||||||
@@ -167,7 +168,7 @@ func removeProxyPorts(appName string, proxyPortMap []PortMap) error {
|
|||||||
func parseProxyPortMapString(stringPortMap string) []PortMap {
|
func parseProxyPortMapString(stringPortMap string) []PortMap {
|
||||||
var proxyPortMap []PortMap
|
var proxyPortMap []PortMap
|
||||||
|
|
||||||
for _, v := range strings.Split(strings.TrimSpace(stringPortMap), "") {
|
for _, v := range strings.Split(strings.TrimSpace(stringPortMap), " ") {
|
||||||
parts := strings.SplitN(v, ":", 3)
|
parts := strings.SplitN(v, ":", 3)
|
||||||
if len(parts) != 3 {
|
if len(parts) != 3 {
|
||||||
common.LogWarn(fmt.Sprintf("Invalid port map %s", v))
|
common.LogWarn(fmt.Sprintf("Invalid port map %s", v))
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ func CommandSet(args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(appName) < 2 {
|
if len(appName) < 2 {
|
||||||
return errors.New("Please specify a proxy type!")
|
return errors.New("Please specify a proxy type")
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyType := args[1]
|
proxyType := args[1]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/dokku/dokku/plugins/config"
|
"github.com/dokku/dokku/plugins/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TriggerProxyIsEnabled prints true or false depending on whether the proxy is enabled
|
||||||
func TriggerProxyIsEnabled(appName string) error {
|
func TriggerProxyIsEnabled(appName string) error {
|
||||||
if IsAppProxyEnabled(appName) {
|
if IsAppProxyEnabled(appName) {
|
||||||
fmt.Println("true")
|
fmt.Println("true")
|
||||||
@@ -16,6 +17,7 @@ func TriggerProxyIsEnabled(appName string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TriggerProxyType prints out the current proxy type, defaulting to nginx
|
||||||
func TriggerProxyType(appName string) error {
|
func TriggerProxyType(appName string) error {
|
||||||
proxyType := getAppProxyType(appName)
|
proxyType := getAppProxyType(appName)
|
||||||
fmt.Println(proxyType)
|
fmt.Println(proxyType)
|
||||||
@@ -23,6 +25,7 @@ func TriggerProxyType(appName string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TriggerPostCertsRemove unsets port config vars after SSL cert is added
|
||||||
func TriggerPostCertsRemove(appName string) error {
|
func TriggerPostCertsRemove(appName string) error {
|
||||||
keys := []string{"DOKKU_PROXY_SSL_PORT"}
|
keys := []string{"DOKKU_PROXY_SSL_PORT"}
|
||||||
if err := config.UnsetMany(appName, keys, false); err != nil {
|
if err := config.UnsetMany(appName, keys, false); err != nil {
|
||||||
@@ -32,7 +35,7 @@ func TriggerPostCertsRemove(appName string) error {
|
|||||||
return removeProxyPorts(appName, filterAppProxyPorts(appName, "https", 443))
|
return removeProxyPorts(appName, filterAppProxyPorts(appName, "https", 443))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TriggerPostCertsUpdate unsets port config vars after SSL cert is added
|
// TriggerPostCertsUpdate sets port config vars after SSL cert is added
|
||||||
func TriggerPostCertsUpdate(appName string) error {
|
func TriggerPostCertsUpdate(appName string) error {
|
||||||
port := config.GetWithDefault(appName, "DOKKU_PROXY_PORT", "")
|
port := config.GetWithDefault(appName, "DOKKU_PROXY_PORT", "")
|
||||||
sslPort := config.GetWithDefault(appName, "DOKKU_PROXY_SSL_PORT", "")
|
sslPort := config.GetWithDefault(appName, "DOKKU_PROXY_SSL_PORT", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user