Skip to content

Commit

Permalink
chore(build): auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 4, 2024
1 parent 0dcf702 commit ed87791
Showing 1 changed file with 97 additions and 65 deletions.
162 changes: 97 additions & 65 deletions doc/kustomize.nvim.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*kustomize.nvim.txt* For Neovim >= 0.9.0 Last change: 2024 September 08
*kustomize.nvim.txt* For Neovim >= 0.9.0 Last change: 2024 October 04

==============================================================================
Table of Contents *kustomize.nvim-table-of-contents*

- Requirements |kustomize.nvim-requirements|
- Quickstart |kustomize.nvim-quickstart|
- Default mappings |kustomize.nvim-default-mappings|
- Default configuration |kustomize.nvim-default-configuration|
- Defaultconfiguration |kustomize.nvim-defaultconfiguration|
- Use cases |kustomize.nvim-use-cases|
kustomize.nvim

Expand All @@ -23,7 +23,7 @@ REQUIREMENTS *kustomize.nvim-requirements*
- kubent <https://github.com/doitintl/kube-no-trouble> in your PATH to |kustomize.nvim-check-for-deprecations|
- plenary.nvim <https://github.com/nvim-lua/plenary.nvim>
- nvim-treesitter <https://github.com/nvim-treesitter/nvim-treesitter> and `yaml` parser
- (optionally) LuaSnip <https://github.com/L3MON4D3/LuaSnip> snippets (default is disabled)
- (optionally) LuaSnip <https://github.com/L3MON4D3/LuaSnip> for snippets support (default is disabled)


QUICKSTART *kustomize.nvim-quickstart*
Expand All @@ -44,27 +44,23 @@ Run`:checkhealth kustomize` for a health check.

DEFAULT MAPPINGS *kustomize.nvim-default-mappings*

---------------------------------------------------------------------------------------------------------
Mode Mapping Action Lua Command
------ ------------ ------------- -------------------------------------------- --------------------------
n <leader>kb Kustomize lua require("kustomize").build() :KustomizeBuild
build
--------------------------------------------------------------------------
Mode Mapping Action Command
------ ------------- ------------------------ ----------------------------
n <leader>kb Kustomize build :KustomizeBuild

n <leader>kk List kinds lua require("kustomize").kinds() :KustomizeListKinds
n <leader>kk List kinds :KustomizeListKinds

n <leader>kr Print lua require("kustomize").print_resources() :KustomizePrintResources
resources
n <leader>kp Print resources :KustomizePrintResources

n <leader>ko List lua require("kustomize").list_resources() :KustomizeListResources
‘resources’
n <leader>kl List ‘resources’ :KustomizeListResources

n <leader>kv Validate file lua require("kustomize").validate() :KustomizeValidate
n <leader>kv Validate file :KustomizeValidate

n <leader>kd Check API lua require("kustomize").deprecations() :KustomizeDeprecations
deprecation
---------------------------------------------------------------------------------------------------------
You can define your own keybindings/override the default mappings, for
instance:
n <leader>kd Check API deprecations :KustomizeDeprecations
--------------------------------------------------------------------------
You can define your own keybindings after setting `opts.enable_key_mappings =
false`

>lua
use({
Expand All @@ -74,42 +70,47 @@ instance:
opts = { enable_key_mappings = false },
config = function(opts)
require('kustomize').setup({opts})
-- default keybindings, adjust to your needs
vim.keymap.set("n", "<leader>kb", "<cmd>lua require('kustomize').build()<cr>", { noremap = true })
vim.keymap.set("n", "<leader>kk", "<cmd>lua require('kustomize').kinds()<cr>", { noremap = true })
vim.keymap.set("n", "<leader>kl", "<cmd>lua require('kustomize').list_resources()<cr>", { noremap = true })
vim.keymap.set("n", "<leader>kp", "<cmd>lua require('kustomize').print_resources()<cr>", { noremap = true })
vim.keymap.set("n", "<leader>kv", "<cmd>lua require('kustomize').validate()<cr>", { noremap = true })
vim.keymap.set("n", "<leader>kd", "<cmd>lua require('kustomize').deprecations()<cr>", { noremap = true })
-- adjust to your needs if not using the default key mappings
vim.api.nvim_set_keymap("n", "<leader>kb", "<cmd>KustomizeBuild<cr>", { desc = "Build Kustomize" })
vim.api.nvim_set_keymap("n", "<leader>kk", "<cmd>KustomizeListKinds<cr>", { desc = "List Kubernetes Kinds" })
-- ...
end,
})
<


DEFAULT CONFIGURATION *kustomize.nvim-default-configuration*
DEFAULTCONFIGURATION *kustomize.nvim-defaultconfiguration*

This is the default configuration that can be (partially) overwritten by you.
This is the default configuration that can be overwritten, also in parts, by
you.

>lua
{
enable_key_mappings = true,
enable_lua_snip = false,
validate = { kubeconform_args = { "--strict", "--ignore-missing-schemas" } },
-- TODO:
build = { additional_args = {} },
deprecations = { kube_version = "1.25" },
kinds = { show_filepath = true, show_line = true, exclude_pattern = "" },
kinds = { show_filepath = true, show_line = true, exclude_pattern = {} },
-- built-in commands
run = {
validate = {
cmd = "kubeconform",
args = { "--strict", "--ignore-missing-schemas" },
},
deprecations = {
cmd = "kubent",
args = { "-t", "1.26", "-c=false", "--helm3=false", "-l=error", "-e", "-f" },
},
},
}
<

