-
Notifications
You must be signed in to change notification settings - Fork 359
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
Master enable ostree containers #4561
Merged
jkonecny12
merged 7 commits into
rhinstaller:master
from
jkonecny12:master-enable-ostree-containers
Mar 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
51b7b14
Add RPM OSTree source from container (#2125655)
jkonecny12 3a316f6
Enable RPM OSTree from container source in payload (#2125655)
jkonecny12 db9e3e6
Add new OSTree container source test (#2125655)
jkonecny12 86047da
Add release note for ostreecontainer (#2125655)
jkonecny12 200cc07
Deduplicate test data creation func in rpm ostree
jkonecny12 8260a9c
Move rpm-ostree deps from Lorax to Anaconda (#2125655)
jkonecny12 377f54a
Implement needs_network for rpm_ostree_container (#2125655)
jkonecny12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add RPM OSTree source from container (#2125655)
RPM OSTree is getting new functionality to use containers as the base image. Thanks to that it's possible to use standard container repositories. This source enables to use these repositories. Related: rhbz#2125655
- Loading branch information
commit 51b7b14ce8ebc64020901706c87511fb353a90d2
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
pyanaconda/modules/payloads/source/rpm_ostree_container/Makefile.am
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published | ||
# by the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME) | ||
payload_moduledir = $(pkgpyexecdir)/modules/payloads/source/rpm_ostree_container | ||
payload_module_PYTHON = $(srcdir)/*.py | ||
|
||
MAINTAINERCLEANFILES = Makefile.in |
Empty file.
92 changes: 92 additions & 0 deletions
92
pyanaconda/modules/payloads/source/rpm_ostree_container/rpm_ostree_container.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# | ||
# The RPM OSTree source module. | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from pyanaconda.anaconda_loggers import get_module_logger | ||
from pyanaconda.core.i18n import _ | ||
from pyanaconda.modules.common.structures.rpm_ostree import RPMOSTreeContainerConfigurationData | ||
from pyanaconda.modules.payloads.constants import SourceType | ||
from pyanaconda.modules.payloads.source.rpm_ostree.rpm_ostree import \ | ||
RPMOSTreeSourceModule | ||
from pyanaconda.modules.payloads.source.rpm_ostree_container.rpm_ostree_container_interface import \ | ||
RPMOSTreeContainerSourceInterface | ||
|
||
log = get_module_logger(__name__) | ||
|
||
__all__ = ["RPMOSTreeContainerSourceModule"] | ||
|
||
|
||
class RPMOSTreeContainerSourceModule(RPMOSTreeSourceModule): | ||
"""The RPM OSTree from container source module.""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self._configuration = RPMOSTreeContainerConfigurationData() | ||
|
||
@property | ||
def type(self): | ||
"""Get type of this source.""" | ||
return SourceType.RPM_OSTREE_CONTAINER | ||
|
||
@property | ||
def description(self): | ||
"""Get description of this source.""" | ||
return _("RPM OSTree Container") | ||
|
||
def for_publication(self): | ||
"""Return a DBus representation.""" | ||
return RPMOSTreeContainerSourceInterface(self) | ||
|
||
@property | ||
def network_required(self): | ||
"""Does the source require a network? | ||
|
||
:return: True or False | ||
""" | ||
# FIXME: Missing network detection logic based on the URL | ||
return False | ||
|
||
def process_kickstart(self, data): | ||
"""Process the kickstart data.""" | ||
configuration = RPMOSTreeContainerConfigurationData() | ||
|
||
configuration.stateroot = data.ostreecontainer.stateroot | ||
configuration.url = data.ostreecontainer.url | ||
configuration.remote = data.ostreecontainer.remote | ||
configuration.transport = data.ostreecontainer.transport | ||
configuration.signature_verification_enabled = not data.ostreecontainer.noSignatureVerification | ||
|
||
self.set_configuration(configuration) | ||
|
||
def setup_kickstart(self, data): | ||
"""Setup the kickstart data.""" | ||
data.ostreecontainer.stateroot = self.configuration.stateroot | ||
data.ostreecontainer.remote = self.configuration.remote | ||
data.ostreecontainer.transport = self.configuration.transport | ||
data.ostreecontainer.url = self.configuration.url | ||
data.ostreecontainer.noSignatureVerification = not self.configuration.signature_verification_enabled | ||
data.ostreecontainer.seen = True | ||
|
||
def __repr__(self): | ||
"""Return a string representation of the source.""" | ||
return "Source(type='{}', stateroot='{}', transport='{}', url='{}')".format( | ||
self.type.value, | ||
self.configuration.stateroot, | ||
self.configuration.transport, | ||
self.configuration.url | ||
) |
58 changes: 58 additions & 0 deletions
58
pyanaconda/modules/payloads/source/rpm_ostree_container/rpm_ostree_container_interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# DBus interface for the RPM OSTree source module. | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from dasbus.server.property import emits_properties_changed | ||
from dasbus.typing import * # pylint: disable=wildcard-import | ||
from dasbus.server.interface import dbus_interface | ||
from pyanaconda.modules.common.constants.interfaces import PAYLOAD_SOURCE_RPM_OSTREE_CONTAINER | ||
from pyanaconda.modules.common.structures.rpm_ostree import RPMOSTreeContainerConfigurationData | ||
from pyanaconda.modules.payloads.source.source_base_interface import PayloadSourceBaseInterface | ||
|
||
__all__ = ["RPMOSTreeContainerSourceInterface"] | ||
|
||
|
||
@dbus_interface(PAYLOAD_SOURCE_RPM_OSTREE_CONTAINER.interface_name) | ||
class RPMOSTreeContainerSourceInterface(PayloadSourceBaseInterface): | ||
"""DBus interface for the RPM OSTree source module.""" | ||
|
||
def connect_signals(self): | ||
"""Connect the signals.""" | ||
super().connect_signals() | ||
self.watch_property("Configuration", self.implementation.configuration_changed) | ||
|
||
@property | ||
def Configuration(self) -> Structure: | ||
"""The source configuration. | ||
|
||
:return: a structure of the type RPMOSTreeConfigurationData | ||
""" | ||
return RPMOSTreeContainerConfigurationData.to_structure( | ||
self.implementation.configuration | ||
) | ||
|
||
@Configuration.setter | ||
@emits_properties_changed | ||
def Configuration(self, data: Structure): | ||
"""Set the source configuration. | ||
|
||
:param data: a structure of the type RPMOSTreeConfigurationData | ||
""" | ||
self.implementation.set_configuration( | ||
RPMOSTreeContainerConfigurationData.from_structure(data) | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You extended this class so it's the same as the new class... but then made it different anyway?