├── src └── _kubectl ├── zsh-kubectl-completion.plugin.zsh ├── Makefile ├── README.md ├── LICENSE └── _kubectl /src/_kubectl: -------------------------------------------------------------------------------- 1 | ../_kubectl -------------------------------------------------------------------------------- /zsh-kubectl-completion.plugin.zsh: -------------------------------------------------------------------------------- 1 | 0="${${0:#$ZSH_ARGZERO}:-${(%):-%N}}" 2 | 0="${${(M)0:#/*}:-$PWD/$0}" 3 | 4 | # comps 5 | fpath+=("${0:h}/src") 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME := zsh-kubectl-completion 2 | SRCS := $(shell find . -type f -name '_*') 3 | PRE-VERSION := $(shell grep 'version:' _kubectl | cut -c 44-) 4 | CURRENT-VERSION := v0.1.12 5 | 6 | .PHONY: release 7 | release: 8 | sed -i '' -e 's/$(PRE-VERSION)/$(CURRENT-VERSION)/g' README.md 9 | sed -i '' -e 's/$(PRE-VERSION)/$(CURRENT-VERSION)/g' $(SRCS) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![v1.13](https://img.shields.io/badge/kubectl-v1.13-blue.svg)](https://v1-13.docs.kubernetes.io) 2 | [![v0.1.12](https://img.shields.io/badge/version-v0.1.12-ff69b4.svg)](https://github.com/nnao45/zsh-kubectl-completion/releases/tag/v0.1.12) 3 | 4 | # nnao45/zsh-kubectl-completion 5 | Rich [zsh](http://zsh.org) completion for the [kubectl](https://kubernetes.io/docs/reference/kubectl) command. 6 | 7 | [![asciicast](https://asciinema.org/a/247655.svg)](https://asciinema.org/a/247655) 8 | 9 | # Version 10 | | kubectl | zsh-kubectl-completion | 11 | |:---:|:---:| 12 | | v1.12.2 | v0.1.6 | 13 | | v0.13.5 | v0.1.7 | 14 | | v0.13.5 | v0.1.8 | 15 | | v0.13.5 | v0.1.9 | 16 | | v0.13.5 | v0.1.10 | 17 | | v0.13.5 | v0.1.11 | 18 | | v0.13.5 | v0.1.12 | 19 | 20 | # Install 21 | 22 | ## zplug 23 | write this in your `.zshrc`. 24 | ```bash 25 | zplug "nnao45/zsh-kubectl-completion" 26 | ``` 27 | 28 | ## Prezto 29 | ```bash 30 | $ curl -fLo ~/.zprezto/modules/completion/external/src/_kubectl \ 31 | https://raw.githubusercontent.com/nnao45/zsh-kubectl-completion/master/_kubectl 32 | $ exec zsh 33 | ``` 34 | 35 | ## Manual 36 | for example, you set `~/.zsh/completion`, 37 | ```bash 38 | $ curl -fLo ~/.zsh/completion_kubectl \ 39 | https://raw.githubusercontent.com/nnao45/zsh-kubectl-completion/master/_kubectl 40 | $ exec zsh 41 | ``` 42 | 43 | # Resource Filitling 44 | This completion of kubectl has several flags corresponding to context override, for example, specify the namespace of the operation target --namespace flag should be set before entering resource name such as pod name So we will use the target namespace resource as a candidate for completion. The options supported for override are as follows. 45 | - --kubeconfig 46 | - --cluster 47 | - --user 48 | - --context 49 | - --namespace 50 | - --server 51 | 52 | ## And... 53 | If you want to complete list is "non grouped", you set additional attr. 54 | (I don't like grouped complete list when same word comment.) 55 | 56 | By default, 57 | ```bash 58 | $ kubectl describe namespaces 59 | namespace 60 | kkk jjj iii hhh ggg fff eee ddd ccc bbb aaa 61 | vvv uuu ttt sss rrr qqq ppp ooo nnn mmm lll 62 | zzz yyy xxx www -- Active 63 | ``` 64 | 65 | Add this setting in your `.zshrc`, 66 | ```bash 67 | zstyle ':completion:*:*:kubectl:*' list-grouped false 68 | ``` 69 | 70 | Show this😍 71 | ```bash 72 | $ kubectl describe namespaces 73 | namespace 74 | aaa -- Active 75 | bbb -- Active 76 | ccc -- Active 77 | ddd -- Active 78 | eee -- Active 79 | fff -- Active 80 | ggg -- Active 81 | hhh -- Active 82 | iii -- Active 83 | jjj -- Active 84 | kkk -- Active 85 | lll -- Active 86 | mmm -- Active 87 | nnn -- Active 88 | ooo -- Active 89 | ppp -- Active 90 | qqq -- Active 91 | rrr -- Active 92 | sss -- Active 93 | ttt -- Active 94 | uuu -- Active 95 | vvv -- Active 96 | www -- Active 97 | xxx -- Active 98 | yyy -- Active 99 | zzz -- Active 100 | ``` 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /_kubectl: -------------------------------------------------------------------------------- 1 | #compdef kubectl 2 | # nnao45/zsh-kubectl-completion's version: v0.1.12 3 | # 4 | # Support kubectl version v1.13.5 5 | # Inspired by 6 | # https://github.com/zsh-users/zsh-completionsrfe/blob/master/src/_golang 7 | # https://github.com/felixr/docker-zsh-completion/blob/master/_docker 8 | # https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh 9 | 10 | __parse_kube_get(){ 11 | local -a _ns _cl _ur _cx _sv 12 | if [ ! -z ${_filter_namespace} ];then 13 | _ns="--namespace ${_filter_namespace}" 14 | fi 15 | if [ ! -z ${_filter_cluster} ];then 16 | _cl="--cluster ${_filter_cluster}" 17 | fi 18 | if [ ! -z ${_filter_user} ];then 19 | _ur="--user ${_filter_user}" 20 | fi 21 | if [ ! -z ${_filter_context} ];then 22 | _cx="--context ${_filter_context}" 23 | fi 24 | if [ ! -z ${_filter_server} ];then 25 | _sv="--server ${_filter_server}" 26 | fi 27 | if [ ! -z ${_filter_kubeconfig} ];then 28 | _kc="--kubeconfig ${_filter_kubeconfig}" 29 | fi 30 | 31 | if [ ${1} = 'api-resources' ]; then 32 | eval kubectl ${1} ${_ns} ${_cl} ${_ur} ${_cx} ${_sv} ${_kc} -o wide 2>/dev/null 33 | elif [ ${1} = 'contexts' ]; then 34 | eval kubectl config get-contexts ${_ns} ${_cl} ${_ur} ${_cx} ${_sv} ${_kc} 2>/dev/null 35 | else 36 | eval kubectl get ${1} ${_ns} ${_cl} ${_ur} ${_cx} ${_sv} ${_kc} -o wide 2>/dev/null 37 | fi 38 | } 39 | 40 | __parse_cmd_result(){ 41 | echo ${1} | tail -n +2 | tr ' ' '$' 42 | } 43 | 44 | __parse_cmd_result_withoutcomment(){ 45 | echo ${1} | tail -n +2 | awk '{print $1}' 46 | } 47 | 48 | __parse_print2list(){ 49 | echo ${1} | tr '$' ' ' | awk '{print $'${2}'}' 50 | } 51 | 52 | __kube_get_exec(){ 53 | local -a _parse_result _parse_list _cmd_result 54 | integer ret=1 55 | _cmd_result=$(__parse_kube_get ${1}) 56 | if [ ! -z ${_cmd_result} ]; then 57 | _parse_result=($(__parse_cmd_result ${_cmd_result})) 58 | _parse_list=() 59 | for _r in ${_parse_result} 60 | do 61 | _parse_list+=("$(${2} ${_r})") 62 | done 63 | _values "${1}" ${_parse_list[@]} && ret=0 64 | fi 65 | return ret 66 | } 67 | 68 | __kube_get_exec_contexts(){ 69 | local -a _parse_result _parse_list _cmd_result 70 | integer ret=1 71 | _cmd_result=$(__parse_kube_get ${1}) 72 | if [ ! -z ${_cmd_result} ]; then 73 | _parse_result=($(__parse_cmd_result ${_cmd_result})) 74 | _parse_list=() 75 | for _r in ${_parse_result} 76 | do 77 | _parse_list+=("$(${2} ${_r})") 78 | done 79 | compadd ${_parse_list[@]} && ret=0 80 | fi 81 | return ret 82 | } 83 | 84 | 85 | __kube_get_exec_nocomment(){ 86 | local -a _parse_list _cmd_result 87 | integer ret=1 88 | _cmd_result=$(__parse_kube_get ${1}) 89 | if [ ! -z ${_cmd_result} ]; then 90 | _parse_list=($(__parse_cmd_result_withoutcomment ${_cmd_result})) 91 | _values "${2}" ${_parse_list[@]} && ret=0 92 | fi 93 | return ret 94 | } 95 | 96 | __output_flag(){ 97 | local -a _default_output_flags _output_withfile_flags 98 | integer ret=1 99 | _default_output_flags=( 100 | 'json' 101 | 'yaml' 102 | 'name' 103 | 'custom-columns' 104 | 'custom-columns-file' 105 | 'go-template' 106 | 'go-template-file' 107 | 'jsonpath' 108 | 'jsonpath-file' 109 | ) 110 | 111 | case $words[1] in 112 | expose | get | edit | delete) 113 | compadd $_default_output_flags[@] 'wide' && ret=0 114 | ;; 115 | api-resources) 116 | compadd 'wide' 'name' && ret=0 117 | ;; 118 | version) 119 | compadd 'yaml' 'json' && ret=0 120 | ;; 121 | *) 122 | compadd $_default_output_flags[@] && ret=0 123 | ;; 124 | esac 125 | 126 | return ret 127 | } 128 | 129 | __kube_get_pods_comment(){ 130 | echo -n $(__parse_print2list ${1} 1)'[ready: '$(__parse_print2list ${1} 2)' status: '$(__parse_print2list ${1} 3)' IP: '$(__parse_print2list ${1} 6)' node: '$(__parse_print2list ${1} 7)']' 131 | } 132 | 133 | __kube_get_pods(){ 134 | __kube_get_exec 'pods' __kube_get_pods_comment 135 | } 136 | 137 | __kube_get_replicationcontrollers_comment(){ 138 | echo -n $(__parse_print2list ${1} 1)'[image: '$(__parse_print2list ${1} 7)']' 139 | } 140 | 141 | __kube_get_api_replicationcontrollers(){ 142 | __kube_get_exec 'replicationcontrollers' __kube_get_replicationcontrollers_comment 143 | } 144 | 145 | __kube_get_namespaces_comment(){ 146 | echo -n $(__parse_print2list ${1} 1)'['$(__parse_print2list ${1} 2)']' 147 | } 148 | 149 | __kube_get_namespaces(){ 150 | __kube_get_exec 'namespaces' __kube_get_namespaces_comment 151 | } 152 | 153 | __kube_get_nodes_comment(){ 154 | echo -n $(__parse_print2list ${1} 1)'[status: '$(__parse_print2list ${1} 2)' role: '$(__parse_print2list ${1} 3)']' 155 | } 156 | 157 | __kube_get_nodes(){ 158 | __kube_get_exec 'nodes' __kube_get_nodes_comment 159 | } 160 | 161 | __kube_get_services_comment(){ 162 | echo -n $(__parse_print2list ${1} 1)'[type: '$(__parse_print2list ${1} 2)' listen: '$(__parse_print2list ${1} 5)']' 163 | } 164 | 165 | __kube_get_services(){ 166 | __kube_get_exec 'services' __kube_get_services_comment 167 | } 168 | 169 | __kube_get_componentstatuses_comment(){ 170 | echo -n $(__parse_print2list ${1} 1)'['$(__parse_print2list ${1} 2)']' 171 | } 172 | 173 | __kube_get_componentstatuses(){ 174 | __kube_get_exec 'componentstatuses' __kube_get_componentstatuses_comment 175 | } 176 | 177 | __kube_get_configmaps_comment(){ 178 | echo -n $(__parse_print2list ${1} 1) 179 | } 180 | 181 | __kube_get_configmaps(){ 182 | __kube_get_exec_nocomment 'configmaps' '' 183 | } 184 | 185 | __kube_get_podsecuritypolicies(){ 186 | __kube_get_exec_nocomment 'podsecuritypolicies' '' 187 | } 188 | 189 | __kube_get_api_resources(){ 190 | local -a comment 191 | case ${7} in 192 | explain) 193 | comment='kubectl explain RESOURCE [options]' 194 | ;; 195 | get) 196 | comment='kubectl get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...](TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags] [options]' 197 | ;; 198 | describe) 199 | comment='kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) [options]' 200 | ;; 201 | delete) 202 | comment='kubectl delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)]) [options]' 203 | ;; 204 | patch) 205 | comment='kubectl patch (-f FILENAME | TYPE NAME) -p PATCH [options]' 206 | ;; 207 | label) 208 | comment='kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version] [options]' 209 | ;; 210 | annotate) 211 | comment='kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version] [options]' 212 | ;; 213 | autoscale) 214 | comment='kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [options]' 215 | ;; 216 | *) 217 | comment='api resources' 218 | ;; 219 | esac 220 | __kube_get_exec_nocomment 'api-resources' ${comment} 221 | } 222 | 223 | __kube_get_api_resources2name(){ 224 | local -a _parse_result __pre_parse_list _parse_list _cmd_result comment 225 | integer ret=1 226 | 227 | case ${7} in 228 | wait) 229 | comment='kubectl wait resource.group/name [--for=delete|--for condition=available] [options]' 230 | ;; 231 | port-forward) 232 | comment='kubectl port-forward TYPE/NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]' 233 | ;; 234 | edit) 235 | comment='kubectl edit (RESOURCE/NAME | -f FILENAME) [options]' 236 | ;; 237 | logs) 238 | comment='kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER] [options]' 239 | ;; 240 | *) 241 | comment='api resources' 242 | ;; 243 | esac 244 | 245 | _cmd_result=$(__parse_kube_get api-resources) 246 | _pre_parse_list=() 247 | _parse_list=() 248 | if [ ! -z ${_cmd_result} ]; then 249 | _pre_parse_list=($(__parse_cmd_result_withoutcomment ${_cmd_result})) 250 | fi 251 | for _a in ${_pre_parse_list} 252 | do 253 | case ${_a} in 254 | bindings) 255 | #TODO 256 | ;; 257 | componentstatuses) 258 | _parse_list+=('componentstatuses:componentstatuses:__kube_get_componentstatuses') 259 | ;; 260 | configmaps) 261 | _parse_list+=('configmaps:configmaps:__kube_get_configmaps') 262 | ;; 263 | endpoints) 264 | _parse_list+=('endpoints:endpoints:__kube_get_endpoints') 265 | ;; 266 | events) 267 | _parse_list+=('events:events:__kube_get_events') 268 | ;; 269 | limitranges) 270 | _parse_list+=('limitranges:limitranges:__kube_get_limitranges') 271 | ;; 272 | namespaces) 273 | _parse_list+=('namespaces:namespaces:__kube_get_namespaces') 274 | ;; 275 | nodes) 276 | _parse_list+=('nodes:nodes:__kube_get_nodes') 277 | ;; 278 | persistentvolumeclaims) 279 | _parse_list+=('persistentvolumeclaims:persistentvolumeclaims:__kube_get_persistentvolumeclaims') 280 | ;; 281 | persistentvolumes) 282 | _parse_list+=('persistentvolumes:persistentvolumes:__kube_get_persistentvolumes') 283 | ;; 284 | pods) 285 | _parse_list+=('pods:pods:__kube_get_pods') 286 | ;; 287 | podtemplates) 288 | #TODO 289 | ;; 290 | replicationcontrollers) 291 | _parse_list+=('replicationcontrollers:replicationcontrollers:__kube_get_replicationcontrollers') 292 | ;; 293 | resourcequotas) 294 | _parse_list+=('resourcequotas:resourcequotas:__kube_get_resourcequotas') 295 | ;; 296 | secrets) 297 | _parse_list+=('secrets:secrets:__kube_get_secrets') 298 | ;; 299 | serviceaccounts) 300 | _parse_list+=('serviceaccounts:serviceaccounts:__kube_get_serviceaccounts') 301 | ;; 302 | services) 303 | _parse_list+=('services:services:__kube_get_services') 304 | ;; 305 | mutatingwebhookconfigurations) 306 | #TODO 307 | ;; 308 | validatingwebhookconfigurations) 309 | #TODO 310 | ;; 311 | customresourcedefinitions) 312 | _parse_list+=('customresourcedefinitions:customresourcedefinitions:__kube_get_customresourcedefinitions') 313 | ;; 314 | apiservices) 315 | _parse_list+=('apiservices:apiservices:__kube_get_apiservices') 316 | ;; 317 | controllerrevisions) 318 | _parse_list+=('controllerrevisions:controllerrevisions:__kube_get_controllerrevisions') 319 | ;; 320 | daemonsets) 321 | _parse_list+=('daemonsets:daemonsets:__kube_get_daemonsets') 322 | ;; 323 | deployments) 324 | _parse_list+=('deployments:deployments:__kube_get_deployments') 325 | ;; 326 | statefulsets) 327 | _parse_list+=('statefulsets:statefulsets:__kube_get_statefulsets') 328 | ;; 329 | ingresses) 330 | _parse_list+=('ingresses:ingresses:__kube_get_ingresses') 331 | ;; 332 | networkpolicies) 333 | _parse_list+=('networkpolicies:networkpolicies:__kube_get_networkpolicies') 334 | ;; 335 | podsecuritypolicies) 336 | _parse_list+=('podsecuritypolicies:podsecuritypolicies:__kube_get_podsecuritypolicies') 337 | ;; 338 | clusterrolebindings) 339 | _parse_list+=('clusterrolebindings:clusterrolebindings:__kube_get_clusterrolebindings') 340 | ;; 341 | clusterroles) 342 | _parse_list+=('clusterroles:clusterroles:__kube_get_clusterroles') 343 | ;; 344 | rolebindings) 345 | _parse_list+=('rolebindings:rolebindings:__kube_get_rolebindings') 346 | ;; 347 | roles) 348 | _parse_list+=('roles:roles:__kube_get_roles') 349 | ;; 350 | storageclasses) 351 | _parse_list+=('storageclasses:storageclasses:__kube_get_storageclasses') 352 | ;; 353 | volumeattachments) 354 | #TODO 355 | ;; 356 | esac 357 | done 358 | 359 | _values -S '/' ${comment} $_parse_list && ret=0 360 | 361 | return ret 362 | } 363 | 364 | __kube_rollout_resources2name(){ 365 | local -a _parse_list 366 | integer ret=1 367 | _parse_list=() 368 | _parse_list+=('daemonsets:daemonsets:__kube_get_daemonsets') 369 | _parse_list+=('deployments:deployments:__kube_get_deployments') 370 | _parse_list+=('statefulsets:statefulsets:__kube_get_statefulsets') 371 | _values -S '/' 'kubectl rollout SUBCOMMAND [options]' $_parse_list && ret=0 372 | 373 | return ret 374 | } 375 | 376 | __kube_get_endpoints_comment(){ 377 | echo -n $(__parse_print2list ${1} 1)'[listen: '$(__parse_print2list ${1} 2)']' 378 | } 379 | 380 | __kube_get_endpoints(){ 381 | __kube_get_exec 'endpoints' __kube_get_endpoints_comment 382 | } 383 | 384 | __kube_get_events_comment(){ 385 | echo -n $(__parse_print2list ${1} 4)'[reasen: '$(__parse_print2list ${1} 7)']' 386 | } 387 | 388 | __kube_get_events(){ 389 | __kube_get_exec 'events' __kube_get_events_comment 390 | } 391 | 392 | __kube_get_limitranges_comment(){ 393 | echo -n $(__parse_print2list ${1} 1)'[created_at: '$(__parse_print2list ${1} 2)']' 394 | } 395 | 396 | __kube_get_limitranges(){ 397 | __kube_get_exec 'limitranges' __kube_get_limitranges_comment 398 | } 399 | 400 | __kube_get_resourcequotas_comment(){ 401 | echo -n $(__parse_print2list ${1} 1)'[created_at: '$(__parse_print2list ${1} 2)']' 402 | } 403 | 404 | __kube_get_resourcequotas(){ 405 | __kube_get_exec 'resourcequotas' __kube_get_resourcequotas_comment 406 | } 407 | 408 | __kube_get_customresourcedefinitions_comment(){ 409 | echo -n $(__parse_print2list ${1} 1)'[created_at: '$(__parse_print2list ${1} 2)']' 410 | } 411 | 412 | __kube_get_customresourcedefinitions(){ 413 | __kube_get_exec 'customresourcedefinitions' __kube_get_customresourcedefinitions_comment 414 | } 415 | 416 | __kube_get_persistentvolumeclaims_comment(){ 417 | echo -n $(__parse_print2list ${1} 1)'[volume: '$(__parse_print2list ${1} 4)' storageclass: '$(__parse_print2list ${1} 6)']' 418 | } 419 | 420 | __kube_get_persistentvolumeclaims(){ 421 | __kube_get_exec 'persistentvolumeclaims' __kube_get_persistentvolumeclaims_comment 422 | } 423 | 424 | __kube_get_persistentvolumes_comment(){ 425 | _pv_claim=$(echo ${1} | tr '$' ' ' | awk '{print $6}') 426 | echo -n $(__parse_print2list ${1} 1)'[claim: '$(echo ${_pv_claim} | awk -F '/' '{print $2}')' storageclass: '$(__parse_print2list ${1} 7)']' 427 | } 428 | 429 | __kube_get_persistentvolumes(){ 430 | __kube_get_exec 'persistentvolumes' __kube_get_persistentvolumes_comment 431 | } 432 | 433 | __kube_get_secrets_comment(){ 434 | echo -n $(__parse_print2list ${1} 1)'['$(__parse_print2list ${1} 2)']' 435 | } 436 | 437 | __kube_get_secrets(){ 438 | __kube_get_exec 'secrets' __kube_get_secrets_comment 439 | } 440 | 441 | __kube_get_serviceaccounts(){ 442 | __kube_get_exec_nocomment 'serviceaccounts' ${7} 443 | } 444 | 445 | __kube_get_apiservices_comment(){ 446 | echo -n $(__parse_print2list ${1} 1)'[created_at: '$(__parse_print2list ${1} 2)']' 447 | } 448 | 449 | __kube_get_apiservices(){ 450 | __kube_get_exec_nocomment 'apiservices' ${7} 451 | } 452 | 453 | __kube_get_controllerrevisions_comment(){ 454 | echo -n $(__parse_print2list ${1} 1)'['$(__parse_print2list ${1} 2)']' 455 | } 456 | 457 | __kube_get_controllerrevisions(){ 458 | __kube_get_exec 'controllerrevisions' __kube_get_controllerrevisions_comment 459 | } 460 | 461 | __kube_get_daemonsets_comment(){ 462 | echo -n $(__parse_print2list ${1} 1)'[desired: '$(__parse_print2list ${1} 2)' current: '$(__parse_print2list ${1} 3)' ready: '$(__parse_print2list ${1} 4)' up-to-date: '$(__parse_print2list ${1} 5)' available: '$(__parse_print2list ${1} 6)']' 463 | } 464 | 465 | __kube_get_daemonsets(){ 466 | __kube_get_exec 'daemonsets' __kube_get_daemonsets_comment 467 | } 468 | 469 | __kube_get_deployments_comment(){ 470 | echo -n $(__parse_print2list ${1} 1)'[desired: '$(__parse_print2list ${1} 2)' current: '$(__parse_print2list ${1} 3)' up-to-date: '$(__parse_print2list ${1} 4)' available: '$(__parse_print2list ${1} 5)']' 471 | } 472 | 473 | __kube_get_deployments(){ 474 | __kube_get_exec 'deployments' __kube_get_deployments_comment 475 | } 476 | 477 | __kube_get_statefulsets_comment(){ 478 | echo -n $(__parse_print2list ${1} 1)'[desired: '$(__parse_print2list ${1} 2)' current: '$(__parse_print2list ${1} 3)' up-to-date: '$(__parse_print2list ${1} 4)']' 479 | } 480 | 481 | __kube_get_statefulsets(){ 482 | __kube_get_exec 'statefulsets' __kube_get_statefulsets_comment 483 | } 484 | 485 | __kube_get_ingresses_comment(){ 486 | echo -n $(__parse_print2list ${1} 1)'[hosts: '$(__parse_print2list ${1} 2)' lieten '$(__parse_print2list ${1} 3)':'$(__parse_print2list ${1} 4)']' 487 | } 488 | 489 | __kube_get_ingresses(){ 490 | __kube_get_exec 'ingresses' __kube_get_ingresses_comment 491 | } 492 | 493 | __kube_get_networkpolicies_comment(){ 494 | echo -n $(__parse_print2list ${1} 1)'[pod-selector: '$(__parse_print2list ${1} 2)']' 495 | } 496 | 497 | __kube_get_networkpolicies(){ 498 | __kube_get_exec 'networkpolicies' __kube_get_networkpolicies_comment 499 | } 500 | 501 | __kube_get_clusterrolebindings(){ 502 | __kube_get_exec_nocomment 'clusterrolebindings' '' 503 | } 504 | 505 | __kube_get_clusterroles(){ 506 | __kube_get_exec_nocomment 'clusterroles' '' 507 | } 508 | 509 | __kube_get_rolebindings(){ 510 | __kube_get_exec_nocomment 'rolebindings' '' 511 | } 512 | 513 | __kube_get_roles(){ 514 | __kube_get_exec_nocomment 'roles' '' 515 | } 516 | 517 | __kube_get_storageclasses_comment(){ 518 | echo -n $(__parse_print2list ${1} 1)'[provisioner: '$(__parse_print2list ${1} 2)']' 519 | } 520 | 521 | __kube_get_storageclasses(){ 522 | __kube_get_exec 'storageclasses' __kube_get_storageclasses_comment 523 | } 524 | 525 | __kube_get_contexts_comment(){ 526 | if echo ${1} | grep '*' > /dev/null 2>&1; then 527 | echo -n $(__parse_print2list ${1} 2) 528 | else 529 | echo -n $(__parse_print2list ${1} 1) 530 | fi 531 | } 532 | 533 | __kube_get_contexts(){ 534 | __kube_get_exec_contexts 'contexts' __kube_get_contexts_comment 535 | } 536 | 537 | __hook_api_resources(){ 538 | case $words[2] in 539 | bindings) 540 | #TODO 541 | ;; 542 | componentstatuses) 543 | __kube_get_componentstatuses 544 | ;; 545 | configmaps) 546 | __kube_get_configmaps 547 | ;; 548 | endpoints) 549 | __kube_get_endpoints 550 | ;; 551 | events) 552 | __kube_get_events 553 | ;; 554 | limitranges) 555 | __kube_get_limitranges 556 | ;; 557 | namespaces) 558 | __kube_get_namespaces 559 | ;; 560 | nodes) 561 | __kube_get_nodes 562 | ;; 563 | persistentvolumeclaims) 564 | __kube_get_persistentvolumeclaims 565 | ;; 566 | persistentvolumes) 567 | __kube_get_persistentvolumes 568 | ;; 569 | pods) 570 | __kube_get_pods 571 | ;; 572 | podtemplates) 573 | #TODO 574 | ;; 575 | replicationcontrollers) 576 | __kube_get_api_replicationcontrollers 577 | ;; 578 | resourcequotas) 579 | __kube_get_resourcequotas 580 | ;; 581 | secrets) 582 | __kube_get_secrets 583 | ;; 584 | serviceaccounts) 585 | __kube_get_serviceaccounts 586 | ;; 587 | services) 588 | __kube_get_services 589 | ;; 590 | mutatingwebhookconfigurations) 591 | #TODO 592 | ;; 593 | validatingwebhookconfigurations) 594 | #TODO 595 | ;; 596 | customresourcedefinitions) 597 | __kube_get_customresourcedefinitions 598 | ;; 599 | apiservices) 600 | __kube_get_apiservices 601 | ;; 602 | controllerrevisions) 603 | __kube_get_controllerrevisions 604 | ;; 605 | daemonsets) 606 | __kube_get_daemonsets 607 | ;; 608 | deployments) 609 | __kube_get_deployments 610 | ;; 611 | statefulsets) 612 | __kube_get_statefulsets 613 | ;; 614 | ingresses) 615 | __kube_get_ingresses 616 | ;; 617 | networkpolicies) 618 | __kube_get_networkpolicies 619 | ;; 620 | podsecuritypolicies) 621 | __kube_get_podsecuritypolicies 622 | ;; 623 | clusterrolebindings) 624 | __kube_get_clusterrolebindings 625 | ;; 626 | clusterroles) 627 | __kube_get_clusterroles 628 | ;; 629 | rolebindings) 630 | __kube_get_rolebindings 631 | ;; 632 | roles) 633 | __kube_get_roles 634 | ;; 635 | storageclasses) 636 | __kube_get_storageclasses 637 | ;; 638 | volumeattachments) 639 | #TODO 640 | ;; 641 | esac 642 | } 643 | 644 | 645 | __create_cmd(){ 646 | local -a _create_cmds 647 | integer ret=1 648 | _create_cmds=( 649 | 'clusterrole[Create a ClusterRole.]' 650 | 'clusterrolebinding[Create a ClusterRoleBinding for a particular ClusterRole]' 651 | 'configmap[Create a configmap from a local file, directory or literal value]' 652 | 'deployment[Create a deployment with the specified name.]' 653 | 'job[Create a job with the specified name.]' 654 | 'help[Get more information about a this command help]' 655 | 'namespace[Create a namespace with the specified name.]' 656 | 'poddisruptionbudget[Create a pod disruption budget with the specified name.]' 657 | 'priorityclass[Create a priorityclass with the specified name.]' 658 | 'quota[Create a quota with the specified name.]' 659 | 'role[Create a role with single rule.]' 660 | 'rolebinding[Create a RoleBinding for a particular Role or ClusterRole]' 661 | 'secret[Create a secret using specified subcommand]' 662 | 'service[Create a service using specified subcommand.]' 663 | 'serviceaccount[Create a service account with the specified name.]' 664 | ) 665 | _values 'kubectl create -f FILENAME [options]' $_create_cmds[@] && ret=0 666 | 667 | return ret 668 | } 669 | 670 | __expose_cmd(){ 671 | local -a _expose_cmds 672 | integer ret=1 673 | _expose_cmds=( 674 | 'pod:pod:__kube_get_pods' 675 | 'service:service:__kube_get_services' 676 | 'replicationcontroller' 677 | 'deployment:deployment:__kube_get_deployments' 678 | 'replicaset' 679 | ) 680 | _values 'kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [options]' $_expose_cmds[@] && ret=0 681 | 682 | return ret 683 | } 684 | 685 | __set_cmd(){ 686 | local -a _set_cmds 687 | integer ret=1 688 | _set_cmds=( 689 | 'env[Update environment variables on a pod template]' 690 | 'image[Update image of a pod template]' 691 | 'resources[Update resource requests/limits on objects with pod templates]' 692 | 'selector[Set the selector on a resource]' 693 | 'serviceaccount[Update ServiceAccount of a resource]' 694 | 'subject[Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding]' 695 | ) 696 | _values 'kubectl set SUBCOMMAND [options]' $_set_cmds[@] && ret=0 697 | 698 | return ret 699 | } 700 | 701 | __rollout_cmd(){ 702 | local -a _rollout_cmds 703 | integer ret=1 704 | _rollout_cmds=( 705 | 'history[View rollout history]' 706 | 'pause[Mark the provided resource as paused]' 707 | 'resume[Resume a paused resource]' 708 | 'status[Show the status of the rollout]' 709 | 'undo[Undo a previous rollout]' 710 | ) 711 | _values 'kubectl rollout SUBCOMMAND [options]' $_rollout_cmds[@] && ret=0 712 | 713 | return ret 714 | } 715 | 716 | __scale_cmd() { 717 | local -a _scale_cmds 718 | integer ret=1 719 | _scale_cmds=( 720 | '--replicas[The new desired number of replicas. Required.]' 721 | ) 722 | _values 'kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) [options]' $_scale_cmds[@] && ret=0 723 | 724 | return ret 725 | } 726 | 727 | __hook_autoscale_cmd() { 728 | local -a _hook_autoscale_cmds 729 | integer ret=1 730 | _hook_autoscale_cmds=( 731 | '--max[The upper limit for the number of pods that can be set by the autoscaler. Required.]' 732 | ) 733 | _values 'kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [options]' $_hook_autoscale_cmds[@] && ret=0 734 | 735 | return ret 736 | } 737 | 738 | __certificate_cmd(){ 739 | local -a _certificate_cmds 740 | integer ret=1 741 | _certificate_cmds=( 742 | 'approve[Approve a certificate signing request]' 743 | 'deny[Deny a certificate signing request]' 744 | ) 745 | _values 'certificate command' $_certificate_cmds[@] && ret=0 746 | 747 | return ret 748 | } 749 | 750 | __clusterinfo_cmd(){ 751 | local -a _clusterinfo_cmds 752 | integer ret=1 753 | _clusterinfo_cmds=( 754 | 'dump[Dump lots of relevant info for debugging and diagnosis]' 755 | ) 756 | _values 'clusterinfo command' $_clusterinfo_cmds[@] && ret=0 757 | 758 | return ret 759 | } 760 | 761 | __top_cmd(){ 762 | local -a _top_cmds 763 | integer ret=1 764 | _top_cmds=( 765 | 'node[Display Resource (CPU/Memory/Storage) usage of nodes]' 766 | 'pod[Display Resource (CPU/Memory/Storage) usage of pods]' 767 | ) 768 | _values 'kubectl top [flags] [options]' $_top_cmds[@] && ret=0 769 | 770 | return ret 771 | } 772 | 773 | __auth_cmd(){ 774 | local -a _auth_cmds 775 | integer ret=1 776 | _auth_cmds=( 777 | 'can-i[Check whether an action is allowed]' 778 | 'reconcile[Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRole binding objects]' 779 | ) 780 | _values 'kubectl auth [flags] [options]' $_auth_cmds[@] && ret=0 781 | 782 | return ret 783 | } 784 | 785 | __completion_cmd(){ 786 | local -a _completion_cmds 787 | integer ret=1 788 | _completion_cmds=( 789 | 'zsh[Shell designed for interactive use, although it is also a powerful scripting language.]' 790 | 'bash[Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell.]' 791 | ) 792 | _values 'completion command' $_completion_cmds[@] && ret=0 793 | 794 | return ret 795 | } 796 | 797 | # No alpha commands are available in this version of kubectl 798 | # __alpha_cmd(){ 799 | # local -a _alpha_cmds 800 | # integer ret=1 801 | # _alpha_cmds=( 802 | # ) 803 | # _values 'alpha command' $_alpha_cmds[@] && ret=0 804 | # 805 | # return ret 806 | # } 807 | 808 | __config_cmd(){ 809 | local -a _config_cmds 810 | integer ret=1 811 | _config_cmds=( 812 | 'current-context[Displays the current-context]' 813 | 'delete-cluster[Delete the specified cluster from the kubeconfig]' 814 | 'delete-context[Delete the specified context from the kubeconfig]' 815 | 'get-clusters[Display clusters defined in the kubeconfig]' 816 | 'get-contexts[Describe one or many contexts]' 817 | 'rename-context[Renames a context from the kubeconfig file.]' 818 | 'set[Sets an individual value in a kubeconfig file]' 819 | 'set-cluster[Sets a cluster entry in kubeconfig]' 820 | 'set-context[Sets a context entry in kubeconfig]' 821 | 'set-credentials[Sets a user entry in kubeconfig]' 822 | 'unset[Unsets an individual value in a kubeconfig file]' 823 | 'use-context[Sets the current-context in a kubeconfig file]' 824 | 'view[Display merged kubeconfig settings or a specified kubeconfig file]' 825 | ) 826 | _values 'kubectl config SUBCOMMAND [options]' $_config_cmds[@] && ret=0 827 | 828 | return ret 829 | } 830 | 831 | __plugin_cmd(){ 832 | local -a _plugin_cmds 833 | integer ret=1 834 | _plugin_cmds=( 835 | 'list[list all visible plugin executables on a user'\''s PATH]' 836 | ) 837 | _values 'kubectl plugin [flags] [options]' $_plugin_cmds[@] && ret=0 838 | 839 | return ret 840 | } 841 | 842 | __basic_cmd(){ 843 | local -a _basic_cmds 844 | integer ret=1 845 | _basic_cmds=( 846 | 'create[Create a resource from a file or from stdin.]' 847 | 'expose[Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service]' 848 | 'run[Run a particular image on the cluster]' 849 | 'set[Set specific features on objects]' 850 | 'explain[Documentation of resources]' 851 | 'get[Display one or many resources]' 852 | 'edit[Edit a resource on the server]' 853 | 'delete[Delete resources by filenames, stdin, resources and names, or by resources and label selector]' 854 | 'rollout[Manage the rollout of a resource]' 855 | 'scale[Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job]' 856 | 'autoscale[Auto-scale a Deployment, ReplicaSet, or ReplicationController]' 857 | 'certificate[Modify certificate resources.]' 858 | 'cluster-info[Display cluster info]' 859 | 'top[Display Resource (CPU/Memory/Storage) usage.]' 860 | 'cordon[Mark node as unschedulable]' 861 | 'uncordon[Mark node as schedulable]' 862 | 'drain[Drain node in preparation for maintenance]' 863 | 'taint[Update the taints on one or more nodes]' 864 | 'describe[Show details of a specific resource or group of resources]' 865 | 'logs[Print the logs for a container in a pod]' 866 | 'attach[Attach to a running container]' 867 | 'exec[Execute a command in a container]' 868 | 'port-forward[Forward one or more local ports to a pod]' 869 | 'proxy[Run a proxy to the Kubernetes API server]' 870 | 'cp[Copy files and directories to and from containers.]' 871 | 'auth[Inspect authorization]' 872 | 'diff[Diff live version against would-be applied version]' 873 | 'apply[Apply a configuration to a resource by filename or stdin]' 874 | 'patch[Update field(s) of a resource using strategic merge patch]' 875 | 'replace[Replace a resource by filename or stdin]' 876 | 'wait[Experimental: Wait for a specific condition on one or many resources.]' 877 | 'convert[Convert config files between different API versions]' 878 | 'label[Update the labels on a resource]' 879 | 'annotate[Update the annotations on a resource]' 880 | 'completion[Output shell completion code for the specified shell (bash or zsh)]' 881 | # No alpha commands are available in this version of kubectl 882 | # 'alpha[Commands for features in alpha]' 883 | 'api-resources[Print the supported API resources on the server]' 884 | 'api-versions[Print the supported API versions on the server, in the form of \"group/version\"]' 885 | 'config[Modify kubeconfig files]' 886 | 'plugin[Provides utilities for interacting with plugins.]' 887 | 'version[Print the client and server version information]' 888 | 'help[Help about any command]' 889 | 'options[List of global command-line options (applies to all commands).]' 890 | ) 891 | _values 'kubectl [flags] [options]' $_basic_cmds[@] && ret=0 892 | 893 | return ret 894 | } 895 | 896 | _kubectl(){ 897 | typeset -A opt_args 898 | integer ret=1 899 | 900 | local -a _global_flags 901 | _global_flags=( 902 | '--alsologtostderr[log to standard error as well as files]' 903 | '--as[Username to impersonate for the operation]' 904 | '--as-group[Group to impersonate for the operation, this flag can be repeated to specify multiple groups.]' 905 | '--cache-dir[Default HTTP cache directory]' 906 | '--certificate-authority[Path to a cert file for the certificate authority]' 907 | '--client-certificate[Path to a client certificate file for TLS]' 908 | '--client-key[Path to a client key file for TLS]' 909 | '--cluster[The name of the kubeconfig cluster to use]' 910 | '--context[The name of the kubeconfig context to use]:contexts:__kube_get_contexts' 911 | '--help[Get more information about a this command help]' 912 | '--insecure-skip-tls-verify[If true, the server'\''s certificate will not be checked for validity. This will make your HTTPS connections insecure]' 913 | '--kubeconfig[Path to the kubeconfig file to use for CLI requests.]:kubeconfig:_files' 914 | '--log-backtrace-at[when logging hits line file[N, emit a stack trace]' 915 | '--log-dir[If non-empty, write log files in this directory]:dirs:_files' 916 | '--log-flush-frequency[Maximum number of seconds between log flushes]' 917 | '--logtostderr=true[log to standard error instead of files]' 918 | '--match-server-version[Require server version to match client version]' 919 | {-n,--namespace}'[If present, the namespace scope for this CLI request]:namespaces:__kube_get_namespaces' 920 | '--password[Password for basic authentication to the API server]' 921 | '--profile[Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)]' 922 | '--profile-output[Name of the file to write the profile to]' 923 | '--request-timeout[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.]' 924 | {-s,--server}'[The address and port of the Kubernetes API server]' 925 | '--stderrthreshold[logs at or above this threshold go to stderr]' 926 | '--token[Bearer token for authentication to the API server]' 927 | '--user[The name of the kubeconfig user to use]' 928 | '--username[Username for basic authentication to the API server]' 929 | {-v,--v}'[level for V logs]' 930 | '--vmodule[comma-separated list of pattern=N settings for file-filtered logging]' 931 | ) 932 | 933 | _arguments \ 934 | ${_global_flags[@]} \ 935 | "1: :{_alternative ':basic_cmd:__basic_cmd'}" \ 936 | '*:: :->args' && ret=0 937 | 938 | case $state in 939 | args) 940 | 941 | if [ ! -z ${opt_args[-n]} ]; then 942 | _filter_namespace=${opt_args[-n]} 943 | fi 944 | 945 | if [ ! -z ${opt_args[--namespace]} ]; then 946 | _filter_namespace=${opt_args[--namespace]} 947 | fi 948 | 949 | if [ ! -z ${opt_args[--cluster]} ]; then 950 | _filter_cluster=${opt_args[--cluster]} 951 | fi 952 | 953 | if [ ! -z ${opt_args[--user]} ]; then 954 | _filter_user=${opt_args[--user]} 955 | fi 956 | 957 | if [ ! -z ${opt_args[--context]} ]; then 958 | _filter_context=${opt_args[--context]} 959 | fi 960 | 961 | if [ ! -z ${opt_args[--server]} ]; then 962 | _filter_server=${opt_args[--server]} 963 | fi 964 | 965 | if [ ! -z ${opt_args[--kubeconfig]} ]; then 966 | _filter_kubeconfig=${opt_args[--kubeconfig]} 967 | fi 968 | 969 | 970 | case $words[1] in 971 | create) 972 | _arguments \ 973 | ${_global_flags[@]} \ 974 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 975 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 976 | '--edit[Edit the API resource before creating]' \ 977 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to use to create the resource]:files:_files' \ 978 | '--help[Get more information about a this command help]' \ 979 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...See custom columns \[http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\], golang template \[http://golang.org/pkg/text/template/#pkg-overview\] and jsonpath template \[http://kubernetes.io/docs/user-guide/jsonpath\].]:output_flag:__output_flag' \ 980 | '--raw[Raw URI to POST to the server. Uses the transport specified by the kubeconfig file.]' \ 981 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 982 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 983 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 984 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)]' \ 985 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 986 | '--validate[If true, use a schema to validate the input before sending it]' \ 987 | '--windows-line-endings[Only relevant if --edit=true. Defaults to the line ending native to your platform.]' \ 988 | "1: :{_alternative ':create_cmd:__create_cmd' }" && ret=0 989 | ;; 990 | 991 | expose) 992 | _arguments \ 993 | ${_global_flags[@]} \ 994 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 995 | '--cluster-ip[ClusterIP to be assigned to the service. Leave empty to auto-allocate, or set to '\''None'\'' to create a headless service.]' \ 996 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 997 | '--external-ip[Additional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP.]' \ 998 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to expose a service]:files:_files' \ 999 | '--generator[The name of the API generator to use. There are 2 generators: '\''service/v1'\'' and '\''service/v2'\''. The only difference between them is that service port in v1 is named '\''default'\'', while it is left unnamed in v2. Default is '\''service/v2'\''.]' \ 1000 | '--help[Get more information about a this command help]' \ 1001 | '(-l --labels)'{-l,--labels}'[Labels to apply to the service created by this call.]' \ 1002 | '--load-balancer-ip[IP to assign to the LoadBalancer. If empty, an ephemeral IP will be created and used \(cloud-provider specific\).]' \ 1003 | '--name[The name for the newly created object.]' \ 1004 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1005 | '--overrides[An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. ]' \ 1006 | '--port[The port that the service should serve on. Copied from the resource being exposed, if unspecified]' \ 1007 | '--protocol[The network protocol for the service to be created. Default is '\''TCP'\''.]' \ 1008 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1009 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1010 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 1011 | '--selector[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1012 | '--session-affinity[If non-empty, set the session affinity for the service to this; legal values: '\''None'\'', '\''ClientIP'\'']' \ 1013 | '--target-port[Name or number for the port on the container that the service should direct traffic to. Optional.]' \ 1014 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1015 | '--type[Type for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName. Default is '\''ClusterIP'\''.]' \ 1016 | "1: :{_alternative ':expose_cmd:__expose_cmd' }" && ret=0 1017 | ;; 1018 | 1019 | run) 1020 | _arguments \ 1021 | ${_global_flags[@]} \ 1022 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1023 | '--attach=[If true, wait for the Pod to start running, and then attach to the Pod as if '\''kubectl attach ...'\'' were called. Default false, unless '\''-i/--stdin'\'' is set, in which case the default is true. With '\''--restart=Never'\'' the exit code of the container process is returned.]' \ 1024 | '--cascade[If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.]' \ 1025 | '--command[If true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.]' \ 1026 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1027 | '--env[Environment variables to set in the container]' \ 1028 | '--expose[If true, a public, external service is created for the container(s) which are run]' \ 1029 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to use to create the resource]:files:_files' \ 1030 | '--force[Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.]' \ 1031 | '--generator[The name of the API generator to use. There are 2 generators: '\''service/v1'\'' and '\''service/v2'\''. The only difference between them is that service port in v1 is named '\''default'\'', while it is left unnamed in v2. Default is '\''service/v2'\''.]' \ 1032 | '--help[Get more information about a this command help]' \ 1033 | '--grace-period[Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).]' \ 1034 | '--hostport[The host port mapping for the container port. To demonstrate a single-machine container.]' \ 1035 | '--image[The image for the container to run.]' \ 1036 | '--image-pull-policy[The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server]' \ 1037 | '(-l --labels)'{-l,--labels}'[Labels to apply to the service created by this call.]' \ 1038 | '--leave-stdin-open[ If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.]' \ 1039 | '--limits[The resource requirement limits for this container. For example, '\''cpu=200m,memory=512Mi'\''. Note that server side components may assign limits depending on the server configuration, such as limit ranges.]' \ 1040 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...See custom columns \[http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\], golang template \[http://golang.org/pkg/text/template/#pkg-overview\] and jsonpath template \[http://kubernetes.io/docs/user-guide/jsonpath\].]:output_flag:__output_flag' \ 1041 | '--overrides[An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. ]' \ 1042 | '--pod-running-timeout[The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running]' \ 1043 | '--port[The port that this container exposes. If --expose is true, this is also the port used by the service that is created.]' \ 1044 | '--quiet[If true, suppress prompt messages.]' \ 1045 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1046 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1047 | '(-r --replicas)'{-r,--replicas}'[Number of replicas to create for this container. Default is 1.]' \ 1048 | '--requests[The resource requirement requests for this container. For example, '\''cpu=100m,memory=256Mi'\''. Note that server side components may assign requests depending on the server configuration, such as limit ranges.]' \ 1049 | '--restart[The restart policy for this Pod. Legal values \[Always, OnFailure, Never\]. If set to '\''Always'\'' a deployment is created, if set to '\''OnFailure'\'' a job is created, if set to '\''Never'\'', a regular pod is created. For the latter two --replicas must be 1. Default '\''Always'\'', for CronJobs '\''Never'\''.]' \ 1050 | '--rm[If true, delete resources created in this command for attached containers.]' \ 1051 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 1052 | '--schedule[A schedule in the Cron format the job should be run with.]' \ 1053 | '--service-generator[The name of the generator to use for creating a service. Only used if --expose is true]' \ 1054 | '--service-overrides[An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.]' \ 1055 | '--serviceaccount[Service account to set in the pod spec]' \ 1056 | '(-i --stdin)'{-i,--stdin}'[Keep stdin open on the container(s) in the pod, even if nothing is attached.]' \ 1057 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1058 | '--timeout[The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object]' \ 1059 | '(-t --tty)'{-t,--tty}'[Allocated a TTY for each container in the pod.]' \ 1060 | '--wait[If true, wait for resources to be gone before returning. This waits for finalizers.]' \ && ret=0 1061 | ;; 1062 | 1063 | set) 1064 | _arguments \ 1065 | ${_global_flags[@]} \ 1066 | "1: :{_alternative ':set_cmd:__set_cmd' }" && ret=0 1067 | ;; 1068 | 1069 | explain) 1070 | _arguments \ 1071 | ${_global_flags[@]} \ 1072 | "1: :{_alternative ':get_resources:__kube_get_api_resources explain' }" && ret=0 1073 | ;; 1074 | 1075 | get) 1076 | _arguments \ 1077 | ${_global_flags[@]} \ 1078 | '--all-namespaces[If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.]' \ 1079 | '--allow-missing-template-key[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1080 | '--chunk-size[Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.]' \ 1081 | '--export[If true, use '\''export'\'' for the resources. Exported resources are stripped of cluster-specific information.]' \ 1082 | '--field-selector[Selector (field query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.]' \ 1083 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to use to create the resource]' \ 1084 | '--ignore-not-found[If the requested object does not exist the command will return exit code 0.]' \ 1085 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., \"--all\". Objects with empty metadata.initializers are regarded as initialized.]' \ 1086 | '(-L --label-columns)'{-L,--label-columns}'[Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...]' \ 1087 | '--no-headers[When using the default or custom-column output format, don'\''t print headers (default print headers).]' \ 1088 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...See custom columns \[http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\], golang template \[http://golang.org/pkg/text/template/#pkg-overview\] and jsonpath template \[http://kubernetes.io/docs/user-guide/jsonpath\].]:output_flag:__output_flag' \ 1089 | '--raw[Raw URI to request from the server. Uses the transport specified by the kubeconfig file.]' \ 1090 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1091 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1092 | '--server-print[If true, have the server return the appropriate table output. Supports extension APIs and CRDs.]' \ 1093 | '--show-kind[If present, list the resource type for the requested object(s).]' \ 1094 | '--show-labels[When printing, show all labels as the last column (default hide labels column)]' \ 1095 | '--sort-by[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.]' \ 1096 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1097 | '--use-openapi-print-columns[If true, use x-kubernetes-print-column metadata (if present) from the OpenAPI schema for displaying a resource.]' \ 1098 | '(-w --watch)'{-w,--watch}'[After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.]' \ 1099 | '--watch-only[Watch for changes to the requested object(s), without listing/getting first.]' \ 1100 | "1: :{_alternative ':get_resources:__kube_get_api_resources get' }" \ 1101 | "2: :{_alternative ':get_resources:__hook_api_resources'}" && ret=0 1102 | ;; 1103 | 1104 | edit) 1105 | _arguments \ 1106 | ${_global_flags[@]} \ 1107 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1108 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to use to create the resource]:files:_files' \ 1109 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.]' \ 1110 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...See custom columns \[http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\], golang template \[http://golang.org/pkg/text/template/#pkg-overview\] and jsonpath template \[http://kubernetes.io/docs/user-guide/jsonpath\].]:output_flag:__output_flag' \ 1111 | '--output-patch[Output the patch if the resource is edited.]' \ 1112 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1113 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1114 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 1115 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1116 | '--validate[If true, use a schema to validate the input before sending it]' \ 1117 | '--windows-line-endings[Defaults to the line ending native to your platform.]' \ 1118 | "1: :{_alternative ':get_resources:__kube_get_api_resources2name edit' }" && ret=0 1119 | ;; 1120 | 1121 | delete) 1122 | _arguments \ 1123 | ${_global_flags[@]} \ 1124 | '--all[Delete all resources, including uninitialized ones, in the namespace of the specified resource types.]' \ 1125 | '--cascade[If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.]' \ 1126 | '--field-selector[Selector (field query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.]' \ 1127 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to use to create the resource]:files:_files' \ 1128 | '--force[Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.]' \ 1129 | '--grace-period[Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).]' \ 1130 | '--ignore-not-found[Treat \"resource not found\" as a successful delete. Defaults to \"true\" when --all is specified.]' \ 1131 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.]' \ 1132 | '--now[If true, resources are signaled for immediate shutdown (same as --grace-period=1).]' \ 1133 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...See custom columns \[http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\], golang template \[http://golang.org/pkg/text/template/#pkg-overview\] and jsonpath template \[http://kubernetes.io/docs/user-guide/jsonpath\].]:output_flag:__output_flag' \ 1134 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1135 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1136 | '--timeout[The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object]' \ 1137 | '--wait[If true, wait for resources to be gone before returning. This waits for finalizers.]' \ 1138 | "1: :{_alternative ':get_resources:__kube_get_api_resources delete' }" \ 1139 | "2: :{_alternative ':get_resources:__hook_api_resources'}" && ret=0 1140 | ;; 1141 | 1142 | rollout) 1143 | _arguments \ 1144 | ${_global_flags[@]} \ 1145 | "1: :{_alternative ':rollout_cmd:__rollout_cmd' }" \ 1146 | "2: :{_alternative ':rollout_resources:__kube_rollout_resources2name'}" && ret=0 1147 | ;; 1148 | 1149 | scale) 1150 | _arguments \ 1151 | ${_global_flags[@]} \ 1152 | '--all[Select all resources in the namespace of the specified resource types]' \ 1153 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1154 | '--current-replicas[Precondition for current size. Requires that the current size of the resource match this value in order to scale.]' \ 1155 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to set a new size]:files:_files' \ 1156 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1157 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1158 | '--resource-version[Requires that the current resource version match this value in order to scale.]' \ 1159 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1160 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1161 | '--timeout[The length of time to wait before giving up on a scale operation, zero means don'\''t wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).]' \ 1162 | "1: :{_alternative ':scale_cmd:__scale_cmd' }" && ret=0 1163 | ;; 1164 | 1165 | autoscale) 1166 | _arguments \ 1167 | ${_global_flags[@]} \ 1168 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1169 | '--cpu-percent[The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it'\''s not specified or negative, a default autoscaling policy will be used.]' \ 1170 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1171 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to autoscale.]:files:_files' \ 1172 | '--generator[The name of the API generator to use. Currently there is only 1 generator.]' \ 1173 | '--max[The upper limit for the number of pods that can be set by the autoscaler. Required.]' \ 1174 | '--min[The lower limit for the number of pods that can be set by the autoscaler. If it'\''s not specified or negative, the server will apply a default value.]' \ 1175 | '--name[The name for the newly created object. If not specified, the name of the input resource will be used.]' \ 1176 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1177 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1178 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1179 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 1180 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1181 | "1: :{_alternative ':get_resources:__kube_get_api_resources autoscale' }" \ 1182 | "2: :{_alternative ':get_resources:__hook_api_resources'}" \ 1183 | "3: :{_alternative ':get_resources:__hook_autoscale_cmd'}" && ret=0 1184 | ;; 1185 | 1186 | certificate) 1187 | _arguments \ 1188 | ${_global_flags[@]} \ 1189 | "1: :{_alternative ':certificate_cmd:__certificate_cmd' }" && ret=0 1190 | ;; 1191 | 1192 | cluster-info) 1193 | _arguments \ 1194 | ${_global_flags[@]} \ 1195 | "1: :{_alternative ':clusterinfo_cmd:__clusterinfo_cmd' }" && ret=0 1196 | ;; 1197 | 1198 | top) 1199 | _arguments \ 1200 | ${_global_flags[@]} \ 1201 | "1: :{_alternative ':top_cmd:__top_cmd' }" && ret=0 1202 | ;; 1203 | 1204 | cordon) 1205 | _arguments \ 1206 | ${_global_flags[@]} \ 1207 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1208 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on]' \ 1209 | "1: :{_alternative ':cordon_node:__kube_get_nodes' }" && ret=0 1210 | ;; 1211 | 1212 | uncordon) 1213 | _arguments \ 1214 | ${_global_flags[@]} \ 1215 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1216 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on]' \ 1217 | "1: :{_alternative ':uncordon_node:__kube_get_nodes' }" && ret=0 1218 | ;; 1219 | 1220 | drain) 1221 | _arguments \ 1222 | ${_global_flags[@]} \ 1223 | '--delete-local-data[Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).]' \ 1224 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1225 | '--force[Continue even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet.]' \ 1226 | '--grace-period[Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.]' \ 1227 | '--ignore-daemonsets[Ignore DaemonSet-managed pods.]' \ 1228 | '--pod-selector[Label selector to filter pods on the node]' \ 1229 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1230 | '--timeout[The length of time to wait before giving up, zero means infinite]' \ 1231 | "1: :{_alternative ':drain_node:__kube_get_nodes' }" && ret=0 1232 | ;; 1233 | 1234 | taint) 1235 | _arguments \ 1236 | ${_global_flags[@]} \ 1237 | '--all[Select all nodes in the cluster]' \ 1238 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1239 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1240 | '--overwrite[If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.]' \ 1241 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1242 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1243 | '--validate[If true, use a schema to validate the input before sending it]' \ 1244 | "1: :{_alternative ':taint_node:__kube_get_nodes' }" && ret=0 1245 | ;; 1246 | 1247 | describe) 1248 | _arguments \ 1249 | ${_global_flags[@]} \ 1250 | '--all-namespaces[If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.]' \ 1251 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files containing the resource to describe]:files:_files' \ 1252 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., "--all". Objects with empty metadata.initializers are regarded as initialized.]' \ 1253 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1254 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1255 | '--show-events[If true, display events related to the described object.]' \ 1256 | "1: :{_alternative ':get_resources:__kube_get_api_resources describe' }" \ 1257 | "2: :{_alternative ':get_resources:__hook_api_resources'}" && ret=0 1258 | ;; 1259 | 1260 | logs) 1261 | _arguments \ 1262 | ${_global_flags[@]} \ 1263 | '--all-containers[Get all containers'\''s logs in the pod(s).]' \ 1264 | '(-c --container)'{-c,--container}'[Print the logs of this container]' \ 1265 | '(-f --follow)'{-f,--follow}'[Specify if the logs should be streamed.]' \ 1266 | '--limit-bytes[Maximum bytes of logs to return. Defaults to no limit.]' \ 1267 | '--pod-running-timeout[The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running]' \ 1268 | '(-p --previous)'{-p,--previous}'[If true, print the logs for the previous instance of the container in a pod if it exists.]' \ 1269 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1270 | '--since[Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used.]' \ 1271 | '--since-time[Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used.]' \ 1272 | '--tail[Lines of recent log file to display. Defaults to -1 with no selector, showing all log lines otherwise 10, if a selector is provided.]' \ 1273 | '--timestamps[Include timestamps on each line in the log output]' \ 1274 | "1: :{_alternative ':get_resources:__kube_get_api_resources2name logs' }" && ret=0 1275 | ;; 1276 | 1277 | attach) 1278 | _arguments \ 1279 | ${_global_flags[@]} \ 1280 | '(-c --container)'{-c,--container}'[Container name. If omitted, the first container in the pod will be chosen]' \ 1281 | '--pod-running-timeout[The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running]' \ 1282 | '(-i --stdin)'{-i,--stdin}'[Pass stdin to the container]' \ 1283 | '(-t --tty)'{-t,--tty}'[Stdin is a TTY]' \ 1284 | "1: :{_alternative ':log_pods:__kube_get_pods' }" && ret=0 1285 | ;; 1286 | 1287 | exec) 1288 | _arguments \ 1289 | ${_global_flags[@]} \ 1290 | '(-c --container)'{-c,--container}'[Container name. If omitted, the first container in the pod will be chosen]' \ 1291 | '(-i --stdin)'{-i,--stdin}'[Pass stdin to the container]' \ 1292 | '(-t --tty)'{-t,--tty}'[Stdin is a TTY]' \ 1293 | "1: :{_alternative ':log_pods:__kube_get_pods' }" && ret=0 1294 | ;; 1295 | 1296 | port-forward) 1297 | _arguments \ 1298 | ${_global_flags[@]} \ 1299 | '--pod-running-timeout[The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running]' \ 1300 | "1: :{_alternative ':get_resources:__kube_get_api_resources2name port-forward' }" && ret=0 1301 | ;; 1302 | 1303 | proxy) 1304 | _arguments \ 1305 | ${_global_flags[@]} \ 1306 | '--address[Addresses to listen on (comma separated)]' \ 1307 | '--api-prefix[The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running.]' && ret=0 1308 | ;; 1309 | 1310 | cp) 1311 | _arguments \ 1312 | ${_global_flags[@]} \ 1313 | '(-c --container)'{-c,--container}'[Container name. If omitted, the first container in the pod will be chosen]' \ 1314 | '--no-preserve[The copied file/directory'\''s ownership and permissions will not be preserved in the container]' && ret=0 1315 | ;; 1316 | 1317 | auth) 1318 | _arguments \ 1319 | ${_global_flags[@]} \ 1320 | "1: :{_alternative ':auth_cmd:__auth_cmd' }" && ret=0 1321 | ;; 1322 | 1323 | apply) 1324 | _values 'kubectl apply -f FILENAME [options]' \ 1325 | ${_global_flags[@]} \ 1326 | '--all[Select all resources in the namespace of the specified resource types.]' \ 1327 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1328 | '--cascade[If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.]' \ 1329 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1330 | '(-f --filename)'{-f,--filename}'[that contains the configuration to apply]:files:_files' \ 1331 | '--force[Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.]' \ 1332 | '--grace-period[Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).]' \ 1333 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., \"--all\". Objects with empty metadata.initializers are regarded as initialized.]' \ 1334 | '--openapi-patch[If true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types.]' \ 1335 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1336 | '--overwrite[Automatically resolve conflicts between the modified and live configuration by using values from the modified configuration]' \ 1337 | '--prune[Automatically delete resource objects, including the uninitialized ones, that do not appear in the configs and are created by either apply or create --save-config. Should be used with either -l or --all.]' \ 1338 | '--prune-whitelist[Overwrite the default whitelist with for --prune]' \ 1339 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1340 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1341 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1342 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1343 | '--timeout[The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object]' \ 1344 | '--validate[If true, use a schema to validate the input before sending it]' \ 1345 | '--wait[If true, wait for resources to be gone before returning. This waits for finalizers.]' \ 1346 | 'edit-last-applied[Edit latest last-applied-configuration annotations of a resource/object]' \ 1347 | 'set-last-applied[Set the last-applied-configuration annotation on a live object to match the contents of a file.]' \ 1348 | 'view-last-applied[View latest last-applied-configuration annotations of a resource/object]' && ret=0 1349 | ;; 1350 | 1351 | patch) 1352 | _arguments \ 1353 | ${_global_flags[@]} \ 1354 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1355 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1356 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to update]:files:_files' \ 1357 | '--local[If true, patch will operate on the content of the file, not the server-side resource.]' \ 1358 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1359 | '(-p --patch)'{-p,--patch}'[The patch to be applied to the resource JSON file.]' \ 1360 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1361 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1362 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1363 | '--type[The type of patch being provided; one of \[json merge strategic\]]' \ 1364 | "1: :{_alternative ':get_resources:__kube_get_api_resources patch' }" && ret=0 1365 | ;; 1366 | replace) 1367 | _arguments \ 1368 | ${_global_flags[@]} \ 1369 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1370 | '--cascade[If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.]' \ 1371 | '(-f --filename)'{-f,--filename}'[to use to replace the resource.]' \ 1372 | '--force[If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.]' \ 1373 | '--grace-period[Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).]' \ 1374 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1375 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1376 | '--save-config[If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.]' \ 1377 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1378 | '--timeout[The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object]' \ 1379 | '--validate[If true, use a schema to validate the input before sending it]' \ 1380 | '--wait[If true, wait for resources to be gone before returning. This waits for finalizers.]' && ret=0 1381 | ;; 1382 | wait) 1383 | _arguments \ 1384 | ${_global_flags[@]} \ 1385 | '--all-namespaces[If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.]' \ 1386 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1387 | '(-f --filename)'{-f,--filename}'[to use to replace the resource.]' \ 1388 | '--for[The condition to wait on: \[delete\|condition=condition-name\].]' \ 1389 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1390 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1391 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1392 | '--template[Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1393 | '--timeout[The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object]' && ret=0 1394 | "1: :{_alternative ':get_resources:__kube_get_api_resources2name wait' }" && ret=0 1395 | ;; 1396 | convert) 1397 | _arguments \ 1398 | ${_global_flags[@]} \ 1399 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1400 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files to need to get converted.]' \ 1401 | '--local[If true, convert will NOT try to contact api-server but run locally.]' \ 1402 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1403 | '--output-version[Output the formatted object with the given group version (for ex:'\''extensions/v1beta1'\'').)]' \ 1404 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1405 | '--template[Template string or path to template file to use when -o=go-template,-o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1406 | '--validate[If true, use a schema to validate the input before sending it]' && ret=0 1407 | ;; 1408 | label) 1409 | _arguments \ 1410 | ${_global_flags[@]} \ 1411 | '--all[Select all resources, including uninitialized ones, in the namespace of the specified resource types]' \ 1412 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1413 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1414 | '--field-selector[Selector (field query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1415 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to update the labels]' \ 1416 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., \"\-\-all\". Objects with empty metadata.initializers are regarded as initialized.]' \ 1417 | '--list[If true, display the labels for a given resource.]' \ 1418 | '--local[If true, label will NOT contact api-server but run locally.]' \ 1419 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1420 | '--overwrite[If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.]' \ 1421 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1422 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1423 | '--resource-version[If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.]' \ 1424 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1425 | '--template[Template string or path to template file to use when -o=go-template,-o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1426 | "1: :{_alternative ':get_resources:__kube_get_api_resources label' }" \ 1427 | "2: :{_alternative ':get_resources:__hook_api_resources'}" && ret=0 1428 | ;; 1429 | annotate) 1430 | _arguments \ 1431 | ${_global_flags[@]} \ 1432 | '--all[Select all resources, including uninitialized ones, in the namespace of the specified resource types]' \ 1433 | '--allow-missing-template-keys[If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.]' \ 1434 | '--dry-run[If true, only print the object that would be sent, without sending it.]' \ 1435 | '--field-selector[Selector (field query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1436 | '(-f --filename)'{-f,--filename}'[Filename, directory, or URL to files identifying the resource to update the labels]' \ 1437 | '--include-uninitialized[If true, the kubectl command applies to uninitialized objects. If explicitly set to false, this flag overrides other flags that make the kubectl commands apply to uninitialized objects, e.g., \"\-\-all\". Objects with empty metadata.initializers are regarded as initialized.]' \ 1438 | '--list[If true, display the labels for a given resource.]' \ 1439 | '--local[If true, label will NOT contact api-server but run locally.]' \ 1440 | '(-o --output)'{-o,--output}'[Output format. One of:json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.]:output_flag:__output_flag' \ 1441 | '--overwrite[If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.]' \ 1442 | '--record[Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.]' \ 1443 | '(-R --recursive)'{-R,--recursive}'[Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.]' \ 1444 | '--resource-version[If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.]' \ 1445 | '(-l --selector)'{-l,--selector}'[Selector (label query) to filter on, supports '\''='\'', '\''=='\'', and '\''!='\''.(e.g. -l key1=value1,key2=value2)]' \ 1446 | '--template[Template string or path to template file to use when -o=go-template,-o=go-template-file. The template format is golang templates \[http://golang.org/pkg/text/template/#pkg-overview\].]' \ 1447 | "1: :{_alternative ':get_resources:__kube_get_api_resources annotate' }" \ 1448 | "2: :{_alternative ':get_resources:__hook_api_resources'}" && ret=0 1449 | ;; 1450 | completion) 1451 | _arguments \ 1452 | ${_global_flags[@]} \ 1453 | "1: :{_alternative ':completion_cmd:__completion_cmd' }" && ret=0 1454 | ;; 1455 | # No alpha commands are available in this version of kubectl 1456 | # alpha) 1457 | # _arguments \ 1458 | # ${_global_flags[@]} \ 1459 | # "1: :{_alternative ':alpha_cmd:__alpha_cmd' }" && ret=0 1460 | #;; 1461 | api-resources) 1462 | _arguments \ 1463 | ${_global_flags[@]} \ 1464 | '--api-group[Limit to resources in the specified API group.]' \ 1465 | '--cached[Use the cached list of resources if available.]' \ 1466 | '--namespaced[If false, non-namespaced resources will be returned, otherwise returning namespaced resources by default]' \ 1467 | '--no-headers[When using the default or custom-column output format, don'\''t print headers(default print headers).]' \ 1468 | '(-o --output)'{-o,--output}'[Output format. One of: wide|name.]:output_flag:__output_flag' \ 1469 | '--verbs[Limit to resources that support the specified verbs.]' && ret=0 1470 | ;; 1471 | api-versions) 1472 | _arguments \ 1473 | ${_global_flags[@]} && ret=0 1474 | ;; 1475 | config) 1476 | _arguments \ 1477 | ${_global_flags[@]} \ 1478 | "1: :{_alternative ':config_cmd:__config_cmd' }" && ret=0 1479 | ;; 1480 | plugin) 1481 | _arguments \ 1482 | ${_global_flags[@]} \ 1483 | "1: :{_alternative ':plugin_cmd:__plugin_cmd' }" && ret=0 1484 | ;; 1485 | version) 1486 | _arguments \ 1487 | ${_global_flags[@]} \ 1488 | '--client[Client version only (no server required).]' \ 1489 | '(-o --output)'{-o,--output}'[One of '\''yaml'\'' or '\''json'\'']:output_flag:__output_flag' \ 1490 | '--short[Print just the version number.]' && ret=0 1491 | ;; 1492 | esac 1493 | ;; 1494 | esac 1495 | 1496 | return ret 1497 | } 1498 | --------------------------------------------------------------------------------