Issue #8622
closedCentOS 8 BaseOS .treeinfo's [general] section says AppStream instead of BaseOS
Description
I synced CentOS 8 BaseOS today and noticed that the .treeinfo's [general] section wasn't right:
[checksums] images/boot.iso = sha256:2b801bc5801816d0cf27fc74552cf058951c42c7b72b1fe313429b1070c3876c images/efiboot.img = sha256:3b400994d93956d1a3c59d3c7fbefe1a73e287b2b2b0dedea7d16ef5042cb3c9 images/install.img = sha256:60115a4c57495f4ae4fa2a8b169523267b07b47b8333c9189a4586f54a8cc29f images/pxeboot/initrd.img = sha256:31cb34ff174707a7846483a81579a124c0beea4cc1030f1884103a9a0622de47 images/pxeboot/vmlinuz = sha256:40fa3404fa9686065d95b9dc2caa97a08680b7e8566baa2c3f09ff48fd660d48 [general] ; WARNING.0 = This section provides compatibility with pre-productmd treeinfos. ; WARNING.1 = Read productmd documentation for details about new format. arch = x86_64 family = CentOS Linux name = CentOS Linux 8 packagedir = AppStream/Packages platforms = x86_64,xen repository = AppStream timestamp = 1605735523 variant = AppStream variants = AppStream,BaseOS version = 8 [header] type = productmd.treeinfo version = 1.2 [images-x86_64] boot.iso = images/boot.iso efiboot.img = images/efiboot.img initrd = images/pxeboot/initrd.img kernel = images/pxeboot/vmlinuz [images-xen] initrd = images/pxeboot/initrd.img kernel = images/pxeboot/vmlinuz [release] name = CentOS Linux short = CentOS version = 8 [stage2] mainimage = images/install.img [tree] arch = x86_64 build_timestamp = 1605735523 platforms = x86_64,xen variants = AppStream,BaseOS [variant-AppStream] id = AppStream name = AppStream packages = AppStream/Packages repository = AppStream type = variant uid = AppStream [variant-BaseOS] id = BaseOS name = BaseOS packages = Packages repository = . type = variant uid = BaseOS
In case it isn't always reproducible, I did also sync CenOS 8 BaseOS kickstart, AppStream OS, and AppStream kickstart
Versions:
pulp-certguard (1.1.0) pulp-container (2.2.1) pulp-deb (2.8.0) pulp-file (1.5.0) pulp-rpm (3.10.0) pulpcore (3.9.1)
Additionally (moved from #9123):
When .treeinfo contains relative paths to a location outside of the repository, as is the case with CentOS 8, Pulp cannot serve those sub-repos precisely as they are. So it syncs all of them and publishes all of them into one repository with subdirectories for the sub-repos, and writes the locations of these sub-repos into the .treeinfo metadata.
In the mirrored metadata case, the .treeinfo file will be pointing to the wrong locations, so we need to rewrite the .treeinfo file just like we do during a standard publish.
As .treeinfo isn't checksummed or signed we aren't prevented from doing this.
Related issues
Fix .treeinfo metadata being written improperly for Pulp users
closes: #8622 https://pulp.plan.io/issues/8622