Browse code

Merge pull request #10731 from mfojtik/rollout-cancel

Merged by openshift-bot

OpenShift Bot authored on 2016/12/09 20:43:34
Showing 15 changed files
... ...
@@ -8471,10 +8471,6 @@ _oc_deploy()
8471 8471
     flags_with_completion=()
8472 8472
     flags_completion=()
8473 8473
 
8474
-    flags+=("--cancel")
8475
-    local_nonpersistent_flags+=("--cancel")
8476
-    flags+=("--enable-triggers")
8477
-    local_nonpersistent_flags+=("--enable-triggers")
8478 8474
     flags+=("--follow")
8479 8475
     local_nonpersistent_flags+=("--follow")
8480 8476
     flags+=("--retry")
... ...
@@ -11856,6 +11852,59 @@ _oc_rollback()
11856 11856
     noun_aliases=()
11857 11857
 }
11858 11858
 
11859
+_oc_rollout_cancel()
11860
+{
11861
+    last_command="oc_rollout_cancel"
11862
+    commands=()
11863
+
11864
+    flags=()
11865
+    two_word_flags=()
11866
+    local_nonpersistent_flags=()
11867
+    flags_with_completion=()
11868
+    flags_completion=()
11869
+
11870
+    flags+=("--filename=")
11871
+    flags_with_completion+=("--filename")
11872
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
11873
+    two_word_flags+=("-f")
11874
+    flags_with_completion+=("-f")
11875
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
11876
+    local_nonpersistent_flags+=("--filename=")
11877
+    flags+=("--recursive")
11878
+    flags+=("-R")
11879
+    local_nonpersistent_flags+=("--recursive")
11880
+    flags+=("--as=")
11881
+    flags+=("--certificate-authority=")
11882
+    flags_with_completion+=("--certificate-authority")
11883
+    flags_completion+=("_filedir")
11884
+    flags+=("--client-certificate=")
11885
+    flags_with_completion+=("--client-certificate")
11886
+    flags_completion+=("_filedir")
11887
+    flags+=("--client-key=")
11888
+    flags_with_completion+=("--client-key")
11889
+    flags_completion+=("_filedir")
11890
+    flags+=("--cluster=")
11891
+    flags+=("--config=")
11892
+    flags_with_completion+=("--config")
11893
+    flags_completion+=("_filedir")
11894
+    flags+=("--context=")
11895
+    flags+=("--insecure-skip-tls-verify")
11896
+    flags+=("--log-flush-frequency=")
11897
+    flags+=("--loglevel=")
11898
+    flags+=("--logspec=")
11899
+    flags+=("--match-server-version")
11900
+    flags+=("--namespace=")
11901
+    two_word_flags+=("-n")
11902
+    flags+=("--request-timeout=")
11903
+    flags+=("--server=")
11904
+    flags+=("--token=")
11905
+    flags+=("--user=")
11906
+
11907
+    must_have_one_flag=()
11908
+    must_have_one_noun=()
11909
+    noun_aliases=()
11910
+}
11911
+
11859 11912
 _oc_rollout_history()
