Skip to content

Commit 2dccff1

Browse files
author
OpenShift Bot
authored
Merge pull request #10599 from juanvallejo/jvallejo_update-dry-run-create-resource-quota
Merged by openshift-bot
2 parents 34984fc + b53abc4 commit 2dccff1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+261
-149
lines changed

contrib/completions/bash/oc

+17
Original file line numberDiff line numberDiff line change
@@ -11877,9 +11877,26 @@ _oc_rollout_latest()
1187711877

1187811878
flags+=("--again")
1187911879
local_nonpersistent_flags+=("--again")
11880+
flags+=("--dry-run")
11881+
local_nonpersistent_flags+=("--dry-run")
11882+
flags+=("--no-headers")
11883+
local_nonpersistent_flags+=("--no-headers")
1188011884
flags+=("--output=")
1188111885
two_word_flags+=("-o")
1188211886
local_nonpersistent_flags+=("--output=")
11887+
flags+=("--output-version=")
11888+
local_nonpersistent_flags+=("--output-version=")
11889+
flags+=("--show-all")
11890+
flags+=("-a")
11891+
local_nonpersistent_flags+=("--show-all")
11892+
flags+=("--show-labels")
11893+
local_nonpersistent_flags+=("--show-labels")
11894+
flags+=("--sort-by=")
11895+
local_nonpersistent_flags+=("--sort-by=")
11896+
flags+=("--template=")
11897+
flags_with_completion+=("--template")
11898+
flags_completion+=("_filedir")
11899+
local_nonpersistent_flags+=("--template=")
1188311900
flags+=("--as=")
1188411901
flags+=("--certificate-authority=")
1188511902
flags_with_completion+=("--certificate-authority")

contrib/completions/bash/openshift

+17
Original file line numberDiff line numberDiff line change
@@ -16526,9 +16526,26 @@ _openshift_cli_rollout_latest()
1652616526

1652716527
flags+=("--again")
1652816528
local_nonpersistent_flags+=("--again")
16529+
flags+=("--dry-run")
16530+
local_nonpersistent_flags+=("--dry-run")
16531+
flags+=("--no-headers")
16532+
local_nonpersistent_flags+=("--no-headers")
1652916533
flags+=("--output=")
1653016534
two_word_flags+=("-o")
1653116535
local_nonpersistent_flags+=("--output=")
16536+
flags+=("--output-version=")
16537+
local_nonpersistent_flags+=("--output-version=")
16538+
flags+=("--show-all")
16539+
flags+=("-a")
16540+
local_nonpersistent_flags+=("--show-all")
16541+
flags+=("--show-labels")
16542+
local_nonpersistent_flags+=("--show-labels")
16543+
flags+=("--sort-by=")
16544+
local_nonpersistent_flags+=("--sort-by=")
16545+
flags+=("--template=")
16546+
flags_with_completion+=("--template")
16547+
flags_completion+=("_filedir")
16548+
local_nonpersistent_flags+=("--template=")
1653216549
flags+=("--as=")
1653316550
flags+=("--certificate-authority=")
1653416551
flags_with_completion+=("--certificate-authority")

contrib/completions/zsh/oc

+17
Original file line numberDiff line numberDiff line change
@@ -12038,9 +12038,26 @@ _oc_rollout_latest()
1203812038

1203912039
flags+=("--again")
1204012040
local_nonpersistent_flags+=("--again")
12041+
flags+=("--dry-run")
12042+
local_nonpersistent_flags+=("--dry-run")
12043+
flags+=("--no-headers")
12044+
local_nonpersistent_flags+=("--no-headers")
1204112045
flags+=("--output=")
1204212046
two_word_flags+=("-o")
1204312047
local_nonpersistent_flags+=("--output=")
12048+
flags+=("--output-version=")
12049+
local_nonpersistent_flags+=("--output-version=")
12050+
flags+=("--show-all")
12051+
flags+=("-a")
12052+
local_nonpersistent_flags+=("--show-all")
12053+
flags+=("--show-labels")
12054+
local_nonpersistent_flags+=("--show-labels")
12055+
flags+=("--sort-by=")
12056+
local_nonpersistent_flags+=("--sort-by=")
12057+
flags+=("--template=")
12058+
flags_with_completion+=("--template")
12059+
flags_completion+=("_filedir")
12060+
local_nonpersistent_flags+=("--template=")
1204412061
flags+=("--as=")
1204512062
flags+=("--certificate-authority=")
1204612063
flags_with_completion+=("--certificate-authority")

contrib/completions/zsh/openshift

+17
Original file line numberDiff line numberDiff line change
@@ -16687,9 +16687,26 @@ _openshift_cli_rollout_latest()
1668716687

