snippets: add fluxcd snippet
This commit is contained in:
@@ -4,6 +4,7 @@ local s = ls.snippet
|
|||||||
local i = ls.insert_node
|
local i = ls.insert_node
|
||||||
local f = ls.function_node
|
local f = ls.function_node
|
||||||
local fmt = require("luasnip.extras.fmt").fmt
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local vscode_loader = require("luasnip.loaders.from_vscode")
|
||||||
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-l>", function()
|
vim.keymap.set({ "i", "s" }, "<C-l>", function()
|
||||||
if ls.expand_or_jumpable() then
|
if ls.expand_or_jumpable() then
|
||||||
@@ -126,3 +127,32 @@ local yaml_schema_snippet = s(
|
|||||||
ls.add_snippets('yaml', { yaml_schema_snippet })
|
ls.add_snippets('yaml', { yaml_schema_snippet })
|
||||||
ls.add_snippets('helm', { yaml_schema_snippet })
|
ls.add_snippets('helm', { yaml_schema_snippet })
|
||||||
|
|
||||||
|
|
||||||
|
local flux_cd_kustomization = s(
|
||||||
|
{ name = 'fluxcd_kustomization', trig = 'fluxkust' },
|
||||||
|
fmt([[
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: {name}
|
||||||
|
namespace: {namespace}
|
||||||
|
spec:
|
||||||
|
interval: {interval}
|
||||||
|
path: {path}
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: {repository_name}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
name = i(1, 'name'),
|
||||||
|
namespace = i(2, 'flux-system'),
|
||||||
|
interval = i(3, '5m'),
|
||||||
|
path = i(4, 'path'),
|
||||||
|
repository_name = i(5, 'repository_name'),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
ls.add_snippets('yaml', { flux_cd_kustomization })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user