diff --git a/examples/example-spec.yaml b/examples/example-spec.yaml index d4590476..14757ed1 100644 --- a/examples/example-spec.yaml +++ b/examples/example-spec.yaml @@ -1,6 +1,5 @@ --- stateFiles: - path: examples/example.yaml - priority: -10 - path: examples/minimal-example.yaml - path: examples/minimal-example.toml diff --git a/internal/app/cli.go b/internal/app/cli.go index 7034b52e..99a3f09c 100644 --- a/internal/app/cli.go +++ b/internal/app/cli.go @@ -264,7 +264,6 @@ func (c *cli) readState(s *state) error { for _, val := range sp.StateFiles { fo := fileOption{} fo.name = val.Path - fo.priority = val.Priority if err := isValidFile(fo.name, validManifestFiles); err != nil { return fmt.Errorf("invalid -spec file: %w", err) } @@ -281,10 +280,6 @@ func (c *cli) readState(s *state) error { return err } - if f.priority != 0 { - fileState.patchPriority(f.priority) - } - log.Infof("Parsed [[ %s ]] successfully and found [ %d ] apps", f.name, len(fileState.Apps)) // Merge Apps that already existed in the state for appName, app := range fileState.Apps { diff --git a/internal/app/spec_state.go b/internal/app/spec_state.go index d7dee36a..3a7b5144 100644 --- a/internal/app/spec_state.go +++ b/internal/app/spec_state.go @@ -6,13 +6,12 @@ import ( "gopkg.in/yaml.v2" ) -type SpecConfig struct { - Path string `yaml:"path"` - Priority int `yaml:"priority"` +type StatePath struct { + Path string `yaml:"path"` } type StateFiles struct { - StateFiles []SpecConfig `yaml:"stateFiles"` + StateFiles []StatePath `yaml:"stateFiles"` } // fromYAML reads a yaml file and decodes it to a state type. @@ -32,12 +31,3 @@ func (pc *StateFiles) specFromYAML(file string) error { return nil } - -func (s *state) patchPriority(priority int) error { - for app, _ := range s.Apps { - if s.Apps[app].Priority > priority { - s.Apps[app].Priority = priority - } - } - return nil -} diff --git a/internal/app/spec_state_test.go b/internal/app/spec_state_test.go index e3b5f66c..dc209414 100644 --- a/internal/app/spec_state_test.go +++ b/internal/app/spec_state_test.go @@ -51,7 +51,7 @@ func Test_specFromYAML(t *testing.T) { func Test_specFileSort(t *testing.T) { type args struct { - files fileOptionArray + files fileOptionArray } tests := []struct { name string @@ -88,4 +88,3 @@ func Test_specFileSort(t *testing.T) { }) } } -