1668816688
flags+=("--again")
1668916689
local_nonpersistent_flags+=("--again")
16690+
flags+=("--dry-run")
16691+
local_nonpersistent_flags+=("--dry-run")
16692+
flags+=("--no-headers")
16693+
local_nonpersistent_flags+=("--no-headers")
1669016694
flags+=("--output=")
1669116695
two_word_flags+=("-o")
1669216696
local_nonpersistent_flags+=("--output=")
16697+
flags+=("--output-version=")
16698+
local_nonpersistent_flags+=("--output-version=")
16699+
flags+=("--show-all")
16700+
flags+=("-a")
16701+
local_nonpersistent_flags+=("--show-all")
16702+
flags+=("--show-labels")
16703+
local_nonpersistent_flags+=("--show-labels")
16704+
flags+=("--sort-by=")
16705+
local_nonpersistent_flags+=("--sort-by=")
16706+
flags+=("--template=")
16707+
flags_with_completion+=("--template")
16708+
flags_completion+=("_filedir")
16709+
local_nonpersistent_flags+=("--template=")
1669316710
flags+=("--as=")
1669416711
flags+=("--certificate-authority=")
1669516712
flags_with_completion+=("--certificate-authority")

docs/man/man1/oc-rollout-latest.1

+33-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,41 @@ This command is appropriate for running manual rollouts. If you want full contro
2424
\fB\-\-again\fP=false
2525
Deploy the current pod template without updating state from triggers
2626

27+
.PP
28+
\fB\-\-dry\-run\fP=false
29+
If true, only print the object that would be sent, without sending it.
30+
31+
.PP
32+
\fB\-\-no\-headers\fP=false
33+
When using the default or custom\-column output format, don't print headers.
34+
2735
.PP
2836
\fB\-o\fP, \fB\-\-output\fP=""
29-
Output mode. Use "\-o name" for shorter output (resource/name).
37+
Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
38+
\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
39+
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
40+
\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
41+
42+
.PP
43+
\fB\-\-output\-version\fP=""
44+
Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
45+
46+
.PP
47+
\fB\-a\fP, \fB\-\-show\-all\fP=true
48+
When printing, show all resources (false means hide terminated pods.)
49+
50+
.PP
51+
\fB\-\-show\-labels\fP=false
52+
When printing, show all labels as the last column (default hide labels column)
53+
54+
.PP
55+
\fB\-\-sort\-by\fP=""
56+
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.
57+
58+
.PP
59+
\fB\-\-template\fP=""
60+
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
61+
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
3062

3163

3264
.SH OPTIONS INHERITED FROM PARENT COMMANDS

docs/man/man1/openshift-cli-rollout-latest.1

+33-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,41 @@ This command is appropriate for running manual rollouts. If you want full contro
2424
\fB\-\-again\fP=false
2525
Deploy the current pod template without updating state from triggers
2626

27+
.PP
28+
\fB\-\-dry\-run\fP=false
29+
If true, only print the object that would be sent, without sending it.
30+
31+
.PP
32+
\fB\-\-no\-headers\fP=false
33+
When using the default or custom\-column output format, don't print headers.
34+
2735
.PP
2836
\fB\-o\fP, \fB\-\-output\fP=""
29-
Output mode. Use "\-o name" for shorter output (resource/name).
37+
Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
38+
\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
39+
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
40+
\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
41+
42+
.PP
43+
\fB\-\-output\-version\fP=""
44+
Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
45+
46+
.PP
47+
\fB\-a\fP, \fB\-\-show\-all\fP=true
48+
When printing, show all resources (false means hide terminated pods.)
49+
50+
.PP
51+
\fB\-\-show\-labels\fP=false
52+
When printing, show all labels as the last column (default hide labels column)
53+
54+
.PP
55+
\fB\-\-sort\-by\fP=""
56+
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.
57+
58+
.PP
59+
\fB\-\-template\fP=""
60+
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
61+
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
3062

3163

3264
.SH OPTIONS INHERITED FROM PARENT COMMANDS

pkg/cmd/admin/migrate/migrator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (o *ResourceVisitor) Visit(fn MigrateVisitFunc) error {
289289

290290
if summarize {
291291
if dryRun {
292-
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)
292+
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)
293293
} else {
294294
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)
295295
}
@@ -403,7 +403,7 @@ func (t *migrateTracker) attempt(info *resource.Info, retries int) {
403403
case result == attemptResultSuccess:
404404
if glog.V(1) {
405405
if t.dryRun {
406-
t.report("migrated (DRY RUN):", info, nil)
406+
t.report("migrated (dry run):", info, nil)
407407
} else {
408408
t.report("migrated:", info, nil)
409409
}

pkg/cmd/cli/cmd/cancelbuild.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error {
234234
}
235235

236236
resource, name, _ := cmdutil.ResolveResource(buildapi.Resource("builds"), build.Name, o.Mapper)
237-
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, "cancelled")
237+
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, false, "cancelled")
238238
}(b)
239239
}
240240
wg.Wait()
@@ -248,7 +248,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error {
248248
continue
249249
}
250250
resource, name, _ := cmdutil.ResolveResource(buildapi.Resource("builds"), build.Name, o.Mapper)
251-
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, fmt.Sprintf("restarted build %q", b.Name))
251+
kcmdutil.PrintSuccess(o.Mapper, false, o.Out, resource.Resource, name, false, fmt.Sprintf("restarted build %q", b.Name))
252252
}
253253
}
254254

