File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,22 @@ def version_and_commit_id(self) -> Optional[str]:
370370
371371 return f"{ self ._version } -{ self ._commit_id } "
372372
373+ @property
374+ def version_epoch (self ) -> Optional [int ]:
375+ """
376+ Returns the GardenLinux version epoch of the cname parsed.
377+
378+ :return: (str) GardenLinux version epoch
379+ :since: 1.0.0
380+ """
381+
382+ epoch = None
383+
384+ if self ._version is not None and "." in self ._version :
385+ epoch = int (self ._version .split ("." , 1 )[0 ])
386+
387+ return epoch
388+
373389 def load_from_release_file (self , release_file : PathLike | str ) -> None :
374390 """
375391 Loads and parses a release metadata file.
Original file line number Diff line number Diff line change @@ -153,13 +153,18 @@ def upload_from_directory(
153153 if secureboot is None :
154154 secureboot = "_trustedboot" in feature_list
155155
156+ version_epoch = cname_object .version_epoch
157+
158+ if version_epoch is None :
159+ version_epoch = ""
160+
156161 metadata = {
157162 "platform" : cname_object .feature_set_platform ,
158163 "architecture" : cname_object .arch ,
159164 "base_image" : None ,
160165 "build_committish" : cname_object .commit_hash ,
161166 "build_timestamp" : datetime .fromtimestamp (release_timestamp ).isoformat (),
162- "gardenlinux_epoch" : int ( cname_object . version . split ( "." , 1 )[ 0 ]) ,
167+ "gardenlinux_epoch" : { version_epoch } ,
163168 "logs" : None ,
164169 "modifiers" : cname_object .feature_set ,
165170 "require_uefi" : require_uefi ,
You can’t perform that action at this time.
0 commit comments