Skip to content

Commit 657dcad

Browse files
authored
Merge pull request #638 from SUSE/lts_container
Add support for LTS container handling
2 parents 2942a4b + 0a17d39 commit 657dcad

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

src/bci_build/package.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ def pretty_os_version_no_dash(self) -> str:
161161

162162
#: Operating system versions that have the label ``com.suse.release-stage`` set
163163
#: to ``released``.
164-
RELEASED_OS_VERSIONS = [OsVersion.SP4, OsVersion.SP5, OsVersion.TUMBLEWEED]
164+
RELEASED_OS_VERSIONS = [OsVersion.SP3] + [
165+
OsVersion.SP4,
166+
OsVersion.SP5,
167+
OsVersion.TUMBLEWEED,
168+
]
165169

166170
# For which versions to create Application and Language Containers?
167171
ALL_NONBASE_OS_VERSIONS = [OsVersion.SP5, OsVersion.SP6, OsVersion.TUMBLEWEED]
@@ -233,6 +237,8 @@ def _build_tag_prefix(os_version: OsVersion) -> str:
233237
return "opensuse/bci"
234238
if os_version == OsVersion.BASALT:
235239
return "alp/bci"
240+
if os_version == OsVersion.SP3:
241+
return "suse/ltss/sle15.3"
236242
return "bci"
237243

238244

@@ -261,6 +267,9 @@ class ImageProperties:
261267
#: Url to the vendor's home page
262268
url: str
263269

270+
#: The EULA identifier to set
271+
eula: str
272+
264273
#: Url to learn about the support lifecycle of the image
265274
lifecycle_url: str
266275

@@ -284,6 +293,7 @@ class ImageProperties:
284293
vendor="openSUSE Project",
285294
registry="registry.opensuse.org",
286295
url="https://www.opensuse.org",
296+
eula="sle-bci",
287297
lifecycle_url="https://en.opensuse.org/Lifetime",
288298
label_prefix="org.opensuse",
289299
distribution_base_name="openSUSE Tumbleweed",
@@ -297,18 +307,34 @@ class ImageProperties:
297307
vendor="SUSE LLC",
298308
registry="registry.suse.com",
299309
url="https://www.suse.com/products/server/",
310+
eula="sle-bci",
300311
lifecycle_url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15",
301312
label_prefix="com.suse",
302313
distribution_base_name="SLE",
303314
build_tag_prefix=_build_tag_prefix(OsVersion.SP5),
304315
application_container_build_tag_prefix="suse",
305316
)
306317

318+
#: Image properties for SUSE Linux Enterprise 15 SP3 LTSS images
319+
_SLE_15_SP3_LTSS_IMAGE_PROPS = ImageProperties(
320+
maintainer="SUSE LLC (https://www.suse.com/)",
321+
vendor="SUSE LLC",
322+
registry="registry.suse.com",
323+
url="https://www.suse.com/products/server/",
324+
eula="sle-eula",
325+
lifecycle_url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15",
326+
label_prefix="com.suse",
327+
distribution_base_name="SLE LTSS",
328+
build_tag_prefix=_build_tag_prefix(OsVersion.SP3),
329+
application_container_build_tag_prefix="suse",
330+
)
331+
307332
_BASALT_IMAGE_PROPS = ImageProperties(
308333
maintainer="SUSE LLC (https://www.suse.com/)",
309334
vendor="SUSE LLC",
310335
registry="registry.suse.com",
311336
url="https://susealp.io/",
337+
eula="sle-bci",
312338
lifecycle_url="https://www.suse.com/lifecycle",
313339
label_prefix="com.suse.basalt",
314340
distribution_base_name="Basalt Project",
@@ -481,6 +507,8 @@ def __post_init__(self) -> None:
481507
self._image_properties = _OPENSUSE_IMAGE_PROPS
482508
elif self.os_version == OsVersion.BASALT:
483509
self._image_properties = _BASALT_IMAGE_PROPS
510+
elif self.os_version == OsVersion.SP3:
511+
self._image_properties = _SLE_15_SP3_LTSS_IMAGE_PROPS
484512
else:
485513
self._image_properties = _SLE_IMAGE_PROPS
486514

@@ -518,6 +546,10 @@ def build_version(self) -> Optional[str]:
518546
return f"15.{epoch}{int(self.os_version.value)}"
519547
return None
520548

549+
@property
550+
def eula(self) -> str:
551+
return self._image_properties.eula
552+
521553
@property
522554
def lifecycle_url(self) -> str:
523555
return self._image_properties.lifecycle_url

src/bci_build/templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{%- if image.supported_until %}
3535
LABEL com.suse.supportlevel.until="{{ image.supported_until }}"
3636
{%- endif %}
37-
LABEL com.suse.eula="sle-bci"
37+
LABEL com.suse.eula="{{ image.eula }}"
3838
LABEL com.suse.lifecycle-url="{{ image.lifecycle_url }}"
3939
LABEL com.suse.image-type="{{ image.image_type }}"
4040
LABEL com.suse.release-stage="{{ image.release_stage }}"{% endif %}
@@ -92,7 +92,7 @@
9292
<label name="com.suse.supportlevel.until" value="{{ image.supported_until }}"/>
9393
{%- endif %}
9494
<label name="com.suse.image-type" value="{{ image.image_type }}"/>
95-
<label name="com.suse.eula" value="sle-bci"/>{% endif %}
95+
<label name="com.suse.eula" value="{{ image.eula }}"/>{% endif %}
9696
<label name="{% if image.is_opensuse %}org.opensuse{% else %}com.suse{% endif %}.release-stage" value="{{ image.release_stage }}"/>
9797
<label name="{% if image.is_opensuse %}org.opensuse{% else %}com.suse{% endif %}.lifecycle-url" value="{{ image.lifecycle_url }}"/>
9898
{{- image.extra_label_xml_lines }}

0 commit comments

Comments
 (0)