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