Skip to content

Commit

Permalink
Merge pull request #10599 from juanvallejo/jvallejo_update-dry-run-cr…
Browse files Browse the repository at this point in the history
…eate-resource-quota

Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Oct 21, 2016
2 parents 34984fc + b53abc4 commit 2dccff1
Show file tree
Hide file tree
Showing 53 changed files with 261 additions and 149 deletions.
17 changes: 17 additions & 0 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -11877,9 +11877,26 @@ _oc_rollout_latest()

flags+=("--again")
local_nonpersistent_flags+=("--again")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
Expand Down
17 changes: 17 additions & 0 deletions contrib/completions/bash/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -16526,9 +16526,26 @@ _openshift_cli_rollout_latest()

flags+=("--again")
local_nonpersistent_flags+=("--again")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
Expand Down
17 changes: 17 additions & 0 deletions contrib/completions/zsh/oc
Original file line number Diff line number Diff line change
Expand Up @@ -12038,9 +12038,26 @@ _oc_rollout_latest()

flags+=("--again")
local_nonpersistent_flags+=("--again")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
Expand Down
17 changes: 17 additions & 0 deletions contrib/completions/zsh/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -16687,9 +16687,26 @@ _openshift_cli_rollout_latest()

flags+=("--again")
local_nonpersistent_flags+=("--again")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
Expand Down
34 changes: 33 additions & 1 deletion docs/man/man1/oc-rollout-latest.1
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,41 @@ This command is appropriate for running manual rollouts. If you want full contro
\fB\-\-again\fP=false
Deploy the current pod template without updating state from triggers

.PP
\fB\-\-dry\-run\fP=false
If true, only print the object that would be sent, without sending it.

.PP
\fB\-\-no\-headers\fP=false
When using the default or custom\-column output format, don't print headers.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name).
Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].

.PP
\fB\-\-output\-version\fP=""
Output the formatted object with the given group version (for ex: 'extensions/v1beta1').

.PP
\fB\-a\fP, \fB\-\-show\-all\fP=true
When printing, show all resources (false means hide terminated pods.)

.PP
\fB\-\-show\-labels\fP=false
When printing, show all labels as the last column (default hide labels column)

.PP
\fB\-\-sort\-by\fP=""
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.

.PP
\fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].


.SH OPTIONS INHERITED FROM PARENT COMMANDS
Expand Down
34 changes: 33 additions & 1 deletion docs/man/man1/openshift-cli-rollout-latest.1
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,41 @@ This command is appropriate for running manual rollouts. If you want full contro
\fB\-\-again\fP=false
Deploy the current pod template without updating state from triggers

.PP
\fB\-\-dry\-run\fP=false
If true, only print the object that would be sent, without sending it.

.PP
\fB\-\-no\-headers\fP=false
When using the default or custom\-column output format, don't print headers.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name).
Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].

.PP
\fB\-\-output\-version\fP=""
Output the formatted object with the given group version (for ex: 'extensions/v1beta1').

.PP
\fB\-a\fP, \fB\-\-show\-all\fP=true
When printing, show all resources (false means hide terminated pods.)

.PP
\fB\-\-show\-labels\fP=false
When printing, show all labels as the last column (default hide labels column)

.PP
\fB\-\-sort\-by\fP=""
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.

.PP
\fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].


