Skip to content

Commit

Permalink
RHINENG-10940: store bootc bool to db
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Jul 12, 2024
1 parent afba5ca commit 087a68e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type SystemPlatform struct {
SatelliteManaged bool `gorm:"column:satellite_managed"`
BuiltPkgcache bool `gorm:"column:built_pkgcache"`
Arch *string
Bootc bool
}

func (SystemPlatform) TableName() string {
Expand Down
7 changes: 7 additions & 0 deletions listener/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host *
"satellite_managed",
"built_pkgcache",
"arch",
"bootc",
}

now := time.Now()
Expand All @@ -328,6 +329,11 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host *
displayName = *host.DisplayName
}

isBootc := false
if len(host.SystemProfile.BootcStatus.Booted.Image) > 0 {
isBootc = true
}

staleWarning := host.StaleWarningTimestamp.Time()
updatesReqJSONString := string(updatesReqJSON)
systemPlatform := models.SystemPlatform{
Expand All @@ -347,6 +353,7 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host *
SatelliteManaged: host.SystemProfile.SatelliteManaged,
BuiltPkgcache: yumUpdates.GetBuiltPkgcache(),
Arch: host.SystemProfile.Arch,
Bootc: isBootc,
}

type OldChecksums struct {
Expand Down

0 comments on commit 087a68e

Please sign in to comment.