Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a no-ttl flag to etcdctl migrate to discard keys on transform. #6793

Merged
merged 1 commit into from
Nov 3, 2016

Conversation

timothysc
Copy link

Fixes: #6767

Adds a simple no-ttl flag to allow users to skip any ttl keys.

@xiang90
Copy link
Contributor

xiang90 commented Nov 3, 2016

@hongchaodeng Can you please review this?

@@ -42,6 +42,7 @@ import (
)

var (
migrateNoTTL bool
Copy link
Contributor

Choose a reason for hiding this comment

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

migrateExcludeTTLKey

@@ -55,6 +56,7 @@ func NewMigrateCommand() *cobra.Command {
Run: migrateCommandFunc,
}

mc.Flags().BoolVar(&migrateNoTTL, "no-ttl", false, "Do not convert TTL keys")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with the flag name.
Can you change the var to "migrateExcludeTTLKey"?

Copy link
Author

Choose a reason for hiding this comment

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

Sure.

@@ -311,6 +313,10 @@ func defaultTransformer() (io.WriteCloser, io.ReadCloser, chan error) {
return
}

if migrateExcludeTTLKey && node.TTL != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should move this to writeKey func, which emits the keys to transformer. or this flag only works for the default transformer.

@xiang90
Copy link
Contributor

xiang90 commented Nov 3, 2016

Please also change the commit message to ctlv3: Add a no-ttl flag to etcdctl migrate to discard keys on transform.

Or CI wont pass.

@xiang90
Copy link
Contributor

xiang90 commented Nov 3, 2016

LGTM. Will merge when CI turns green.

@wojtek-t
Copy link
Contributor

wojtek-t commented Nov 3, 2016

/cc me

@wojtek-t
Copy link
Contributor

wojtek-t commented Nov 3, 2016

@xiang90 - it seems that test passed

@xiang90 xiang90 merged commit b28b38f into etcd-io:master Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants