diff --git a/tools/zos-update-worker/internal/update_worker.go b/tools/zos-update-worker/internal/update_worker.go index f0c546d18..41175abc8 100644 --- a/tools/zos-update-worker/internal/update_worker.go +++ b/tools/zos-update-worker/internal/update_worker.go @@ -112,6 +112,7 @@ func (w *Worker) updateZosVersion(network Network, manager client.Manager) error type ChainVersion struct { SafeToUpgrade bool `json:"safe_to_upgrade"` Version string `json:"version"` + VersionLight string `json:"version_light"` } var chainVersion ChainVersion @@ -133,13 +134,18 @@ func (w *Worker) updateZosVersion(network Network, manager client.Manager) error zosCurrent := fmt.Sprintf("%v/.tag-%v", w.src, chainVersion.Version) zosLatest := fmt.Sprintf("%v/%v", w.dst, network) // zos light - zosLightCurrent := fmt.Sprintf("%v/.tag-%v", w.src, chainVersion.Version) - zosLightLatest := fmt.Sprintf("%v/%v-v4", w.dst, network) + var zosLightCurrent string + var zosLightLatest string + // to handle the environments that aren't updated yet (mainnet) + if chainVersion.VersionLight != "" { + zosLightCurrent = fmt.Sprintf("%v/.tag-%v", w.src, chainVersion.VersionLight) + zosLightLatest = fmt.Sprintf("%v/%v-v4", w.dst, network) + } // the link is like zosCurrent but it has the path relative from the symlink // point of view (so relative to the symlink, how to reach zosCurrent) // hence the link is instead used in all calls to symlink zosLink := fmt.Sprintf("%v/.tag-%v", path, chainVersion.Version) - zosLightLink := fmt.Sprintf("%v/.tag-%v", path, chainVersion.Version) + zosLightLink := fmt.Sprintf("%v/.tag-%v", path, chainVersion.VersionLight) // update links for both zos and zoslight if err = w.updateLink(zosCurrent, zosLatest, zosLink); err != nil {