With Lazy.nvim for instance:

>lua
opts = { validate = { kubeconform_args = { "--strict" } } },
opts = { enable_lua_snip = true },
<

And some command / Lua APIs support arguments. See
|kustomize.nvim-list-"kinds"| and |kustomize.nvim-check-for-deprecations|.


USE CASES *kustomize.nvim-use-cases*

Expand Down Expand Up @@ -139,11 +140,7 @@ You can add additional arguments to the build call via config file:
You can also dynamically overwrite the values of your config file with

>
lua require("kustomize").build({additional_args={"--enable-helm", "--load-restrictor=LoadRestrictionsNone"}})
<

>
:KustomizeBuild additional_args={"--enable-helm", "--load-restrictor=LoadRestrictionsNone"}
:KustomizeBuild --enable-helm --load-restrictor=LoadRestrictionsNone
<


Expand All @@ -158,38 +155,40 @@ resources, for instance generated by |kustomize.nvim-build-manifests|. Only
Resources with `metadata.name` are recognized, e.g. `Kustomization` resources
are not detected.

The output consists of `<the buffer name> |<the line nr>| <which kind> <name>
<namespace>`. Cluster-wide resources omit the namespace value. You can hide the
buffer name and line number by adding the following snippet to the opts table:
The output consists of `<buffer-name> |<line-nr>| <kind> <name> <namespace>`.
Cluster-wide resources omit the namespace value. You can hide the buffer name
and line number by adding the following snippet to the opts table:

If Telescope.nvim <https://github.com/nvim-telescope/telescope.nvim> is
installed, you can toggle `Telescope loclist` with `<leader>kt`
>lua
kinds = {
show_filepath = false,
show_line = false,
},
<

You can exclude certain resources from the results via:

>lua
kinds = {
-- setting those to false removes "clutter" but you cannot "jump" to a resource anymore
show_filepath = false,
show_line = false,
-- filter resources you are not interested in
exclude_pattern = {"Namespace", "Ingress"}
},
kinds = {
exclude_pattern = { "CronJob", "ServiceAccount" }
},
<

You can also dynamically overwrite the values of your config file with

>
:lua require("kustomize").kinds({show_line=true, show_filepath=true, exclude_pattern={"Namespace", "Ingress"}})
:KustomizeListKinds show_line=false show_filepath=false exclude_pattern=Namespace,Ingress
<

>
:KustomizeListKinds show_line=true, show_filepath=true, exclude_pattern={"Namespace", "Ingress"}
<
If Telescope.nvim <https://github.com/nvim-telescope/telescope.nvim> is
installed, you can toggle `Telescope loclist` with `<leader>kt` (if default
mappings are enabled).


OPEN FILE/DIRECTORY ~

ShowcaseYou list your YAMLs that should be included by Kustomize for the build of the
final manifests like so:
ShowcaseIn a kustomiation.yaml you list your YAMLs that should be included by Kustomize
for the build of the final manifests like so:

>yaml
---
Expand Down Expand Up @@ -221,26 +220,59 @@ your cluster. This command runs `kubeconform --strict --ignore-missing-schemas`
on the current buffer. The buffer’s content may be a file on disk or content
not (yet) saved, e.g. the output of |kustomize.nvim-build-manifests|.

You can overwrite the default args like so

>lua
run = {
validate = {
args = { "--strict" },
},
}
<


CHECK FOR DEPRECATIONS ~

Showcasekubent <https://github.com/doitintl/kube-no-trouble> is a tool to search for
deprecated Kubernetes APIs. This plugin utilizes the plugin to check the
manifests in the current buffer for deprecated Kubernetes APIs. The buffer’s
content may be a file on disk or content not (yet) saved, e.g. the output of
|kustomize.nvim-build-manifests|. The Kubernetes target version can be set with
`deprecations = { kube_version = "1.25" }`.
|kustomize.nvim-build-manifests|.

You can also dynamically overwrite the values of your config file with
You can overwrite the default args like so

>
:lua require("kustomize").deprecations({kube_version=1.25})
>lua
run = {
deprecations = {
args = { "-t", "1.30", "-l=error", "-e", "-f" },
}
<

>
:KustomizeDeprecations kube_version=1.16

RUN CUSTOM COMMANDS ~

You can define and run arbitrary commands on yaml files, for instance:

>lua
run = {
trivy = {
cmd = "trivy",
args = { "-q", "fs" },
},
deprecations29 = {
cmd = "kubent",
args = { "-t", "1.29", "-c=false", "--helm3=false", "-l=error", "-e", "-f" },
},
deprecations30 = {
cmd = "kubent",
args = { "-t", "1.29", "-c=false", "--helm3=false", "-l=error", "-e", "-f" },
},
},
<

Then you can run `:KustomizeRun trivy` to run the specified command.
Auto-completion is supported!

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:

0 comments on commit ed87791

Please sign in to comment.