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

Support recovery from in the middle of a rename. #7620

Merged
merged 1 commit into from May 7, 2015

Conversation

brendandburns
Copy link
Contributor

Code written @ 12:30am on a plane. Treat with skepticisim...

(and don't merge yet, I want to add tests)

@j3ffml j3ffml self-assigned this May 1, 2015
@brendandburns
Copy link
Contributor Author

Ok, I added tests to validate this. Please review.

thanks!
--brendan

@j3ffml
Copy link
Contributor

j3ffml commented May 2, 2015

lgtm.

@j3ffml j3ffml added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 2, 2015
@@ -161,7 +171,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg

if len(args) >= 2 {
newName = args[1]
} else {
} else if oldRc != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, why would oldRc ever be nil here? If we didn't find it, wouldn't we would have returned already inside the block starting at 137?

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be time to break this function up. Too hard to follow the logic if you have to scroll thru multiple screen lengths.

@j3ffml j3ffml removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 2, 2015
@brendandburns
Copy link
Contributor Author

Addressed comments, and merged in retries changes. Please take another look.

Thanks!
--brendan

}

keepOldName := false
keepOldName := len(args) == 1
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 only be doing rename if --image was set. Rolling updates to an rc from filename should use the name from the schema file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, if len(args) == 1 and --image isn't set, it will error out earlier in validateArgs, but I'm happy to add an explicit check here if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see that check in validateArguments. Also, len(args) == 1 is expected for the --filename case, so that check wouldn't quite work. Just moving this assignment under the if len(image) != 0 block should suffice.

@j3ffml
Copy link
Contributor

j3ffml commented May 6, 2015

Some function references need fixing. From travis:

# github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd
_output/local/go/src/github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/rollingupdate_test.go:174: undefined: addDeploymentKeyToReplicationController
_output/local/go/src/github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/rollingupdate_test.go:264: undefined: updateWithRetries
FAIL    github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd [build failed]

@brendandburns
Copy link
Contributor Author

Ok, I think I forgot to push some pieces. Re-pushed, please take another look.

@j3ffml
Copy link
Contributor

j3ffml commented May 7, 2015

lgtm. will merge on green.

@j3ffml j3ffml added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2015
ArtfulCoder added a commit that referenced this pull request May 7, 2015
Support recovery from in the middle of a rename.
@ArtfulCoder ArtfulCoder merged commit 7b1e9ad into kubernetes:master May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants