diff --git a/pkg/engine/fetchit.go b/pkg/engine/fetchit.go index 1ba056c8..b278cf97 100644 --- a/pkg/engine/fetchit.go +++ b/pkg/engine/fetchit.go @@ -202,40 +202,7 @@ func (hc *FetchitConfig) InitConfig(initial bool) { cobra.CheckErr(err) } - beforeTargets := len(hc.Targets) hc.Targets = config.Targets - if beforeTargets > 0 { - // replace lastCommit - to avoid re-running same jobs, since the scheduler finished all jobs - // with the last commit before arriving here - for i, t := range hc.Targets { - if t.Methods.Raw != nil { - if config.Targets[i].Methods.Raw != nil { - t.Methods.Raw.lastCommit = config.Targets[i].Methods.Raw.lastCommit - } - } - if t.Methods.Kube != nil { - if config.Targets[i].Methods.Kube != nil { - t.Methods.Kube.lastCommit = config.Targets[i].Methods.Kube.lastCommit - } - } - if t.Methods.Ansible != nil { - if config.Targets[i].Methods.Ansible != nil { - t.Methods.Ansible.lastCommit = config.Targets[i].Methods.Ansible.lastCommit - } - } - if t.Methods.FileTransfer != nil { - if config.Targets[i].Methods.FileTransfer != nil { - t.Methods.FileTransfer.lastCommit = config.Targets[i].Methods.FileTransfer.lastCommit - } - } - if t.Methods.Systemd != nil { - if config.Targets[i].Methods.Systemd != nil { - t.Methods.Systemd.lastCommit = config.Targets[i].Methods.Systemd.lastCommit - } - } - } - } - // look for a ConfigFileTarget, only find the first // TODO: add logic to merge multiple configs for _, t := range hc.Targets { diff --git a/pkg/engine/types.go b/pkg/engine/types.go index c981276a..dc257909 100644 --- a/pkg/engine/types.go +++ b/pkg/engine/types.go @@ -2,8 +2,6 @@ package engine import ( "sync" - - "github.com/go-git/go-git/v5/plumbing/object" ) type Target struct { @@ -63,8 +61,6 @@ type RawTarget struct { PullImage bool `mapstructure:"pullImage"` // initialRun is set by fetchit initialRun bool - // lastCommit is set by fetchit - lastCommit *object.Commit } // SystemdTarget to place and/or enable systemd unit files on host @@ -99,8 +95,6 @@ type SystemdTarget struct { Skew *int `mapstructure:"skew"` // initialRun is set by fetchit initialRun bool - // lastCommit is set by fetchit - lastCommit *object.Commit } // FileTransferTarget to place files on host system @@ -116,8 +110,6 @@ type FileTransferTarget struct { Skew *int `mapstructure:"skew"` // initialRun is set by fetchit initialRun bool - // lastCommit is set by fetchit - lastCommit *object.Commit } // KubeTarget to launch pods using podman kube-play @@ -131,8 +123,6 @@ type KubeTarget struct { Skew *int `mapstructure:"skew"` // initialRun is set by fetchit initialRun bool - // lastCommit is set by fetchit - lastCommit *object.Commit } // AnsibleTarget to place and run ansible playbooks @@ -148,8 +138,6 @@ type AnsibleTarget struct { SshDirectory string `mapstructure:"sshDirectory"` // initialRun is set by fetchit initialRun bool - // lastCommit is set by fetchit - lastCommit *object.Commit } // Clean configures targets to run a system prune periodically