11860 11913
 {
11861 11914
     last_command="oc_rollout_history"
... ...
@@ -12216,6 +12265,7 @@ _oc_rollout()
12216 12216
 {
12217 12217
     last_command="oc_rollout"
12218 12218
     commands=()
12219
+    commands+=("cancel")
12219 12220
     commands+=("history")
12220 12221
     commands+=("latest")
12221 12222
     commands+=("pause")
... ...
@@ -13098,10 +13098,6 @@ _openshift_cli_deploy()
13098 13098
     flags_with_completion=()
13099 13099
     flags_completion=()
13100 13100
 
13101
-    flags+=("--cancel")
13102
-    local_nonpersistent_flags+=("--cancel")
13103
-    flags+=("--enable-triggers")
13104
-    local_nonpersistent_flags+=("--enable-triggers")
13105 13101
     flags+=("--follow")
13106 13102
     local_nonpersistent_flags+=("--follow")
13107 13103
     flags+=("--retry")
... ...
@@ -16526,6 +16522,60 @@ _openshift_cli_rollback()
16526 16526
     noun_aliases=()
16527 16527
 }
16528 16528
 
16529
+_openshift_cli_rollout_cancel()
16530
+{
16531
+    last_command="openshift_cli_rollout_cancel"
16532
+    commands=()
16533
+
16534
+    flags=()
16535
+    two_word_flags=()
16536
+    local_nonpersistent_flags=()
16537
+    flags_with_completion=()
16538
+    flags_completion=()
16539
+
16540
+    flags+=("--filename=")
16541
+    flags_with_completion+=("--filename")
16542
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
16543
+    two_word_flags+=("-f")
16544
+    flags_with_completion+=("-f")
16545
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
16546
+    local_nonpersistent_flags+=("--filename=")
16547
+    flags+=("--recursive")
16548
+    flags+=("-R")
16549
+    local_nonpersistent_flags+=("--recursive")
16550
+    flags+=("--as=")
16551
+    flags+=("--certificate-authority=")
16552
+    flags_with_completion+=("--certificate-authority")
16553
+    flags_completion+=("_filedir")
16554
+    flags+=("--client-certificate=")
16555
+    flags_with_completion+=("--client-certificate")
16556
+    flags_completion+=("_filedir")
16557
+    flags+=("--client-key=")
16558
+    flags_with_completion+=("--client-key")
16559
+    flags_completion+=("_filedir")
16560
+    flags+=("--cluster=")
16561
+    flags+=("--config=")
16562
+    flags_with_completion+=("--config")
16563
+    flags_completion+=("_filedir")
16564
+    flags+=("--context=")
16565
+    flags+=("--google-json-key=")
16566
+    flags+=("--insecure-skip-tls-verify")
16567
+    flags+=("--log-flush-frequency=")
16568
+    flags+=("--loglevel=")
16569
+    flags+=("--logspec=")
16570
+    flags+=("--match-server-version")
16571
+    flags+=("--namespace=")
16572
+    two_word_flags+=("-n")
16573
+    flags+=("--request-timeout=")
16574
+    flags+=("--server=")
16575
+    flags+=("--token=")
16576
+    flags+=("--user=")
16577
+
16578
+    must_have_one_flag=()
16579
+    must_have_one_noun=()
16580
+    noun_aliases=()
16581
+}
16582
+
16529 16583
 _openshift_cli_rollout_history()
16530 16584
 {
16531 16585
     last_command="openshift_cli_rollout_history"
... ...
@@ -16892,6 +16942,7 @@ _openshift_cli_rollout()
16892 16892
 {
16893 16893
     last_command="openshift_cli_rollout"
16894 16894
     commands=()
16895
+    commands+=("cancel")
16895 16896
     commands+=("history")
16896 16897
     commands+=("latest")
16897 16898
     commands+=("pause")
... ...
@@ -8632,10 +8632,6 @@ _oc_deploy()
8632 8632
     flags_with_completion=()
8633 8633
     flags_completion=()
8634 8634
 
8635
-    flags+=("--cancel")
8636
-    local_nonpersistent_flags+=("--cancel")
8637
-    flags+=("--enable-triggers")
8638
-    local_nonpersistent_flags+=("--enable-triggers")
8639 8635
     flags+=("--follow")
8640 8636
     local_nonpersistent_flags+=("--follow")
8641 8637
     flags+=("--retry")
... ...
@@ -12017,6 +12013,59 @@ _oc_rollback()
12017 12017
     noun_aliases=()
12018 12018
 }
12019 12019
 
12020
+_oc_rollout_cancel()
12021
+{
12022
+    last_command="oc_rollout_cancel"
12023
+    commands=()
12024
+
12025
+    flags=()
12026
+    two_word_flags=()
12027
+    local_nonpersistent_flags=()
12028
+    flags_with_completion=()
12029
+    flags_completion=()
12030
+
12031
+    flags+=("--filename=")
12032
+    flags_with_completion+=("--filename")
12033
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
12034
+    two_word_flags+=("-f")
12035
+    flags_with_completion+=("-f")
12036
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
12037
+    local_nonpersistent_flags+=("--filename=")
12038
+    flags+=("--recursive")
12039
+    flags+=("-R")
12040
+    local_nonpersistent_flags+=("--recursive")
12041
+    flags+=("--as=")
12042
+    flags+=("--certificate-authority=")
12043
+    flags_with_completion+=("--certificate-authority")
12044
+    flags_completion+=("_filedir")
12045
+    flags+=("--client-certificate=")
12046
+    flags_with_completion+=("--client-certificate")
12047
+    flags_completion+=("_filedir")
12048
+    flags+=("--client-key=")
12049
+    flags_with_completion+=("--client-key")
12050
+    flags_completion+=("_filedir")
12051
+    flags+=("--cluster=")
12052
+    flags+=("--config=")
12053
+    flags_with_completion+=("--config")
12054
+    flags_completion+=("_filedir")
12055
+    flags+=("--context=")
12056
+    flags+=("--insecure-skip-tls-verify")
12057
+    flags+=("--log-flush-frequency=")
12058
+    flags+=("--loglevel=")
12059
+    flags+=("--logspec=")
12060
+    flags+=("--match-server-version")
12061
+    flags+=("--namespace=")
12062
+    two_word_flags+=("-n")
12063
+    flags+=("--request-timeout=")
12064
+    flags+=("--server=")
12065
+    flags+=("--token=")
12066
+    flags+=("--user=")
12067
+
12068
+    must_have_one_flag=()
12069
+    must_have_one_noun=()
12070
+    noun_aliases=()
12071
+}
12072
+
12020 12073
 _oc_rollout_history()
12021 12074
 {
12022 12075
     last_command="oc_rollout_history"
... ...
@@ -12377,6 +12426,7 @@ _oc_rollout()
12377 12377
 {
12378 12378
     last_command="oc_rollout"
12379 12379
     commands=()
12380
+    commands+=("cancel")
12380 12381
     commands+=("history")
12381 12382
     commands+=("latest")
12382 12383
     commands+=("pause")
... ...
@@ -13259,10 +13259,6 @@ _openshift_cli_deploy()
13259 13259
     flags_with_completion=()
13260 13260
     flags_completion=()
13261 13261
 
13262
-    flags+=("--cancel")
13263
-    local_nonpersistent_flags+=("--cancel")
13264
-    flags+=("--enable-triggers")
13265
-    local_nonpersistent_flags+=("--enable-triggers")
13266 13262
     flags+=("--follow")
13267 13263
     local_nonpersistent_flags+=("--follow")
13268 13264
     flags+=("--retry")
... ...
@@ -16687,6 +16683,60 @@ _openshift_cli_rollback()
16687 16687
     noun_aliases=()
16688 16688
 }
16689 16689
 
16690
+_openshift_cli_rollout_cancel()
16691
+{
16692
+    last_command="openshift_cli_rollout_cancel"
16693
+    commands=()
16694
+
16695
+    flags=()
16696
+    two_word_flags=()
16697
+    local_nonpersistent_flags=()
16698
+    flags_with_completion=()
16699
+    flags_completion=()
16700
+
16701
+    flags+=("--filename=")
16702
+    flags_with_completion+=("--filename")
16703
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
16704
+    two_word_flags+=("-f")
16705
+    flags_with_completion+=("-f")
16706
+    flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
16707
+    local_nonpersistent_flags+=("--filename=")
16708
+    flags+=("--recursive")
16709
+    flags+=("-R")
16710
+    local_nonpersistent_flags+=("--recursive")
16711
+    flags+=("--as=")
16712
+    flags+=("--certificate-authority=")
16713
+    flags_with_completion+=("--certificate-authority")
16714
+    flags_completion+=("_filedir")
16715
+    flags+=("--client-certificate=")
16716
+    flags_with_completion+=("--client-certificate")
16717
+    flags_completion+=("_filedir")
16718
+    flags+=("--client-key=")
16719
+    flags_with_completion+=("--client-key")
16720
+    flags_completion+=("_filedir")
16721
+    flags+=("--cluster=")
16722
+    flags+=("--config=")
16723
+    flags_with_completion+=("--config")
16724
+    flags_completion+=("_filedir")
16725
+    flags+=("--context=")
16726
+    flags+=("--google-json-key=")
16727
+    flags+=("--insecure-skip-tls-verify")
16728
+    flags+=("--log-flush-frequency=")
16729
+    flags+=("--loglevel=")
16730
+    flags+=("--logspec=")
16731
+    flags+=("--match-server-version")
16732
+    flags+=("--namespace=")
16733
+    two_word_flags+=("-n")
16734
+    flags+=("--request-timeout=")
16735
+    flags+=("--server=")
16736
+    flags+=("--token=")
16737
+    flags+=("--user=")
16738
+
16739
+    must_have_one_flag=()
16740
+    must_have_one_noun=()
16741
+    noun_aliases=()
16742
+}
16743
+
16690 16744
 _openshift_cli_rollout_history()
16691 16745
 {
16692 16746
     last_command="openshift_cli_rollout_history"
... ...
@@ -17053,6 +17103,7 @@ _openshift_cli_rollout()
17053 17053
 {
17054 17054
     last_command="openshift_cli_rollout"
17055 17055
     commands=()
17056
+    commands+=("cancel")
17056 17057
     commands+=("history")
17057 17058
     commands+=("latest")
17058 17059
     commands+=("pause")
... ...
@@ -2159,6 +2159,19 @@ Revert part of an application back to a previous deployment
2159 2159
 ====
2160 2160
 
2161 2161
 
2162
+== oc rollout cancel
2163
+cancel the in-progress deployment
2164
+
2165
+====
2166
+
2167
+[options="nowrap"]
2168
+----
2169
+  # Cancel the in-progress deployment based on 'nginx'
2170
+  oc rollout cancel dc/nginx
2171
+----
2172
+====
2173
+
2174
+
2162 2175
 == oc rollout history
2163 2176
 View rollout history
2164 2177
 
... ...
@@ -182,6 +182,7 @@ oc-projects.1
182 182
 oc-proxy.1
183 183
 oc-replace.1
184 184
 oc-rollback.1
185
+oc-rollout-cancel.1
185 186
 oc-rollout-history.1
186 187
 oc-rollout-latest.1
187 188
 oc-rollout-pause.1
... ...
@@ -271,6 +271,7 @@ openshift-cli-projects.1
271 271
 openshift-cli-proxy.1
272 272
 openshift-cli-replace.1
273 273
 openshift-cli-rollback.1
274
+openshift-cli-rollout-cancel.1
274 275
 openshift-cli-rollout-history.1
275 276
 openshift-cli-rollout-latest.1
276 277
 openshift-cli-rollout-pause.1
277 278
new file mode 100644
... ...
@@ -0,0 +1,121 @@
0
+.TH "OC ROLLOUT" "1" " Openshift CLI User Manuals" "Openshift" "June 2016"  ""
1
+
2
+
3
+.SH NAME
4
+.PP
5
+oc rollout cancel \- cancel the in\-progress deployment
6
+
7
+
8
+.SH SYNOPSIS
9
+.PP
10
+\fBoc rollout cancel\fP [OPTIONS]
11
+
12
+
13
+.SH DESCRIPTION
14
+.PP
15
+Cancel the in\-progress deployment
16
+
17
+.PP
18
+Running this command will cause the current in\-progress deployment to be cancelled, but keep in mind that this is a best\-effort operation and may take some time to complete. It’s possible the deployment will partially or totally complete before the cancellation is effective. In such a case an appropriate event will be emitted.
19
+
20
+
21
+.SH OPTIONS
22
+.PP
23
+\fB\-f\fP, \fB\-\-filename\fP=[]
24
+    Filename, directory, or URL to a file identifying the resource to get from a server.
25
+
26
+.PP
27
+\fB\-R\fP, \fB\-\-recursive\fP=false
28
+    Process the directory used in \-f, \-\-filename recursively. Useful when you want to manage related manifests organized within the same directory.
29
+
30
+
31
+.SH OPTIONS INHERITED FROM PARENT COMMANDS
32
+.PP
33
+\fB\-\-api\-version\fP=""
34
+    DEPRECATED: The API version to use when talking to the server
35
+
36
+.PP
37
+\fB\-\-as\fP=""
38
+    Username to impersonate for the operation
39
+
40
+.PP
41
+\fB\-\-certificate\-authority\fP=""
42
+    Path to a cert. file for the certificate authority
43
+
44
+.PP
45
+\fB\-\-client\-certificate\fP=""
46
+    Path to a client certificate file for TLS
47
+
48
+.PP
49
+\fB\-\-client\-key\fP=""
50
+    Path to a client key file for TLS
51
+
52
+.PP
53
+\fB\-\-cluster\fP=""
54
+    The name of the kubeconfig cluster to use
55
+
56
+.PP
57
+\fB\-\-config\fP=""
58
+    Path to the config file to use for CLI requests.
59
+
60
+.PP
61
+\fB\-\-context\fP=""
62
+    The name of the kubeconfig context to use
63
+
64
+.PP
65
+\fB\-\-google\-json\-key\fP=""
66
+    The Google Cloud Platform Service Account JSON Key to use for authentication.
67
+
68
+.PP
69
+\fB\-\-insecure\-skip\-tls\-verify\fP=false
70
+    If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
71
+
72
+.PP
73
+\fB\-\-log\-flush\-frequency\fP=0
74
+    Maximum number of seconds between log flushes
75
+
76
+.PP
77
+\fB\-\-match\-server\-version\fP=false
78
+    Require server version to match client version
79
+
80
+.PP
81
+\fB\-n\fP, \fB\-\-namespace\fP=""
82
+    If present, the namespace scope for this CLI request
83
+
84
+.PP
85
+\fB\-\-request\-timeout\fP="0"
86
+    The length of time to wait before giving up on a single server request. Non\-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
87
+
88
+.PP
89
+\fB\-\-server\fP=""
90
+    The address and port of the Kubernetes API server
91
+
92
+.PP
93
+\fB\-\-token\fP=""
94
+    Bearer token for authentication to the API server
95
+
96
+.PP
97
+\fB\-\-user\fP=""
98
+    The name of the kubeconfig user to use
99
+
100
+
101
+.SH EXAMPLE
102
+.PP
103
+.RS
104
+
105
+.nf
106
+  # Cancel the in\-progress deployment based on 'nginx'
107
+  oc rollout cancel dc/nginx
108
+
109
+.fi
110
+.RE
111
+
112
+
113
+.SH SEE ALSO
114
+.PP
115
+\fBoc\-rollout(1)\fP,
116
+
117
+
118
+.SH HISTORY
119
+.PP
120
+June 2016, Ported from the Kubernetes man\-doc generator
... ...
@@ -103,7 +103,7 @@ There are several deployment strategies defined:
103 103
 
104 104
 .SH SEE ALSO
105 105
 .PP
106
-\fBoc(1)\fP, \fBoc\-rollout\-history(1)\fP, \fBoc\-rollout\-latest(1)\fP, \fBoc\-rollout\-pause(1)\fP, \fBoc\-rollout\-resume(1)\fP, \fBoc\-rollout\-status(1)\fP, \fBoc\-rollout\-undo(1)\fP,
106
+\fBoc(1)\fP, \fBoc\-rollout\-cancel(1)\fP, \fBoc\-rollout\-history(1)\fP, \fBoc\-rollout\-latest(1)\fP, \fBoc\-rollout\-pause(1)\fP, \fBoc\-rollout\-resume(1)\fP, \fBoc\-rollout\-status(1)\fP, \fBoc\-rollout\-undo(1)\fP,
107 107
 
108 108
 
109 109
 .SH HISTORY
110 110
new file mode 100644
... ...
@@ -0,0 +1,121 @@
0
+.TH "OPENSHIFT CLI ROLLOUT" "1" " Openshift CLI User Manuals" "Openshift" "June 2016"  ""
1
+
2
+
3
+.SH NAME
4
+.PP
5
+openshift cli rollout cancel \- cancel the in\-progress deployment
6
+
7
+
8
+.SH SYNOPSIS
9
+.PP
10
+\fBopenshift cli rollout cancel\fP [OPTIONS]
11
+
12
+
13
+.SH DESCRIPTION
14
+.PP
15
+Cancel the in\-progress deployment
16
+
17
+.PP
18
+Running this command will cause the current in\-progress deployment to be cancelled, but keep in mind that this is a best\-effort operation and may take some time to complete. It’s possible the deployment will partially or totally complete before the cancellation is effective. In such a case an appropriate event will be emitted.
19
+
20
+
21
+.SH OPTIONS
22
+.PP
23
+\fB\-f\fP, \fB\-\-filename\fP=[]
24
+    Filename, directory, or URL to a file identifying the resource to get from a server.
25
+
26
+.PP
27
+\fB\-R\fP, \fB\-\-recursive\fP=false
28
+    Process the directory used in \-f, \-\-filename recursively. Useful when you want to manage related manifests organized within the same directory.
29
+
30
+
31
+.SH OPTIONS INHERITED FROM PARENT COMMANDS
32
+.PP
33
+\fB\-\-api\-version\fP=""
34
+    DEPRECATED: The API version to use when talking to the server
35
+
36
+.PP
37
+\fB\-\-as\fP=""
38
+    Username to impersonate for the operation
39
+
40
+.PP
41
+\fB\-\-certificate\-authority\fP=""
42
+    Path to a cert. file for the certificate authority
43
+
44
+.PP
45
+\fB\-\-client\-certificate\fP=""
46
+    Path to a client certificate file for TLS
47
+
48
+.PP
49
+\fB\-\-client\-key\fP=""
50
+    Path to a client key file for TLS
51
+
52
+.PP
53
+\fB\-\-cluster\fP=""
54
+    The name of the kubeconfig cluster to use
55
+
56
+.PP
57
+\fB\-\-config\fP=""
58
+    Path to the config file to use for CLI requests.
59
+
60
+.PP
61
+\fB\-\-context\fP=""
62
+    The name of the kubeconfig context to use
63
+
64
+.PP
65
+\fB\-\-google\-json\-key\fP=""
66
+    The Google Cloud Platform Service Account JSON Key to use for authentication.
67
+
68
+.PP
69
+\fB\-\-insecure\-skip\-tls\-verify\fP=false
70
+    If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
71
+
72
+.PP
73
+\fB\-\-log\-flush\-frequency\fP=0
74
+    Maximum number of seconds between log flushes
75
+
76
+.PP
77
+\fB\-\-match\-server\-version\fP=false
78
+    Require server version to match client version
79
+
80
+.PP
81
+\fB\-n\fP, \fB\-\-namespace\fP=""
82
+    If present, the namespace scope for this CLI request
83
+
84
+.PP
85
+\fB\-\-request\-timeout\fP="0"
86
+    The length of time to wait before giving up on a single server request. Non\-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
87
+
88
+.PP
89
+\fB\-\-server\fP=""
90
+    The address and port of the Kubernetes API server
91
+
92
+.PP
93
+\fB\-\-token\fP=""
94
+    Bearer token for authentication to the API server
95
+
96
+.PP
97
+\fB\-\-user\fP=""
98
+    The name of the kubeconfig user to use
99
+
100
+
101
+.SH EXAMPLE
102
+.PP
103
+.RS
104
+
105
+.nf
106
+  # Cancel the in\-progress deployment based on 'nginx'
107
+  openshift cli rollout cancel dc/nginx
108
+
109
+.fi
110
+.RE
111
+
112
+
113
+.SH SEE ALSO
114
+.PP
115
+\fBopenshift\-cli\-rollout(1)\fP,
116
+
117
+
118
+.SH HISTORY
119
+.PP
120
+June 2016, Ported from the Kubernetes man\-doc generator
... ...
@@ -103,7 +103,7 @@ There are several deployment strategies defined:
103 103
 
104 104
 .SH SEE ALSO
105 105
 .PP
106
-\fBopenshift\-cli(1)\fP, \fBopenshift\-cli\-rollout\-history(1)\fP, \fBopenshift\-cli\-rollout\-latest(1)\fP, \fBopenshift\-cli\-rollout\-pause(1)\fP, \fBopenshift\-cli\-rollout\-resume(1)\fP, \fBopenshift\-cli\-rollout\-status(1)\fP, \fBopenshift\-cli\-rollout\-undo(1)\fP,
106
+\fBopenshift\-cli(1)\fP, \fBopenshift\-cli\-rollout\-cancel(1)\fP, \fBopenshift\-cli\-rollout\-history(1)\fP, \fBopenshift\-cli\-rollout\-latest(1)\fP, \fBopenshift\-cli\-rollout\-pause(1)\fP, \fBopenshift\-cli\-rollout\-resume(1)\fP, \fBopenshift\-cli\-rollout\-status(1)\fP, \fBopenshift\-cli\-rollout\-undo(1)\fP,
107 107
 
108 108
 
109 109
 .SH HISTORY
... ...
@@ -124,7 +124,9 @@ func NewCmdDeploy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.C
124 124
 	cmd.Flags().MarkDeprecated("latest", fmt.Sprintf("use '%s rollout latest' instead", fullName))
125 125
 	cmd.Flags().BoolVar(&options.retryDeploy, "retry", false, "Retry the latest failed deployment.")
126 126
 	cmd.Flags().BoolVar(&options.cancelDeploy, "cancel", false, "Cancel the in-progress deployment.")
127
+	cmd.Flags().MarkDeprecated("cancel", fmt.Sprintf("use '%s rollout cancel' instead", fullName))
127 128
 	cmd.Flags().BoolVar(&options.enableTriggers, "enable-triggers", false, "Enables all image triggers for the deployment config.")
129
+	cmd.Flags().MarkDeprecated("enable-triggers", fmt.Sprintf("use '%s set triggers' instead", fullName))
128 130
 	cmd.Flags().BoolVar(&options.follow, "follow", false, "Follow the logs of a deployment")
129 131
 
130 132
 	return cmd
... ...
@@ -241,8 +243,8 @@ func (o DeployOptions) deploy(config *deployapi.DeploymentConfig) error {
241 241
 	deployment, err := o.kubeClient.ReplicationControllers(config.Namespace).Get(deploymentName)
242 242
 	if err == nil && !deployutil.IsTerminatedDeployment(deployment) {
243 243
 		// Reject attempts to start a concurrent deployment.
244
-		return fmt.Errorf("#%d is already in progress (%s).\nOptionally, you can cancel this deployment using the --cancel option.",
245
-			config.Status.LatestVersion, deployutil.DeploymentStatusFor(deployment))
244
+		return fmt.Errorf("#%d is already in progress (%s).\nOptionally, you can cancel this deployment using 'oc rollout cancel dc/%s'.",
245
+			config.Status.LatestVersion, deployutil.DeploymentStatusFor(deployment), deployment.Name)
246 246
 	}
247 247
 	if err != nil && !kerrors.IsNotFound(err) {
248 248
 		return err
... ...
@@ -304,7 +306,7 @@ func (o DeployOptions) retry(config *deployapi.DeploymentConfig) error {
304 304
 		if deployutil.IsCompleteDeployment(deployment) {
305 305
 			message += fmt.Sprintf("You can start a new deployment with 'oc deploy --latest dc/%s'.", config.Name)
306 306
 		} else {
307
-			message += fmt.Sprintf("Optionally, you can cancel this deployment with 'oc deploy --cancel dc/%s'.", config.Name)
307
+			message += fmt.Sprintf("Optionally, you can cancel this deployment with 'oc rollout cancel dc/%s'.", config.Name)
308 308
 		}
309 309
 
310 310
 		return fmt.Errorf(message)
... ...
@@ -339,6 +341,7 @@ func (o DeployOptions) retry(config *deployapi.DeploymentConfig) error {
339 339
 }
340 340
 
341 341
 // cancel cancels any deployment process in progress for config.
342
+// TODO: this code will be deprecated
342 343
 func (o DeployOptions) cancel(config *deployapi.DeploymentConfig) error {
343 344
 	if config.Spec.Paused {
344 345
 		return fmt.Errorf("cannot cancel a paused deployment config")
345 346
new file mode 100644
... ...
@@ -0,0 +1,199 @@
0
+package rollout
1
+
2
+import (
3
+	"fmt"
4
+	"io"
5
+	"sort"
6
+	"strings"
7
+	"time"
8
+
9
+	"k8s.io/kubernetes/pkg/api/meta"
10
+	"k8s.io/kubernetes/pkg/kubectl"
11
+	"k8s.io/kubernetes/pkg/kubectl/resource"
12
+	"k8s.io/kubernetes/pkg/runtime"
13
+
14
+	units "github.com/docker/go-units"
15
+	"github.com/openshift/origin/pkg/cmd/templates"
16
+	"github.com/openshift/origin/pkg/cmd/util/clientcmd"
17
+	deployapi "github.com/openshift/origin/pkg/deploy/api"
18
+	deployutil "github.com/openshift/origin/pkg/deploy/util"
19
+	"github.com/spf13/cobra"
20
+	kapi "k8s.io/kubernetes/pkg/api"
21
+	kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
22
+	"k8s.io/kubernetes/pkg/kubectl/cmd/set"
23
+	kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
24
+	utilerrors "k8s.io/kubernetes/pkg/util/errors"
25
+)
26
+
27
+type CancelOptions struct {
28
+	Mapper  meta.RESTMapper
29
+	Typer   runtime.ObjectTyper
30
+	Encoder runtime.Encoder
31
+	Infos   []*resource.Info
32
+
33
+	Filenames []string
34
+	Out       io.Writer
35
+	Recursive bool
36
+
37
+	Clientset *kclientset.Clientset
38
+}
39
+
40
+var (
41
+	rolloutCancelLong = templates.LongDesc(`
42
+Cancel the in-progress deployment
43
+
44
+Running this command will cause the current in-progress deployment to be
45
+cancelled, but keep in mind that this is a best-effort operation and may take
46
+some time to complete. It’s possible the deployment will partially or totally
47
+complete before the cancellation is effective. In such a case an appropriate
48
+event will be emitted.`)
49
+
50
+	rolloutCancelExample = templates.Examples(`
51
+	# Cancel the in-progress deployment based on 'nginx'
52
+  %[1]s rollout cancel dc/nginx`)
53
+)
54
+
55
+func NewCmdRolloutCancel(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
56
+	opts := &CancelOptions{}
57
+	cmd := &cobra.Command{
58
+		Use:     "cancel (TYPE NAME | TYPE/NAME) [flags]",
59
+		Long:    rolloutCancelLong,
60
+		Example: fmt.Sprintf(rolloutCancelExample, fullName),
61
+		Short:   "cancel the in-progress deployment",
62
+		Run: func(cmd *cobra.Command, args []string) {
63
+			kcmdutil.CheckErr(opts.Complete(f, cmd, out, args))
64
+			kcmdutil.CheckErr(opts.Run())
65
+		},
66
+	}
67
+	usage := "Filename, directory, or URL to a file identifying the resource to get from a server."
68
+	kubectl.AddJsonFilenameFlag(cmd, &opts.Filenames, usage)
69
+	kcmdutil.AddRecursiveFlag(cmd, &opts.Recursive)
70
+	return cmd
71
+}
72
+
73
+func (o *CancelOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, out io.Writer, args []string) error {
74
+	if len(args) == 0 && len(o.Filenames) == 0 {
75
+		return kcmdutil.UsageError(cmd, cmd.Use)
76
+	}
77
+
78
+	o.Mapper, o.Typer = f.Object(false)
79
+	o.Encoder = f.JSONEncoder()
80
+	o.Out = out
81
+
82
+	cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
83
+	if err != nil {
84
+		return err
85
+	}
86
+
87
+	_, _, o.Clientset, err = f.Clients()
88
+	if err != nil {
89
+		return err
90
+	}
91
+
92
+	r := resource.NewBuilder(o.Mapper, o.Typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
93
+		NamespaceParam(cmdNamespace).DefaultNamespace().
94
+		FilenameParam(enforceNamespace, o.Recursive, o.Filenames...).
95
+		ResourceTypeOrNameArgs(true, args...).
96
+		ContinueOnError().
97
+		Latest().
98
+		Flatten().
99
+		Do()
100
+	err = r.Err()
101
+	if err != nil {
102
+		return err
103
+	}
104
+
105
+	o.Infos, err = r.Infos()
106
+	return err
107
+}
108
+
109
+func (o CancelOptions) Run() error {
110
+	allErrs := []error{}
111
+	for _, info := range o.Infos {
112
+		config, ok := info.Object.(*deployapi.DeploymentConfig)
113
+		if !ok {
114
+			allErrs = append(allErrs, kcmdutil.AddSourceToErr("cancelling", info.Source, fmt.Errorf("expected deployment configuration, got %T", info.Object)))
115
+		}
116
+		if config.Spec.Paused {
117
+			allErrs = append(allErrs, kcmdutil.AddSourceToErr("cancelling", info.Source, fmt.Errorf("unable to cancel paused deployment %s/%s", config.Namespace, config.Name)))
118
+		}
119
+
120
+		mapping, err := o.Mapper.RESTMapping(kapi.Kind("ReplicationController"))
121
+		if err != nil {
122
+			return err
123
+		}
124
+
125
+		mutateFn := func(rc *kapi.ReplicationController) bool {
126
+			if deployutil.IsDeploymentCancelled(rc) {
127
+				kcmdutil.PrintSuccess(o.Mapper, false, o.Out, info.Mapping.Resource, info.Name, false, "already cancelled")
128
+				return false
129
+			}
130
+
131
+			patches := set.CalculatePatches([]*resource.Info{{Object: rc, Mapping: mapping}}, o.Encoder, func(*resource.Info) (bool, error) {
132
+				rc.Annotations[deployapi.DeploymentCancelledAnnotation] = deployapi.DeploymentCancelledAnnotationValue
133
+				rc.Annotations[deployapi.DeploymentStatusReasonAnnotation] = deployapi.DeploymentCancelledByUser
134
+				return true, nil
135
+			})
136
+
137
+			if len(patches) == 0 {
138
+				kcmdutil.PrintSuccess(o.Mapper, false, o.Out, info.Mapping.Resource, info.Name, false, "already cancelled")
139
+				return false
140
+			}
141
+
142
+			_, err := o.Clientset.ReplicationControllers(rc.Namespace).Patch(rc.Name, kapi.StrategicMergePatchType, patches[0].Patch)
143
+			if err != nil {
144
+				allErrs = append(allErrs, kcmdutil.AddSourceToErr("cancelling", info.Source, err))
145
+				return false
146
+			}
147
+			kcmdutil.PrintSuccess(o.Mapper, false, o.Out, info.Mapping.Resource, info.Name, false, "cancelling")
148
+			return true
149
+		}
150
+
151
+		deployments, cancelled, err := o.forEachControllerInConfig(config.Namespace, config.Name, mutateFn)
152
+		if err != nil {
153
+			allErrs = append(allErrs, kcmdutil.AddSourceToErr("cancelling", info.Source, err))
154
+			continue
155
+		}
156
+
157
+		if !cancelled {
158
+			latest := &deployments[0]
159
+			maybeCancelling := ""
160
+			if deployutil.IsDeploymentCancelled(latest) && !deployutil.IsTerminatedDeployment(latest) {
161
+				maybeCancelling = " (cancelling)"
162
+			}
163
+			timeAt := strings.ToLower(units.HumanDuration(time.Now().Sub(latest.CreationTimestamp.Time)))
164
+			fmt.Fprintf(o.Out, "No rollout is in progress (latest rollout #%d %s%s %s ago)\n",
165
+				deployutil.DeploymentVersionFor(latest),
166
+				strings.ToLower(string(deployutil.DeploymentStatusFor(latest))),
167
+				maybeCancelling,
168
+				timeAt)
169
+		}
170
+
171
+	}
172
+	return utilerrors.NewAggregate(allErrs)
173
+}
174
+
175
+func (o CancelOptions) forEachControllerInConfig(namespace, name string, mutateFunc func(*kapi.ReplicationController) bool) ([]kapi.ReplicationController, bool, error) {
176
+	deployments, err := o.Clientset.ReplicationControllers(namespace).List(kapi.ListOptions{LabelSelector: deployutil.ConfigSelector(name)})
177
+	if err != nil {
178
+		return nil, false, err
179
+	}
180
+	if len(deployments.Items) == 0 {
181
+		return nil, false, fmt.Errorf("there have been no replication controllers for %s/%s\n", namespace, name)
182
+	}
183
+	sort.Sort(deployutil.ByLatestVersionDesc(deployments.Items))
184
+	allErrs := []error{}
185
+	cancelled := false
186
+
187
+	for _, deployment := range deployments.Items {
188
+		status := deployutil.DeploymentStatusFor(&deployment)
189
+		switch status {
190
+		case deployapi.DeploymentStatusNew,
191
+			deployapi.DeploymentStatusPending,
192
+			deployapi.DeploymentStatusRunning:
193
+			cancelled = mutateFunc(&deployment)
194
+		}
195
+	}
196
+
197
+	return deployments.Items, cancelled, utilerrors.NewAggregate(allErrs)
198
+}
... ...
@@ -48,6 +48,7 @@ func NewCmdRollout(fullName string, f *clientcmd.Factory, out, errOut io.Writer)
48 48
 	cmd.AddCommand(NewCmdRolloutUndo(fullName, f, out))
49 49
 	cmd.AddCommand(NewCmdRolloutLatest(fullName, f, out))
50 50
 	cmd.AddCommand(NewCmdRolloutStatus(fullName, f, out))
51
+	cmd.AddCommand(NewCmdRolloutCancel(fullName, f, out))
51 52
 
52 53
 	return cmd
53 54
 }
... ...
@@ -70,12 +70,12 @@ var _ = g.Describe("deploymentconfigs", func() {
70 70
 				case n < 0.7:
71 71
 					// cancel any running deployment
72 72
 					e2e.Logf("%02d: cancelling deployment", i)
73
-					if out, err := oc.Run("deploy").Args("dc/deployment-simple", "--cancel").Output(); err != nil {
73
+					if out, err := oc.Run("rollout").Args("cancel", "dc/deployment-simple").Output(); err != nil {
74 74
 						// TODO: we should fix this
75 75
 						if !strings.Contains(out, "the object has been modified") {
76 76
 							o.Expect(err).NotTo(o.HaveOccurred())
77 77
 						}
78
-						e2e.Logf("--cancel deployment failed due to conflict: %v", err)
78
+						e2e.Logf("rollout cancel deployment failed due to conflict: %v", err)
79 79
 					}
80 80
 
81 81
 				case n < 0.0:
... ...
@@ -554,9 +554,9 @@ var _ = g.Describe("deploymentconfigs", func() {
554 554
 			o.Expect(out).To(o.ContainSubstring("cannot deploy a paused deployment config"))
555 555
 
556 556
 			g.By("verifying that we cannot cancel a deployment")
557
-			out, err = oc.Run("deploy").Args(resource, "--cancel").Output()
557
+			out, err = oc.Run("rollout").Args("cancel", resource).Output()
558 558
 			o.Expect(err).To(o.HaveOccurred())
559
-			o.Expect(out).To(o.ContainSubstring("cannot cancel a paused deployment config"))
559
+			o.Expect(out).To(o.ContainSubstring("unable to cancel paused deployment"))
560 560
 
561 561
 			g.By("verifying that we cannot retry a deployment")
562 562
 			out, err = oc.Run("deploy").Args(resource, "--retry").Output()