Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check DNS in postinst scripts in package and image mode #1352

Open
mh21 opened this issue Jan 10, 2025 · 7 comments
Open

Check DNS in postinst scripts in package and image mode #1352

mh21 opened this issue Jan 10, 2025 · 7 comments

Comments

@mh21
Copy link

mh21 commented Jan 10, 2025

When provisioning current c10s in image mode in Beaker, the postinst script is unable to resolve DNS names.

This works fine for FC41, or for c10s package mode.

Please consider adding tests that check for DNS resolution in postinst.

Reproducer: beaker.zip

@cgwalters
Copy link

When I last looked at this what I suspect is going on is that Anaconda is setting up /sysroot/etc/resolv.conf, but for ostree/bootc we actually use the deployment root.

https://github.com/rhinstaller/anaconda/blob/91fe91ad6f03903114e6637d792b8d7caa679103/pyanaconda/installation.py#L426

@cgwalters
Copy link

Filed https://issues.redhat.com/browse/RHEL-73499 to track this

@jkonecny12
Copy link
Member

I'm afraid this will not be the only case with such a bug.

Before the image mode we more or less knew how the system will look like after the installation because it was a fresh installation. However, with bootc it is no longer true because of any customization done by the user. Thanks for filing the issue.

@cgwalters
Copy link

Before the image mode we more or less knew how the system will look like after the installation because it was a fresh installation. However, with bootc it is no longer true because of any customization done by the user.

Can you elaborate a bit more? In theory admins can make (nearly) equally arbitrary changes in the set of RPMs input. Although now it is definitely possible to do things like not having rpm in the target system at all, etc.

@jkonecny12
Copy link
Member

Yes, they can do that now with:

  • kickstart file
  • Image Builder (tar payload)
  • bootc

I guess, the change is that bootc is much more suited for these changes than the other methods? So, it's not something new, it's more like blind spot on our side because these changes were not that easy to achieve before IMHO.

@cgwalters
Copy link

Yes, actually on this topic - certainly someone could put /etc/resolv.conf in an RPM, but it'd likely feel a bit weird to do. But not only is it way easier and more obvious to do that with bootc, it actually always happens today with podman build because of containers/buildah#4242 (comment) even if you don't want it...

@rvykydal
Copy link
Contributor

When I last looked at this what I suspect is going on is that Anaconda is setting up /sysroot/etc/resolv.conf, but for ostree/bootc we actually use the deployment root.

https://github.com/rhinstaller/anaconda/blob/91fe91ad6f03903114e6637d792b8d7caa679103/pyanaconda/installation.py#L426

Seems it can be the cause of the problem: https://issues.redhat.com/browse/RHEL-73499?focusedId=26380845&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-26380845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants