-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Simplify rollback arguments #3643
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
Simplify rollback arguments #3643
Conversation
pkg/cmd/cli/cmd/rollback.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this better, but it breaks existing scripts. @smarterclayton what's our stance on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't
On Jul 9, 2015, at 10:58 AM, David Eads [email protected] wrote:
In pkg/cmd/cli/cmd/rollback.go
#3643 (comment):
@@ -57,14 +60,14 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra
}cmd := &cobra.Command{
Use: "rollback DEPLOYMENT",Use: "rollback [dc/]config-name",
I like this better, but it breaks existing scripts. @smarterclayton
https://github.com/smarterclayton what's our stance on that?
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3643/files#r34264171.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't
@ironcladlou I'm not sure how you can distinguish the different cases (old arg versus new arg). Also, the fact that hack/test-cmd.sh didn't require any changes suggests this needs to be added there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can never change the syntax of this command? What is the proposed syntax that gets us to a place where we can accept a config? rollback --to-config=config --to-version=N (no arg[0]?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new flags, deprecate old ones, or allow a wider range of options. But
we must manage cli syntax change exactly like API or config change -
slowly, with explicit deprecation and management.
On Jul 9, 2015, at 12:52 PM, Dan Mace [email protected] wrote:
In pkg/cmd/cli/cmd/rollback.go
#3643 (comment):
@@ -57,14 +60,14 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra
}cmd := &cobra.Command{
Use: "rollback DEPLOYMENT",Use: "rollback [dc/]config-name",
We can never change the syntax of this command? What is the proposed syntax
that gets us to a place where we can accept a config? rollback
--to-config=config --to-version=N (no arg[0]?)
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/3643/files#r34276449.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what @deads2k and I are proposing now:
rollback <name>
We'll try and use <name> as an RC first, then a DC, and use whatever we find. The possibility of a DC and RC having the same name within a namespace seems extremely low, since RC names are <config-name>-<version>.
Both rc/ and dc/ prefixes would be supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's reasonable to me
53b1cc4 to
03a9d0e
Compare
|
Since this is a reasonably significant refactor, are you willing to follow the |
I'm not sure what pattern you're referring to. Details? |
pkg/cmd/cli/cmd/rollback.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't you just default to-version to 0 and then say that to-version=0 means auto-detect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right; changed this to always use the argument value (which defaults to 0) and updated the argument's description.
03a9d0e to
409faaf
Compare
+1 to this. Or at least factor out RunRollback. |
https://github.com/openshift/origin/pull/3470/files?short_path=6191d79#diff-6191d79908dca377719733511c6b39e9 - Check the Command Structure part |
https://github.com/openshift/origin/blob/master/pkg/cmd/cli/secrets/new.go |
87d1860 to
3ec1798
Compare
|
Re-re-factored... PTAL. |
3ec1798 to
7dfea81
Compare
|
Added basic test coverage in |
7dfea81 to
8a37aa1
Compare
pkg/cmd/cli/cmd/rollback.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit help text to say that this is ignored (invalid?) when specifying an rc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
07e143e to
b80d6f4
Compare
|
lgtm. Please open the issues before you merge so we don't lose track of them. |
Make the rollback command speak in terms of deployment configs and versions, instead of deployments which aren't formal API resources. This keeps the command consistent with other deployment related APIs and commands. Rollback now accepts a deployment config and version for the rollback target; if no version is supplied, the last completed deployment will be inferred.
b80d6f4 to
14c47aa
Compare
|
Okay, can somebody tag this? |
|
LGTM [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/2704/) (Image: devenv-fedora_1972) |
|
[Test]ing while waiting on the merge queue |
|
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/3595/) |
|
Evaluated for origin up to 14c47aa |
Merged by openshift-bot
Make the rollback command speak in terms of deployment configs and
versions, instead of deployments which aren't formal API resources.
This keeps the command consistent with other deployment related APIs
and commands.
Rollback now accepts a deployment config and version for the rollback
target; if no version is supplied, the last completed deployment will
be inferred.
Closes #3338