pkg/cmd/cli/cmd/create/clusterquota.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,7 @@ func (o *CreateClusterQuotaOptions) Run() error {
165165
}
166166

167167
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
168-
created := "created"
169-
if o.DryRun {
170-
created = "created (DRY RUN)"
171-
}
172-
173-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "clusterquota", actualObj.Name, created)
168+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "clusterquota", actualObj.Name, o.DryRun, "created")
174169
return nil
175170
}
176171

pkg/cmd/cli/cmd/create/deploymentconfig.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ func (o *CreateDeploymentConfigOptions) Run() error {
153153
}
154154

155155
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
156-
created := "created"
157-
if o.DryRun {
158-
created = "created (DRY RUN)"
159-
}
160-
161-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "deploymentconfig", actualObj.Name, created)
156+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "deploymentconfig", actualObj.Name, o.DryRun, "created")
162157
return nil
163158
}
164159

pkg/cmd/cli/cmd/create/identity.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ func (o *CreateIdentityOptions) Run() error {
142142
}
143143

144144
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
145-
created := "created"
146-
if o.DryRun {
147-
created = "created (DRY RUN)"
148-
}
149-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "identity", actualIdentity.Name, created)
145+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "identity", actualIdentity.Name, o.DryRun, "created")
150146
return nil
151147
}
152148

pkg/cmd/cli/cmd/create/imagestream.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ func (o *CreateImageStreamOptions) Run() error {
135135
}
136136

137137
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
138-
created := "created"
139-
if o.DryRun {
140-
created = "created (DRY RUN)"
141-
}
142-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "imagestream", actualObj.Name, created)
138+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "imagestream", actualObj.Name, o.DryRun, "created")
143139
return nil
144140
}
145141

pkg/cmd/cli/cmd/create/policy_binding.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (o *CreatePolicyBindingOptions) Run() error {
122122
}
123123

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

pkg/cmd/cli/cmd/create/route.go

+3-18
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,8 @@ func CreateEdgeRoute(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, ar
159159
return err
160160
}
161161

162-
created := "created"
163-
if dryRun {
164-
created = "created (DRY RUN)"
165-
}
166-
167162
shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
168-
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
163+
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
169164
return nil
170165
}
171166

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

261-
created := "created"
262-
if dryRun {
263-
created = "created (DRY RUN)"
264-
}
265-
266256
shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
267-
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
257+
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
268258
return nil
269259
}
270260

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

392-
created := "created"
393-
if dryRun {
394-
created = "created (DRY RUN)"
395-
}
396-
397382
shortOutput := kcmdutil.GetFlagString(cmd, "output") == "name"
398-
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, created)
383+
kcmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, dryRun, "created")
399384
return nil
400385
}
401386

pkg/cmd/cli/cmd/create/user.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ func (o *CreateUserOptions) Run() error {
133133
}
134134

135135
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
136-
created := "created"
137-
if o.DryRun {
138-
created = "created (DRY RUN)"
139-
}
140-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "user", actualUser.Name, created)
136+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "user", actualUser.Name, o.DryRun, "created")
141137
return nil
142138
}
143139

pkg/cmd/cli/cmd/create/user_identity_mapping.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ func (o *CreateUserIdentityMappingOptions) Run() error {
135135
}
136136

137137
if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 {
138-
created := "created"
139-
if o.DryRun {
140-
created = "created (DRY RUN)"
141-
}
142-
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "useridentitymapping", actualMapping.Name, created)
138+
cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "useridentitymapping", actualMapping.Name, o.DryRun, "created")
143139
return nil
144140
}
145141

pkg/cmd/cli/cmd/idle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ func (o *IdleOptions) RunIdle(f *clientcmd.Factory) error {
632632
}
633633
}
634634

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

638638
if hadError {

pkg/cmd/cli/cmd/rollback.go

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ func (o *RollbackOptions) Run() error {
252252
return err
253253
}
254254
o.out.Write([]byte(description))
255+
fmt.Fprintf(o.out, "%s\n", "(dry run)")
255256
return nil
256257
}
257258

0 commit comments

Comments
 (0)