Skip to content

Use spf13/cobra for docker import#23269

Merged
thaJeztah merged 3 commits intomoby:masterfrom
vdemeester:migrate-import-to-cobra
Jun 7, 2016
Merged

Use spf13/cobra for docker import#23269
thaJeztah merged 3 commits intomoby:masterfrom
vdemeester:migrate-import-to-cobra

Conversation

@vdemeester
Copy link
Copy Markdown
Member

Moves import command to api/client/image/import.go and use cobra 🐍.

/cc @dnephin @thaJeztah @LK4D4 @cpuguy83

🐸

Signed-off-by: Vincent Demeester [email protected]

@vdemeester vdemeester added the area/cli Client label Jun 5, 2016
@vdemeester vdemeester added this to the 1.12.0 milestone Jun 5, 2016
@dnephin dnephin mentioned this pull request Jun 5, 2016
43 tasks
@vdemeester vdemeester added the status/failing-ci Indicates that the PR in its current state fails the test suite label Jun 5, 2016
@vdemeester
Copy link
Copy Markdown
Member Author

Hum… there is a weird error on DockerSuite.TestEventsImageImport... looking into it

Comment thread api/client/image/import.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.

min args is set to 1, but it looks like this assumes 2.

I think this needs if len(args) > 1

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.

Yeah definitely.

@vdemeester vdemeester force-pushed the migrate-import-to-cobra branch from 93de9af to 54575ed Compare June 5, 2016 17:08
@vdemeester
Copy link
Copy Markdown
Member Author

Hum, so cobra is eating - arguments (without saying anything which is worrying me a bit) and thus docker import - is failing with "… requires a last 1 argument(s)".

/cc @dnephin

@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 5, 2016

@vdemeester
Copy link
Copy Markdown
Member Author

@dnephin yeah I was looking into that. Note that it's just the "args" passed on the Args function of the command. The "args" passed to the Run are ok ; I'll update the PR with a small temporary fix

@vdemeester vdemeester force-pushed the migrate-import-to-cobra branch 2 times, most recently from ea61385 to 7622fbf Compare June 5, 2016 18:11
Comment thread api/client/image/import.go Outdated
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.

Added a FIXME 👼

@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Jun 5, 2016
@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 5, 2016

@vdemeester I pushed a fix for this. If you update the vendor to 3bfe23ade4a4657b00fb065297461ee282dfb822 it should work correctly.

The fix is here: spf13/cobra@c76d2fa

@vdemeester
Copy link
Copy Markdown
Member Author

@dnephin are you sure on the hash, it removes the SetFlagErrorFunc function and such 😓

@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 5, 2016

hmm, it shouldn't remove anything.

Try 75205f23b3ea70dc7ae5e900d074e010c23c37e9. I rebased it on spf13/master again.

This should be right: https://github.com/dnephin/cobra/commits/fork

@vdemeester vdemeester force-pushed the migrate-import-to-cobra branch from 7622fbf to 52d2c26 Compare June 6, 2016 08:42
@vdemeester vdemeester force-pushed the migrate-import-to-cobra branch from 52d2c26 to 040e6eb Compare June 6, 2016 10:04
@thaJeztah
Copy link
Copy Markdown
Member

ping @vdemeester this needs a rebase now 😢

@vdemeester vdemeester force-pushed the migrate-import-to-cobra branch from 660f875 to 7878705 Compare June 6, 2016 11:58
@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 6, 2016

LGTM

Comment thread hack/vendor.sh

# cli
clone git github.com/spf13/cobra acf60156558542e78c6f3695f74b0f871614ff55 https://github.com/dnephin/cobra.git
clone git github.com/spf13/cobra 75205f23b3ea70dc7ae5e900d074e010c23c37e9 https://github.com/dnephin/cobra.git
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.

should we put this fork under the "docker" organization if we're unsure our changes get accepted before 1.12?

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.

ping @dnephin I would be fine for it 👼

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.

That would be fine with me. There seems to be very little activity on my PRs, so I think it's unlikely they will be merged before 1.12.

@thaJeztah
Copy link
Copy Markdown
Member

LGTM, thanks!

@thaJeztah thaJeztah merged commit f061f55 into moby:master Jun 7, 2016
@vdemeester vdemeester deleted the migrate-import-to-cobra branch June 7, 2016 11:07
yongtang added a commit to yongtang/docker that referenced this pull request Jun 7, 2016
At the time the pull request:

Use spf13/cobra for docker rename moby#23290

was created, there was an issue in cobra so the test
`DockerSuite.TestRenameInvalidName` was updated.

Now the issue in cobra has been fixed in:
Use spf13/cobra for docker import moby#23269

so the test related to  `docker rename`
(`DockerSuite.TestRenameInvalidName`) needs to be reverted back.

This fix is related to spf13/cobra moby#23211.

Signed-off-by: Yong Tang <[email protected]>
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
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.

4 participants