name: "great-plugin" # REQUIRED: the plug-in command name, to be invoked under 'kubectl'
shortDesc: "great-plugin plug-in" # REQUIRED: the command short description, for help
longDesc: "" # the command long description, for help
example: "" # command example(s), for help
command: "./example" # REQUIRED: the command, binary, or script to invoke when running the plug-in
flags: # flags supported by the plug-in
- name: "flag-name" # REQUIRED for each flag: flag name
shorthand: "f" # short version of the flag name
desc: "example flag" # REQUIRED for each flag: flag description
defValue: "extreme" # default value of the flag
tree: # allows the declaration of subcommands
- ... # subcommands support the same set of attributes
name: "great-plugin" # REQUIRED: the plug-in command name, to be invoked under 'kubectl'
shortDesc: "great-plugin plug-in" # REQUIRED: the command short description, for help
longDesc: "" # the command long description, for help
example: "" # command example(s), for help
command: "./example" # REQUIRED: the command, binary, or script to invoke when running the plug-in
flags: # flags supported by the plug-in
- name: "flag-name" # REQUIRED for each flag: flag name
shorthand: "f" # short version of the flag name
desc: "example flag" # REQUIRED for each flag: flag description
defValue: "extreme" # default value of the flag
tree: # allows the declaration of subcommands
- ... # subcommands support the same set of attributes
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Copy to ClipboardCopied!Toggle word wrapToggle overflow
プラグインが呼び出されると、記述子ファイルと同じディレクトリーにある example バイナリーまたはスクリプトが呼び出され、多くの引数および環境変数が渡されます。ランタイム属性へのアクセス のセクションでは、example コマンドがフラグ値およびその他のランタイムコンテキストにアクセスする方法について説明しています。