refactor: drop old/upstream TODOs
This commit is contained in:
parent
e85117be22
commit
6a98024a2b
|
@ -72,8 +72,6 @@ func DeleteContext(name string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove any context that might be loaded
|
|
||||||
// TODO: Check if the context we are removing is the active one rather than doing it all the time
|
|
||||||
cfg := dConfig.LoadDefaultConfigFile(nil)
|
cfg := dConfig.LoadDefaultConfigFile(nil)
|
||||||
cfg.CurrentContext = ""
|
cfg.CurrentContext = ""
|
||||||
if err := cfg.Save(); err != nil {
|
if err := cfg.Save(); err != nil {
|
||||||
|
|
|
@ -26,7 +26,6 @@ func TestReadAppEnvFile(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetApp(t *testing.T) {
|
func TestGetApp(t *testing.T) {
|
||||||
// TODO: Test failures as well as successes
|
|
||||||
app, err := GetApp(expectedAppFiles, appName)
|
app, err := GetApp(expectedAppFiles, appName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
@ -74,7 +74,6 @@ func ReadSecretEnvVars(appEnv config.AppEnv) map[string]string {
|
||||||
return secretEnvVars
|
return secretEnvVars
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should probably go in the config/app package?
|
|
||||||
func ParseSecretEnvVarName(secretEnvVar string) string {
|
func ParseSecretEnvVarName(secretEnvVar string) string {
|
||||||
withoutPrefix := strings.TrimPrefix(secretEnvVar, "SECRET_")
|
withoutPrefix := strings.TrimPrefix(secretEnvVar, "SECRET_")
|
||||||
withoutSuffix := strings.TrimSuffix(withoutPrefix, "_VERSION")
|
withoutSuffix := strings.TrimSuffix(withoutPrefix, "_VERSION")
|
||||||
|
@ -83,7 +82,6 @@ func ParseSecretEnvVarName(secretEnvVar string) string {
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should probably go in the config/app package?
|
|
||||||
func ParseGeneratedSecretName(secret string, appEnv config.App) string {
|
func ParseGeneratedSecretName(secret string, appEnv config.App) string {
|
||||||
name := fmt.Sprintf("%s_", appEnv.StackName())
|
name := fmt.Sprintf("%s_", appEnv.StackName())
|
||||||
withoutAppName := strings.TrimPrefix(secret, name)
|
withoutAppName := strings.TrimPrefix(secret, name)
|
||||||
|
@ -93,7 +91,6 @@ func ParseGeneratedSecretName(secret string, appEnv config.App) string {
|
||||||
return parsed
|
return parsed
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should probably go in the config/app package?
|
|
||||||
func ParseSecretEnvVarValue(secret string) (secretValue, error) {
|
func ParseSecretEnvVarValue(secret string) (secretValue, error) {
|
||||||
values := strings.Split(secret, "#")
|
values := strings.Split(secret, "#")
|
||||||
if len(values) == 0 {
|
if len(values) == 0 {
|
||||||
|
|
|
@ -188,14 +188,14 @@ func ignorableCloseError(err error) bool {
|
||||||
func (c *commandConn) CloseRead() error {
|
func (c *commandConn) CloseRead() error {
|
||||||
// NOTE: maybe already closed here
|
// NOTE: maybe already closed here
|
||||||
if err := c.stdout.Close(); err != nil && !ignorableCloseError(err) {
|
if err := c.stdout.Close(); err != nil && !ignorableCloseError(err) {
|
||||||
// TODO: muted because https://github.com/docker/compose/issues/8544
|
// muted because https://github.com/docker/compose/issues/8544
|
||||||
// logrus.Warnf("commandConn.CloseRead: %v", err)
|
// logrus.Warnf("commandConn.CloseRead: %v", err)
|
||||||
}
|
}
|
||||||
c.stdioClosedMu.Lock()
|
c.stdioClosedMu.Lock()
|
||||||
c.stdoutClosed = true
|
c.stdoutClosed = true
|
||||||
c.stdioClosedMu.Unlock()
|
c.stdioClosedMu.Unlock()
|
||||||
if err := c.killIfStdioClosed(); err != nil {
|
if err := c.killIfStdioClosed(); err != nil {
|
||||||
// TODO: muted because https://github.com/docker/compose/issues/8544
|
// muted because https://github.com/docker/compose/issues/8544
|
||||||
// logrus.Warnf("commandConn.CloseRead: %v", err)
|
// logrus.Warnf("commandConn.CloseRead: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -212,14 +212,14 @@ func (c *commandConn) Read(p []byte) (int, error) {
|
||||||
func (c *commandConn) CloseWrite() error {
|
func (c *commandConn) CloseWrite() error {
|
||||||
// NOTE: maybe already closed here
|
// NOTE: maybe already closed here
|
||||||
if err := c.stdin.Close(); err != nil && !ignorableCloseError(err) {
|
if err := c.stdin.Close(); err != nil && !ignorableCloseError(err) {
|
||||||
// TODO: muted because https://github.com/docker/compose/issues/8544
|
// muted because https://github.com/docker/compose/issues/8544
|
||||||
// logrus.Warnf("commandConn.CloseWrite: %v", err)
|
// logrus.Warnf("commandConn.CloseWrite: %v", err)
|
||||||
}
|
}
|
||||||
c.stdioClosedMu.Lock()
|
c.stdioClosedMu.Lock()
|
||||||
c.stdinClosed = true
|
c.stdinClosed = true
|
||||||
c.stdioClosedMu.Unlock()
|
c.stdioClosedMu.Unlock()
|
||||||
if err := c.killIfStdioClosed(); err != nil {
|
if err := c.killIfStdioClosed(); err != nil {
|
||||||
// TODO: muted because https://github.com/docker/compose/issues/8544
|
// muted because https://github.com/docker/compose/issues/8544
|
||||||
// logrus.Warnf("commandConn.CloseWrite: %v", err)
|
// logrus.Warnf("commandConn.CloseWrite: %v", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -239,7 +239,7 @@ func (c *commandConn) Close() error {
|
||||||
logrus.Warnf("commandConn.Close: CloseRead: %v", err)
|
logrus.Warnf("commandConn.Close: CloseRead: %v", err)
|
||||||
}
|
}
|
||||||
if err = c.CloseWrite(); err != nil {
|
if err = c.CloseWrite(); err != nil {
|
||||||
// TODO: muted because https://github.com/docker/compose/issues/8544
|
// muted because https://github.com/docker/compose/issues/8544
|
||||||
// logrus.Warnf("commandConn.Close: CloseWrite: %v", err)
|
// logrus.Warnf("commandConn.Close: CloseWrite: %v", err)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -16,7 +16,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// The default escape key sequence: ctrl-p, ctrl-q
|
// The default escape key sequence: ctrl-p, ctrl-q
|
||||||
// TODO: This could be moved to `pkg/term`.
|
|
||||||
var defaultEscapeKeys = []byte{16, 17}
|
var defaultEscapeKeys = []byte{16, 17}
|
||||||
|
|
||||||
// A hijackedIOStreamer handles copying input to and output from streams to the
|
// A hijackedIOStreamer handles copying input to and output from streams to the
|
||||||
|
|
|
@ -399,7 +399,6 @@ func convertServiceNetworks(
|
||||||
return nets, nil
|
return nets, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fix secrets API so that SecretAPIClient is not required here
|
|
||||||
func convertServiceSecrets(
|
func convertServiceSecrets(
|
||||||
client client.SecretAPIClient,
|
client client.SecretAPIClient,
|
||||||
namespace Namespace,
|
namespace Namespace,
|
||||||
|
@ -442,8 +441,6 @@ func convertServiceSecrets(
|
||||||
// required by the serivce. Unlike convertServiceSecrets, this takes the whole
|
// required by the serivce. Unlike convertServiceSecrets, this takes the whole
|
||||||
// ServiceConfig, because some Configs may be needed as a result of other
|
// ServiceConfig, because some Configs may be needed as a result of other
|
||||||
// fields (like CredentialSpecs).
|
// fields (like CredentialSpecs).
|
||||||
//
|
|
||||||
// TODO: fix configs API so that ConfigsAPIClient is not required here
|
|
||||||
func convertServiceConfigObjs(
|
func convertServiceConfigObjs(
|
||||||
client client.ConfigAPIClient,
|
client client.ConfigAPIClient,
|
||||||
namespace Namespace,
|
namespace Namespace,
|
||||||
|
@ -626,7 +623,6 @@ func convertHealthcheck(healthcheck *composetypes.HealthCheckConfig) (*container
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertRestartPolicy(restart string, source *composetypes.RestartPolicy) (*swarm.RestartPolicy, error) {
|
func convertRestartPolicy(restart string, source *composetypes.RestartPolicy) (*swarm.RestartPolicy, error) {
|
||||||
// TODO: log if restart is being ignored
|
|
||||||
if source == nil {
|
if source == nil {
|
||||||
policy, err := opts.ParseRestartPolicy(restart)
|
policy, err := opts.ParseRestartPolicy(restart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -404,7 +404,6 @@ func deployServices(
|
||||||
|
|
||||||
// Stack deploy does not have a `--force` option. Preserve existing
|
// Stack deploy does not have a `--force` option. Preserve existing
|
||||||
// ForceUpdate value so that tasks are not re-deployed if not updated.
|
// ForceUpdate value so that tasks are not re-deployed if not updated.
|
||||||
// TODO move this to API client?
|
|
||||||
serviceSpec.TaskTemplate.ForceUpdate = service.Spec.TaskTemplate.ForceUpdate
|
serviceSpec.TaskTemplate.ForceUpdate = service.Spec.TaskTemplate.ForceUpdate
|
||||||
|
|
||||||
response, err := cl.ServiceUpdate(ctx, service.ID, service.Version, serviceSpec, updateOpts)
|
response, err := cl.ServiceUpdate(ctx, service.ID, service.Version, serviceSpec, updateOpts)
|
||||||
|
|
Loading…
Reference in New Issue