Skip to content

Commit 08787bc

Browse files
jlebondustymabe
authored andcommitted
kola/tests/upgrade: tweak for OCI payloads
First, I'm not sure why `:latest` was appended to the filename of OCI archives. I think that's just a historical artifact. But nowadays, at least with the new non-encapsulated OCI archives, this causes an error with skopeo during rebasing: error: Preparing import: Fetching manifest: failed to invoke method OpenImage: no descriptor found for reference "latest" So drop that. Also, don't rely on `ostree-commit` from `meta.json` yet when synthesizing another commit to upgrade to, since it's not reproducible yet. This is fixed in latest bootc, but it still needs to propagate. (There's a larger picture issue here which is that this test is becoming less and less realistic as we keep going. We shouldn't be liberally doing rpm-ostree rebases like this, but instead try to leverage Zincati more. Also the synthetic update should be fetched as another container image in a registry, possibly hosted locally, rather than an OSTree commit.)
1 parent e8e4ff9 commit 08787bc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mantle/kola/tests/upgrade/basic.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func fcosUpgradeBasic(c cluster.TestCluster) {
148148
c.Fatal(err)
149149
}
150150
usingContainer := booted.ContainerImageReference != ""
151-
sourceContainerRef := fmt.Sprintf("ostree-unverified-image:oci-archive:%s:latest", containerImageFilename)
151+
sourceContainerRef := fmt.Sprintf("ostree-unverified-image:oci-archive:%s", containerImageFilename)
152152

153153
c.Run("setup", func(c cluster.TestCluster) {
154154
ostreeref := kola.CosaBuild.Meta.BuildRef
@@ -162,13 +162,12 @@ func fcosUpgradeBasic(c cluster.TestCluster) {
162162
}
163163

164164
// Keep any changes around here in sync with tests/rhcos/upgrade.go too!
165-
166165
// See https://github.com/coreos/fedora-coreos-tracker/issues/812
167166
if usingContainer {
168167
// In the container path we'll pass this file directly, so put it outside
169168
// of the user's home directory so the systemd service can find it.
170169
c.RunCmdSyncf(m, "sudo mv %s /var/tmp/%s", containerImageFilename, containerImageFilename)
171-
sourceContainerRef = fmt.Sprintf("ostree-unverified-image:oci-archive:/var/tmp/%s:latest", containerImageFilename)
170+
sourceContainerRef = fmt.Sprintf("ostree-unverified-image:oci-archive:/var/tmp/%s", containerImageFilename)
172171
} else {
173172
tmprepo := workdir + "/repo-bare"
174173
// TODO: https://github.com/ostreedev/ostree-rs-ext/issues/34
@@ -210,11 +209,13 @@ func fcosUpgradeBasic(c cluster.TestCluster) {
210209

211210
c.Run("upgrade-from-current", func(c cluster.TestCluster) {
212211
newVersion := kola.CosaBuild.Meta.OstreeVersion + ".kola"
213-
ostreeCommit := kola.CosaBuild.Meta.OstreeCommit
214212
if usingContainer {
213+
// until https://github.com/bootc-dev/bootc/pull/1421 propagates, we can't rely on kola.CosaBuild.Meta.OstreeCommit being the same
214+
ostreeCommit := c.MustSSHf(m, "sudo rpm-ostree status --json | jq -r '.deployments[0].checksum'")
215215
newCommit := c.MustSSHf(m, "sudo ostree commit -b testupdate --tree=ref=%s --add-metadata-string version=%s", ostreeCommit, newVersion)
216216
rpmostreeRebase(c, m, string(newCommit), newVersion)
217217
} else {
218+
ostreeCommit := kola.CosaBuild.Meta.OstreeCommit
218219
ostree_command := "ostree commit --repo %s -b %s --tree ref=%s --add-metadata-string version=%s " +
219220
"--keep-metadata='fedora-coreos.stream' --keep-metadata='coreos-assembler.basearch' --parent=%s"
220221
newCommit := c.MustSSHf(m,

0 commit comments

Comments
 (0)