From c6a067cb07c82f20a4e4d44b8f0a34b6deb6e9c9 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 6 Feb 2023 14:41:50 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20=20Simplify=20=20files=20specifi?= =?UTF-8?q?cation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/extras/SopsGenerator.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/extras/SopsGenerator.go b/pkg/extras/SopsGenerator.go index 16587ba..66da0a3 100644 --- a/pkg/extras/SopsGenerator.go +++ b/pkg/extras/SopsGenerator.go @@ -26,11 +26,7 @@ const ( type SopsGeneratorPlugin struct { yaml.ResourceMeta - Spec struct { - // Replicas is the number of Deployment replicas - // Defaults to the REPLICAS env var, or 1 - Files []string `yaml:"files,omitempty"` - } `yaml:"spec,omitempty"` + Files []string `yaml:"files,omitempty"` Sops map[string]interface{} `json:"sops,omitempty" yaml:"spec,omitempty"` @@ -86,7 +82,7 @@ func (p *SopsGeneratorPlugin) Config(h *resmap.PluginHelpers, c []byte) (err err if p.Sops != nil { p.buffer = c } else { - if p.Spec.Files == nil { + if p.Files == nil { err = fmt.Errorf("generator configuration doesn't contain any file") return } @@ -127,7 +123,7 @@ func (p *SopsGeneratorPlugin) Generate() (resmap.ResMap, error) { } } else { - for _, file := range p.Spec.Files { + for _, file := range p.Files { b, err := p.h.Loader().Load(file) if err != nil {