зеркало из https://github.com/microsoft/docker.git
Expose ParseRestartPolicy
ParseRestartPolicy is useful function for third party go programs to use so that they can parse the restart policy in the same way that Docker does Signed-off-by: Darren Shepherd <darren@rancher.com>
This commit is contained in:
Родитель
03719be830
Коммит
366ee6bdfa
|
@ -277,7 +277,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
|
|||
return nil, nil, cmd, fmt.Errorf("--net: invalid net mode: %v", err)
|
||||
}
|
||||
|
||||
restartPolicy, err := parseRestartPolicy(*flRestartPolicy)
|
||||
restartPolicy, err := ParseRestartPolicy(*flRestartPolicy)
|
||||
if err != nil {
|
||||
return nil, nil, cmd, err
|
||||
}
|
||||
|
@ -374,8 +374,8 @@ func convertKVStringsToMap(values []string) map[string]string {
|
|||
return result
|
||||
}
|
||||
|
||||
// parseRestartPolicy returns the parsed policy or an error indicating what is incorrect
|
||||
func parseRestartPolicy(policy string) (RestartPolicy, error) {
|
||||
// ParseRestartPolicy returns the parsed policy or an error indicating what is incorrect
|
||||
func ParseRestartPolicy(policy string) (RestartPolicy, error) {
|
||||
p := RestartPolicy{}
|
||||
|
||||
if policy == "" {
|
||||
|
|
Загрузка…
Ссылка в новой задаче