Debian Codegraph @

api/internal/builtins/IAMPolicyGenerator.go

raw
1 // Code generated by pluginator on IAMPolicyGenerator; DO NOT EDIT.
2 package builtins
3
4 import (
5 "sigs.k8s.io/kustomize/api/filters/iampolicygenerator"
6 "sigs.k8s.io/kustomize/api/resmap"
7 "sigs.k8s.io/kustomize/api/types"
8 "sigs.k8s.io/yaml"
9 )
10
11 type IAMPolicyGeneratorPlugin struct {
12 types.IAMPolicyGeneratorArgs
13 }
14
15 func (p *IAMPolicyGeneratorPlugin) Config(h *resmap.PluginHelpers, config []byte) (err error) {
16 p.IAMPolicyGeneratorArgs = types.IAMPolicyGeneratorArgs{}
17 err = yaml.Unmarshal(config, p)
18 return
19 }
20
21 func (p *IAMPolicyGeneratorPlugin) Generate() (resmap.ResMap, error) {
22 r := resmap.New()
23 err := r.ApplyFilter(iampolicygenerator.Filter{
24 IAMPolicyGenerator: p.IAMPolicyGeneratorArgs,
25 })
26 return r, err
27 }
28
29 func NewIAMPolicyGeneratorPlugin() resmap.GeneratorPlugin {
30 return &IAMPolicyGeneratorPlugin{}
31 }