.SH OPTIONS INHERITED FROM PARENT COMMANDS
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/admin/migrate/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (o *ResourceVisitor) Visit(fn MigrateVisitFunc) error {

if summarize {
if dryRun {
fmt.Fprintf(out, "summary (DRY RUN): total=%d errors=%d ignored=%d unchanged=%d migrated=%d\n", t.found, t.errors, t.ignored, t.unchanged, t.found-t.errors-t.unchanged-t.ignored)
fmt.Fprintf(out, "summary (dry run): total=%d errors=%d ignored=%d unchanged=%d migrated=%d\n", t.found, t.errors, t.ignored, t.unchanged, t.found-t.errors-t.unchanged-t.ignored)
} else {
fmt.Fprintf(out, "summary: total=%d errors=%d ignored=%d unchanged=%d migrated=%d\n", t.found, t.errors, t.ignored, t.unchanged, t.found-t.errors-t.unchanged-t.ignored)
}
Expand Down Expand Up @@ -403,7 +403,7 @@ func (t *migrateTracker) attempt(info *resource.Info, retries int) {
case result == attemptResultSuccess:
if glog.V(1) {
if t.dryRun {
t.report("migrated (DRY RUN):", info, nil)
t.report("migrated (dry run):", info, nil)
} else {
t.report("migrated:", info, nil)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cli/cmd/cancelbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error {
}

resource, name, _ := cmdutil.ResolveResource(buildapi.Resource("builds"), build.Name, o.Mapper)
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, "cancelled")
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, false, "cancelled")
}(b)
}
wg.Wait()
Expand All @@ -248,7 +248,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error {
continue
}
resource, name, _ := cmdutil.ResolveResource(buildapi.Resource("builds"), build.Name, o.Mapper)
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, fmt.Sprintf("restarted build %q", b.Name))
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, false, fmt.Sprintf("restarted build %q", b.Name))
}
}

Expand Down
7 changes: 1 addition & 6 deletions pkg/cmd/cli/cmd/create/clusterquota.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ func (o *CreateClusterQuotaOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}

cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "clusterquota", actualObj.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "clusterquota", actualObj.Name, o.DryRun, "created")
return nil
}

Expand Down
7 changes: 1 addition & 6 deletions pkg/cmd/cli/cmd/create/deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,7 @@ func (o *CreateDeploymentConfigOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}

cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "deploymentconfig", actualObj.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "deploymentconfig", actualObj.Name, o.DryRun, "created")
return nil
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/cmd/cli/cmd/create/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,7 @@ func (o *CreateIdentityOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "identity", actualIdentity.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "identity", actualIdentity.Name, o.DryRun, "created")
return nil
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/cmd/cli/cmd/create/imagestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ func (o *CreateImageStreamOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "imagestream", actualObj.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "imagestream", actualObj.Name, o.DryRun, "created")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cli/cmd/create/policy_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (o *CreatePolicyBindingOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "policybinding", actualBinding.Name, "created")
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "policybinding", actualBinding.Name, false, "created")
return nil
}

Expand Down
21 changes: 3 additions & 18 deletions pkg/cmd/cli/cmd/create/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,8 @@ func CreateEdgeRoute(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, ar
return err
}

created := "created"
if dryRun {
created = "created (DRY RUN)"
}

shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
return nil
}

Expand Down Expand Up @@ -258,13 +253,8 @@ func CreatePassthroughRoute(f *clientcmd.Factory, out io.Writer, cmd *cobra.Comm
return err
}

created := "created"
if dryRun {
created = "created (DRY RUN)"
}

shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
return nil
}

Expand Down Expand Up @@ -389,13 +379,8 @@ func CreateReencryptRoute(f *clientcmd.Factory, out io.Writer, cmd *cobra.Comman
return err
}

created := "created"
if dryRun {
created = "created (DRY RUN)"
}

shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
return nil
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/cmd/cli/cmd/create/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,7 @@ func (o *CreateUserOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "user", actualUser.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "user", actualUser.Name, o.DryRun, "created")
return nil
}

Expand Down
6 changes: 1 addition & 5 deletions pkg/cmd/cli/cmd/create/user_identity_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ func (o *CreateUserIdentityMappingOptions) Run() error {
}

if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
created := "created"
if o.DryRun {
created = "created (DRY RUN)"
}
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "useridentitymapping", actualMapping.Name, created)
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "useridentitymapping", actualMapping.Name, o.DryRun, "created")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cli/cmd/idle.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ func (o *IdleOptions) RunIdle(f *clientcmd.Factory) error {
}
}

fmt.Fprintf(o.out, "Idled %s %s/%s\n", scaleRef.Kind, info.namespace, scaleRef.Name)
fmt.Fprintf(o.out, "Idled %s %s/%s (dry run)\n", scaleRef.Kind, info.namespace, scaleRef.Name)
}

if hadError {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/cli/cmd/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ func (o *RollbackOptions) Run() error {
return err
}
o.out.Write([]byte(description))
fmt.Fprintf(o.out, "%s\n", "(dry run)")
return nil
}

Expand Down
Loading

0 comments on commit 2dccff1

Please sign in to comment.