Skip to content

Commit

Permalink
revert fetchitconfig to using plain arrays instead of pointers to arr…
Browse files Browse the repository at this point in the history
…ays (#193)

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
  • Loading branch information
Joseph Sawaya committed Jun 13, 2022
1 parent de0f5e0 commit 3146a84
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions pkg/engine/fetchit.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,41 +229,41 @@ func getMethodTargetScheds(targetConfigs []*TargetConfig, fetchit *Fetchit) *Fet

}

if tc.Ansible != nil {
if len(tc.Ansible) > 0 {
fetchit.allMethodTypes[ansibleMethod] = struct{}{}
for _, a := range *tc.Ansible {
for _, a := range tc.Ansible {
a.initialRun = true
a.target = gitTarget
fetchit.methodTargetScheds[a] = a.SchedInfo()
}
}
if tc.FileTransfer != nil {
if len(tc.FileTransfer) > 0 {
fetchit.allMethodTypes[filetransferMethod] = struct{}{}
for _, ft := range *tc.FileTransfer {
for _, ft := range tc.FileTransfer {
ft.initialRun = true
ft.target = gitTarget
fetchit.methodTargetScheds[ft] = ft.SchedInfo()
}
}
if tc.Kube != nil {
if len(tc.Kube) > 0 {
fetchit.allMethodTypes[kubeMethod] = struct{}{}
for _, k := range *tc.Kube {
for _, k := range tc.Kube {
k.initialRun = true
k.target = gitTarget
fetchit.methodTargetScheds[k] = k.SchedInfo()
}
}
if tc.Raw != nil {
if len(tc.Raw) > 0 {
fetchit.allMethodTypes[rawMethod] = struct{}{}
for _, r := range *tc.Raw {
for _, r := range tc.Raw {
r.initialRun = true
r.target = gitTarget
fetchit.methodTargetScheds[r] = r.SchedInfo()
}
}
if tc.Systemd != nil {
if len(tc.Systemd) > 0 {
fetchit.allMethodTypes[rawMethod] = struct{}{}
for _, sd := range *tc.Systemd {
for _, sd := range tc.Systemd {
sd.initialRun = true
sd.target = gitTarget
fetchit.methodTargetScheds[sd] = sd.SchedInfo()
Expand Down
18 changes: 9 additions & 9 deletions pkg/engine/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ type FetchitConfig struct {
}

type TargetConfig struct {
Name string `mapstructure:"name"`
Url string `mapstructure:"url"`
Branch string `mapstructure:"branch"`
Clean *Clean `mapstructure:"clean"`
Ansible *[]*Ansible `mapstructure:"ansible"`
FileTransfer *[]*FileTransfer `mapstructure:"filetransfer"`
Kube *[]*Kube `mapstructure:"kube"`
Raw *[]*Raw `mapstructure:"raw"`
Systemd *[]*Systemd `mapstructure:"systemd"`
Name string `mapstructure:"name"`
Url string `mapstructure:"url"`
Branch string `mapstructure:"branch"`
Clean *Clean `mapstructure:"clean"`
Ansible []*Ansible `mapstructure:"ansible"`
FileTransfer []*FileTransfer `mapstructure:"filetransfer"`
Kube []*Kube `mapstructure:"kube"`
Raw []*Raw `mapstructure:"raw"`
Systemd []*Systemd `mapstructure:"systemd"`
configReload *ConfigReload
mu sync.Mutex
}
Expand Down

0 comments on commit 3146a84

Please sign in to comment.