Skip to content

Commit

Permalink
🩹 Simplify files specification
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemartin committed Feb 6, 2023
1 parent 96b5b3c commit c6a067c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/extras/SopsGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c6a067c

Please sign in to comment.