-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve conflicts with restart policies
Signed-off-by: Tibor Vass <teabee89@gmail.com>
- Loading branch information
Showing
2 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,12 @@ import ( | |
) | ||
|
||
var ( | ||
ErrInvalidWorkingDirectory = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.") | ||
ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: --net=container can't be used with links. This would result in undefined behavior.") | ||
ErrConflictContainerNetworkAndDns = fmt.Errorf("Conflicting options: --net=container can't be used with --dns. This configuration is invalid.") | ||
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d") | ||
ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: -h and the network mode (--net)") | ||
ErrConflictHostNetworkAndDns = fmt.Errorf("Conflicting options: --net=host can't be used with --dns. This configuration is invalid.") | ||
ErrConflictHostNetworkAndLinks = fmt.Errorf("Conflicting options: --net=host can't be used with links. This would result in undefined behavior.") | ||
ErrConflictRestartPolicyAndAutoRemove = fmt.Errorf("Conflicting options: --restart and --rm") | ||
ErrInvalidWorkingDirectory = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.") | ||
ErrConflictContainerNetworkAndLinks = fmt.Errorf("Conflicting options: --net=container can't be used with links. This would result in undefined behavior.") | ||
ErrConflictContainerNetworkAndDns = fmt.Errorf("Conflicting options: --net=container can't be used with --dns. This configuration is invalid.") | ||
ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: -h and the network mode (--net)") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ketzacoatl
|
||
ErrConflictHostNetworkAndDns = fmt.Errorf("Conflicting options: --net=host can't be used with --dns. This configuration is invalid.") | ||
ErrConflictHostNetworkAndLinks = fmt.Errorf("Conflicting options: --net=host can't be used with links. This would result in undefined behavior.") | ||
) | ||
|
||
// FIXME Only used in tests | ||
|
@@ -247,10 +245,6 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf | |
return nil, nil, cmd, err | ||
} | ||
|
||
if *flAutoRemove && (restartPolicy.Name == "always" || restartPolicy.Name == "on-failure") { | ||
return nil, nil, cmd, ErrConflictRestartPolicyAndAutoRemove | ||
} | ||
|
||
config := &Config{ | ||
Hostname: hostname, | ||
Domainname: domainname, | ||
|
I just ran across this change. I do not understand why this is necessarily a conflict? Network and UTS are different namespaces. I see no reason why different containers can not have different names for the same IP, or different /etc/hosts contents, or different DNS resolvers.
Is there a reason for it? Fortunately we are not broken by it because we set hostname the same already (we set the field through the API without error), but it was surprising to at least one of our users.