Skip to content

Use spf13/cobra for docker update#23281

Merged
thaJeztah merged 1 commit intomoby:masterfrom
yongtang:23211-spf13-cobra-update
Jun 24, 2016
Merged

Use spf13/cobra for docker update#23281
thaJeztah merged 1 commit intomoby:masterfrom
yongtang:23211-spf13-cobra-update

Conversation

@yongtang
Copy link
Copy Markdown
Member

@yongtang yongtang commented Jun 5, 2016

This fix is part of the effort to convert commands to spf13/cobra #23211.

Thif fix coverted command docker update to use spf13/cobra

Signed-off-by: Yong Tang [email protected]

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Jun 6, 2016

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

sorry @yongtang, this one needs a rebase as well 😢

@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from e5a132e to ddc8984 Compare June 6, 2016 12:18
@yongtang
Copy link
Copy Markdown
Member Author

yongtang commented Jun 6, 2016

Thanks @thaJeztah. The PR has been rebased.

Comment thread api/client/container/update.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the pointer should stay the same 👼

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vdemeester. Are you referring to changing the fields of updateOptions to pointers and always prefix with fl (like old version) as below?

type updateOptions struct {
    flblkioWeight       *uint16
    flCPUPeriod         *int64
    flCPUQuota          *int64
        ...
 }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the Resources struct 👼

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change

Memory:            memory,

to

Memory:            flMemory,

?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CPUShares: *opts.cpuShares,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Let me update the pull request.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vdemeester the pointers has been changed and PR has been updated. Let me know if there are any issues.

@icecrime
Copy link
Copy Markdown
Contributor

icecrime commented Jun 6, 2016

What the?? On gccgo:

06:25:33 FAIL: docker_cli_help_test.go:15: TestHelpTextVerify.pN52_github_com_docker_docker_integration_cli.DockerSuite
06:25:33 
06:25:33 docker_cli_help_test.go:143:
06:25:33     c.Fatal(err)
06:25:33 ... Error: Error on "logout" help. non-empty stderr:"Aborted\n\npanic during panic\n\nruntime stack:\nstack trace unavailable\n"

@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from ddc8984 to da925d5 Compare June 7, 2016 02:01
@yongtang
Copy link
Copy Markdown
Member Author

yongtang commented Jun 7, 2016

Thanks @icecrime for the review. I am hoping the failure is a one-time failure but I will keep an eye on it in case it is repeatable.

@thaJeztah
Copy link
Copy Markdown
Member

ping @vdemeester PTAL

Comment thread api/client/container/update.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think pointer are needed there, just in the resource struct 👼

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vdemeester but if we don't use pointers like

blkioWeight       *uint16
...
cpuShares         *int64

here, we may not be able to reference pointers in resource

        BlkioWeight:       *opts.blkioWeight,
....
        CPUShares:         *opts.cpuShares,

as well?

Maybe I missed something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdemeester ping :)

@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch 2 times, most recently from 4f9cddd to 4d7d52a Compare June 11, 2016 21:27
@icecrime icecrime modified the milestone: 1.12.0 Jun 13, 2016
@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from 4d7d52a to 9ba56aa Compare June 14, 2016 02:07
@thaJeztah
Copy link
Copy Markdown
Member

Sorry @yongtang, this needs a rebase now 😢

@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from 9ba56aa to ea58396 Compare June 14, 2016 13:21
@yongtang
Copy link
Copy Markdown
Member Author

Thanks @thaJeztah the pull request has been rebased.

@yongtang
Copy link
Copy Markdown
Member Author

Ping @vdemeester @thaJeztah.

Comment thread api/client/container/update.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use flags.Uint16Var to avoid pointers. Take api/client/container/run.go as reference. Thanks!

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Jun 22, 2016

@yongtang Sorry for delay! Let me know if you want us to carry PR.

@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from ea58396 to 28ba5e7 Compare June 22, 2016 16:58
@yongtang
Copy link
Copy Markdown
Member Author

@LK4D4 Thanks for the review. I updated the pull request to change the blkioWeight in opts. Please let me know if there are any issues.

Comment thread api/client/container/update.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Var stuff for all options.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LK4D4 let me update the PR shortly.

This fix is part of the effort to convert commands to spf13/cobra moby#23211.

Thif fix coverted command `docker update` to use spf13/cobra

Signed-off-by: Yong Tang <[email protected]>
@yongtang yongtang force-pushed the 23211-spf13-cobra-update branch from 28ba5e7 to 9765593 Compare June 22, 2016 18:07
@yongtang
Copy link
Copy Markdown
Member Author

Thanks @LK4D4 The pull request has been updated. Please let me know if there are any other issues.

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Jun 22, 2016

@yongtang perfect! I'll merge if ci pass.

@vdemeester
Copy link
Copy Markdown
Member

LGTM 🐮 assuming it's green 😇

@dnephin dnephin added this to the 1.13.0 milestone Jun 22, 2016
@thaJeztah thaJeztah merged commit e5a8a77 into moby:master Jun 24, 2016
@yongtang yongtang deleted the 23211-spf13-cobra-update branch June 25, 2016 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants