@@ -70,30 +70,30 @@ func (cli *DockerCli) CmdFipRelease(args ...string) error {
7070 return nil
7171}
7272
73- // CmdFipAssociate connects a container to a floating IP
73+ // CmdFipAttach connects a container to a floating IP
7474//
75- // Usage: docker fip associate [OPTIONS] <FIP> <CONTAINER>
76- func (cli * DockerCli ) CmdFipAssociate (args ... string ) error {
77- cmd := Cli .Subcmd ("fip associate " , []string {"FIP CONTAINER" }, "Connects a container to a floating IP" , false )
75+ // Usage: docker fip attach [OPTIONS] <FIP> <CONTAINER>
76+ func (cli * DockerCli ) CmdFipAttach (args ... string ) error {
77+ cmd := Cli .Subcmd ("fip attach " , []string {"FIP CONTAINER" }, "Connects a container to a floating IP" , false )
7878 cmd .Require (flag .Min , 2 )
7979 if err := cmd .ParseFlags (args , true ); err != nil {
8080 return err
8181 }
82- return cli .client .FipAssociate (context .Background (), cmd .Arg (0 ), cmd .Arg (1 ))
82+ return cli .client .FipAttach (context .Background (), cmd .Arg (0 ), cmd .Arg (1 ))
8383}
8484
85- // CmdFipDisassociate disconnects a container from a floating IP
85+ // CmdFipDetach disconnects a container from a floating IP
8686//
87- // Usage: docker fip disassociate <CONTAINER>
88- func (cli * DockerCli ) CmdFipDisassociate (args ... string ) error {
89- cmd := Cli .Subcmd ("fip disassociate " , []string {"CONTAINER" }, "Disconnects container from a floating IP" , false )
87+ // Usage: docker fip detach <CONTAINER>
88+ func (cli * DockerCli ) CmdFipDetach (args ... string ) error {
89+ cmd := Cli .Subcmd ("fip detach " , []string {"CONTAINER" }, "Disconnects container from a floating IP" , false )
9090 //force := cmd.Bool([]string{"f", "-force"}, false, "Force the container to disconnect from a floating IP")
9191 cmd .Require (flag .Exact , 1 )
9292 if err := cmd .ParseFlags (args , true ); err != nil {
9393 return err
9494 }
9595
96- ip , err := cli .client .FipDisassociate (context .Background (), cmd .Arg (0 ))
96+ ip , err := cli .client .FipDetach (context .Background (), cmd .Arg (0 ))
9797 if err != nil {
9898 return err
9999 }
@@ -147,8 +147,8 @@ func (cli *DockerCli) CmdFipLs(args ...string) error {
147147func fipUsage () string {
148148 fipCommands := [][]string {
149149 {"allocate" , "Allocate a or some IPs" },
150- {"associate " , "Associate floating IP to container" },
151- {"disassociate " , "Disassociate floating IP from conainer" },
150+ {"attach " , "Attach floating IP to container" },
151+ {"detach " , "Detach floating IP from conainer" },
152152 {"ls" , "List all floating IPs" },
153153 {"release" , "Release a floating IP" },
154154 }
@@ -163,15 +163,15 @@ func fipUsage() string {
163163 return help
164164}
165165
166- // Allocate and associate a fip
166+ // Allocate and attach a fip
167167func (cli * DockerCli ) associateNewFip (ctx context.Context , contID string ) (string , error ) {
168168 fips , err := cli .client .FipAllocate (ctx , "1" )
169169 if err != nil {
170170 return "" , err
171171 }
172172
173173 for _ , ip := range fips {
174- err = cli .client .FipAssociate (ctx , ip , contID )
174+ err = cli .client .FipAttach (ctx , ip , contID )
175175 if err != nil {
176176 go func () {
177177 cli .client .FipRelease (ctx , ip )
@@ -189,9 +189,9 @@ func (cli *DockerCli) releaseFip(ctx context.Context, ip string) error {
189189 return cli .client .FipRelease (ctx , ip )
190190}
191191
192- // Disassociate and release a fip
192+ // Detach and release a fip
193193func (cli * DockerCli ) releaseContainerFip (ctx context.Context , contID string ) error {
194- ip , err := cli .client .FipDisassociate (ctx , contID )
194+ ip , err := cli .client .FipDetach (ctx , contID )
195195 if err != nil {
196196 return err
197197 }
0 commit comments