Skip to content

Move duration opts into an opts package#77

Merged
thaJeztah merged 1 commit into
docker:masterfrom
vdemeester:move-duration-opts
May 18, 2017
Merged

Move duration opts into an opts package#77
thaJeztah merged 1 commit into
docker:masterfrom
vdemeester:move-duration-opts

Conversation

@vdemeester
Copy link
Copy Markdown
Collaborator

They have nothing to do with service and could be used on their own.

🦁

– doing that because I wanted to re-use it without having to import/vendor service package.

Signed-off-by: Vincent Demeester vincent@sbr.pm

@mavenugo
Copy link
Copy Markdown
Contributor

@vdemeester should we consider moving the moby/opts package to docker/cli repo as part of the reorg effort ?

#62 is having a similar issue and @abhinandanpb decided to add the option as part of moby/opts to bring it back into docker/cli as part of the reorg. WDYT ?

@vdemeester
Copy link
Copy Markdown
Collaborator Author

@mavenugo yes, I think @dnephin opened an issue in moby/moby, moby/moby#33150. I'm assigning myself to it 😉

@dnephin
Copy link
Copy Markdown
Contributor

dnephin commented May 12, 2017

I agree with this change, but I think we should move in moby/moby/opts first, otherwise this is going to cause a bunch of conflicts

@vdemeester
Copy link
Copy Markdown
Collaborator Author

Discussed it with @dnephin, preparing a PR for the move of moby/moby/opts. I'll update this one after 👼

Comment thread opts/duration.go Outdated
)

// PositiveDurationOpt is an option type for time.Duration that uses a pointer.
// It bahave similarly to DurationOpt but only allows positive duration values.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"behave"

@aaronlehmann
Copy link
Copy Markdown

Seems okay as a temporary step, but I think it's better to remove DurationOpt and have PositiveDurationOpt wrap a time.Duration. I believe the original purpose of DurationOpt was to to distinguish a default value from one specified by the user, but now we use flags.Changed for that. We mix time.Duration with DurationOpt and it's a bit inconsistent.

However, if you do this, make sure it doesn't affect the CLI help output, because I remember there were some differences between how they format defaults. IIRC, flags.DurationVar will include the default in the help output if the default value is nonzero. We generally don't want this for service update, where it suggests that by default certain values on the service will be changed. I don't see any defaults passed to flags.DurationVar anymore, so this may not be an issue, but it's something to watch out for.

@vdemeester vdemeester force-pushed the move-duration-opts branch 3 times, most recently from 9389df1 to 7bd5712 Compare May 16, 2017 15:24
@vdemeester
Copy link
Copy Markdown
Collaborator Author

Updated and rebase 👼

Copy link
Copy Markdown
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

build is failing

Comment thread cli/command/service/opts.go Outdated
limitMemBytes opts.MemBytes
resCPU opts.NanoCPUs
resMemBytes opts.MemBytes
limitCPU dopts.NanoCPUs
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.

dopts doesn't exist

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yep, bad rebase 😝

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

should be fixed and green 📗

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.

lol, I was actually looking at that and scratching my head if I overlooked something 😄

They have nothing to do with service and could be used on their own.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@vdemeester vdemeester force-pushed the move-duration-opts branch from 7bd5712 to b5182ba Compare May 16, 2017 15:49
Copy link
Copy Markdown
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

@mavenugo mavenugo added this to the 17.06.0 milestone May 16, 2017
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

holding of merging, because there's some other PR's that are needed for 17.06, not sure if they're affected

@thaJeztah thaJeztah merged commit eea4a38 into docker:master May 18, 2017
@thaJeztah
Copy link
Copy Markdown
Member

removing the milestone, because I don't know if this ends up in 17.06 or 17.07

@thaJeztah thaJeztah removed this from the 17.06.0 milestone May 18, 2017
@vdemeester vdemeester deleted the move-duration-opts branch May 18, 2017 09:17
@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah added this to the 17.07.0 milestone Jul 21, 2017
nobiit pushed a commit to nobidev/docker-cli that referenced this pull request Nov 19, 2025
Add pigz to recommended packages
Upstream-commit: a6543ceeff408dfa9cbb4e75d013bc05bda09c32
Component: packaging
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.

6 participants