func (r *reconcile) Relink() error { hostnameTargetMapping, err := r.disjoinTargets() if err != nil { return err } var updatedHostnames []string for name, tgt := range hostnameTargetMapping { c, err := FindBestCertificateSatisfying(r.store, tgt) if err != nil { log.Debugf("could not find certificate satisfying %v: %v", tgt, err) continue } log.Tracef("relink: best certificate satisfying %v is %v", tgt, c) cprev, err := r.store.PreferredCertificateForHostname(name) if c != cprev || err != nil { log.Debugf("relinking: %v -> %v (was %v)", name, c, cprev) updatedHostnames = append(updatedHostnames, name) err = r.store.SetPreferredCertificateForHostname(name, c) log.Errore(err, "failed to set preferred certificate for hostname") } } err = hooks.NotifyLiveUpdated("", r.store.Path(), updatedHostnames) // ignore error log.Errore(err, "failed to call notify hooks") return nil }
func cmdRunTestNotify() { ctx := &hooks.Context{ HooksDir: *hooksFlag, StateDir: *stateFlag, } err := hooks.NotifyLiveUpdated(ctx, *testNotifyArg) log.Errore(err, "notify") }
func cmdRunTestNotify() { err := hooks.NotifyLiveUpdated(*hooksFlag, *stateFlag, *testNotifyArg) log.Errore(err, "notify") }