build(deps): bump the go-deps group across 1 directory with 2 updates

Bumps the go-deps group with 1 update in the / directory: [github.com/osbuild/images](https://github.com/osbuild/images).


Updates `github.com/osbuild/images` from 0.80.0 to 0.81.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.80.0...v0.81.0)

Updates `google.golang.org/api` from 0.194.0 to 0.195.0
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.194.0...v0.195.0)

---
updated-dependencies:
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2024-09-03 04:21:24 +00:00 committed by Tomáš Hozza
parent 22a0452ea9
commit 76b224c6a9
19 changed files with 87 additions and 120 deletions

View file

@ -25,10 +25,6 @@ func (b *Btrfs) EntityName() string {
return "btrfs"
}
func (b *Btrfs) IsContainer() bool {
return true
}
func (b *Btrfs) Clone() Entity {
if b == nil {
return nil
@ -122,10 +118,6 @@ type BtrfsSubvolume struct {
UUID string
}
func (subvol *BtrfsSubvolume) IsContainer() bool {
return false
}
func (bs *BtrfsSubvolume) Clone() Entity {
if bs == nil {
return nil

View file

@ -60,10 +60,6 @@ const (
// Entity is the base interface for all disk-related entities.
type Entity interface {
// IsContainer indicates if the implementing type can
// contain any other entities.
IsContainer() bool
// Clone returns a deep copy of the entity.
Clone() Entity
}

View file

@ -31,10 +31,6 @@ func (fs *Filesystem) EntityName() string {
return "filesystem"
}
func (fs *Filesystem) IsContainer() bool {
return false
}
// Clone the filesystem structure
func (fs *Filesystem) Clone() Entity {
if fs == nil {

View file

@ -58,10 +58,6 @@ func (lc *LUKSContainer) EntityName() string {
return "luks"
}
func (lc *LUKSContainer) IsContainer() bool {
return true
}
func (lc *LUKSContainer) GetItemCount() uint {
if lc.Payload == nil {
return 0

View file

@ -27,10 +27,6 @@ func (vg *LVMVolumeGroup) EntityName() string {
return "lvm"
}
func (vg *LVMVolumeGroup) IsContainer() bool {
return true
}
func (vg *LVMVolumeGroup) Clone() Entity {
if vg == nil {
return nil
@ -170,10 +166,6 @@ type LVMLogicalVolume struct {
Payload Entity
}
func (lv *LVMLogicalVolume) IsContainer() bool {
return true
}
func (lv *LVMLogicalVolume) Clone() Entity {
if lv == nil {
return nil

View file

@ -21,10 +21,6 @@ type Partition struct {
Payload PayloadEntity
}
func (p *Partition) IsContainer() bool {
return true
}
func (p *Partition) Clone() Entity {
if p == nil {
return nil

View file

@ -160,10 +160,6 @@ func NewPartitionTable(basePT *PartitionTable, mountpoints []blueprint.Filesyste
return newPT, nil
}
func (pt *PartitionTable) IsContainer() bool {
return true
}
func (pt *PartitionTable) Clone() Entity {
if pt == nil {
return nil
@ -785,6 +781,7 @@ func (pt *PartitionTable) ensureBtrfs() error {
Mountpoint: "/",
Compress: DefaultBtrfsCompression,
ReadOnly: opts.ReadOnly(),
Size: part.Size,
},
},
}

View file

@ -163,7 +163,6 @@ func ec2CommonPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
"dhcpcd",
"yum-utils",
"dracut-config-generic",
"gdisk",
"grub2",
"langpacks-en",
"NetworkManager-cloud-setup",

View file

@ -68,7 +68,6 @@ func azureCommonPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
"cloud-utils-growpart",
"dracut-config-generic",
"efibootmgr",
"gdisk",
"hyperv-daemons",
"kernel-core",
"kernel-modules",

View file

@ -89,7 +89,7 @@ func genMountsForBootupd(source string, pt *disk.PartitionTable) ([]Mount, error
continue
}
// TODO: support things like LVM here via supporting "disk.Container"
// TODO: support things like LUKS here via supporting "disk.Container"?
switch payload := part.Payload.(type) {
case disk.Mountable:
mount, err := genOsbuildMount(source, payload)
@ -107,6 +107,20 @@ func genMountsForBootupd(source string, pt *disk.PartitionTable) ([]Mount, error
mount.Partition = common.ToPtr(idx + 1)
mounts = append(mounts, *mount)
}
case *disk.LVMVolumeGroup:
for i := range payload.LogicalVolumes {
lv := &payload.LogicalVolumes[i]
mountable, ok := lv.Payload.(disk.Mountable)
if !ok {
return nil, fmt.Errorf("expected LV payload %+[1]v to be mountable, got %[1]T", lv.Payload)
}
mount, err := genOsbuildMount(lv.Name, mountable)
if err != nil {
return nil, err
}
mount.Source = lv.Name
mounts = append(mounts, *mount)
}
default:
return nil, fmt.Errorf("type %T not supported by bootupd handling yet", part.Payload)
}
@ -119,8 +133,7 @@ func genMountsForBootupd(source string, pt *disk.PartitionTable) ([]Mount, error
return mounts, nil
}
func GenBootupdDevicesMounts(filename string, pt *disk.PartitionTable, pltf platform.Platform) (map[string]Device, []Mount, error) {
devName := "disk"
func genDevicesForBootupd(filename, devName string, pt *disk.PartitionTable) (map[string]Device, error) {
devices := map[string]Device{
devName: Device{
Type: "org.osbuild.loopback",
@ -130,6 +143,28 @@ func GenBootupdDevicesMounts(filename string, pt *disk.PartitionTable, pltf plat
},
},
}
for idx, part := range pt.Partitions {
switch payload := part.Payload.(type) {
case *disk.LVMVolumeGroup:
for _, lv := range payload.LogicalVolumes {
// partitions start with "1", so add "1"
partNum := idx + 1
devices[lv.Name] = *NewLVM2LVDevice(devName, &LVM2LVDeviceOptions{Volume: lv.Name, VGPartnum: common.ToPtr(partNum)})
}
default:
// nothing
}
}
return devices, nil
}
func GenBootupdDevicesMounts(filename string, pt *disk.PartitionTable, pltf platform.Platform) (map[string]Device, []Mount, error) {
devName := "disk"
devices, err := genDevicesForBootupd(filename, devName, pt)
if err != nil {
return nil, nil, err
}
mounts, err := genMountsForBootupd(devName, pt)
if err != nil {
return nil, nil, err

View file

@ -5,6 +5,8 @@ package osbuild
type LVM2LVDeviceOptions struct {
// Logical volume to activate
Volume string `json:"volume"`
// The partition the volume group is located on
VGPartnum *int `json:"vg_partnum,omitempty"`
}
func (LVM2LVDeviceOptions) isDeviceOptions() {}

View file

@ -326,57 +326,3 @@ func (packages PackageList) ToPackageInfos() []PackageInfo {
return results
}
// Backwards compatibility for old workers:
// This was added since the custom repository
// PR changes the baseurl field to a list of baseurls.
// This can be removed after 3 releases since the
// old-worker-regression test tests the current
// osbuild-composer with a worker from 3 releases ago
func (r RepoConfig) MarshalJSON() ([]byte, error) {
type aliasType RepoConfig
type compatType struct {
aliasType
BaseURL string `json:"baseurl,omitempty"`
}
compatRepo := compatType{
aliasType: aliasType(r),
}
var baseUrl string
if len(r.BaseURLs) > 0 {
baseUrl = strings.Join(r.BaseURLs, ",")
}
compatRepo.BaseURL = baseUrl
return json.Marshal(compatRepo)
}
// Backwards compatibility for old workers:
// This was added since the custom repository
// PR changes the baseurl field to a list of baseurls.
// This can be removed after 3 releases since the
// old-worker-regression test tests the current
// osbuild-composer with a worker from 3 releases ago
func (r *RepoConfig) UnmarshalJSON(data []byte) error {
type aliasType RepoConfig
type compatType struct {
aliasType
BaseURL string `json:"baseurl,omitempty"`
}
var compatRepo compatType
if err := json.Unmarshal(data, &compatRepo); err != nil {
return err
}
if compatRepo.BaseURL != "" {
compatRepo.BaseURLs = strings.Split(compatRepo.BaseURL, ",")
}
*r = RepoConfig(compatRepo.aliasType)
return nil
}