Skip to content

Commit

Permalink
Add elemental sources to artifacts.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
  • Loading branch information
atanasdinov committed Jul 1, 2024
1 parent 8f28a6d commit 074876d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 3 additions & 1 deletion artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ endpoint-copier-operator:
chart: endpoint-copier-operator
repository: https://suse-edge.github.io/charts
version: 0.2.0

elemental:
register-repository: https://download.opensuse.org/repositories/isv:/Rancher:/Elemental:/Maintenance:/5.5/standard
system-agent-repository: https://download.opensuse.org/repositories/isv:/Rancher:/Elemental:/Maintenance:/5.5/standard
16 changes: 11 additions & 5 deletions pkg/eib/eib.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/suse-edge/edge-image-builder/pkg/build"
"github.com/suse-edge/edge-image-builder/pkg/cache"
"github.com/suse-edge/edge-image-builder/pkg/combustion"
"github.com/suse-edge/edge-image-builder/pkg/env"
"github.com/suse-edge/edge-image-builder/pkg/helm"
"github.com/suse-edge/edge-image-builder/pkg/image"
"github.com/suse-edge/edge-image-builder/pkg/kubernetes"
Expand Down Expand Up @@ -72,7 +71,7 @@ func appendKubernetesSELinuxRPMs(ctx *image.Context) error {
return fmt.Errorf("identifying selinux repository: %w", err)
}

appendRPMs(ctx, repository, selinuxPackage)
appendRPMs(ctx, []image.AddRepo{repository}, selinuxPackage)

gpgKeysDir := combustion.GPGKeysPath(ctx)
if err = os.MkdirAll(gpgKeysDir, os.ModePerm); err != nil {
Expand All @@ -98,12 +97,19 @@ func appendElementalRPMs(ctx *image.Context) {

log.AuditInfo("Elemental registration is configured. The necessary RPM packages will be downloaded.")

appendRPMs(ctx, image.AddRepo{URL: env.ElementalPackageRepository}, combustion.ElementalPackages...)
appendRPMs(ctx, []image.AddRepo{
{
URL: ctx.ArtifactSources.Elemental.RegisterRepository,
},
{
URL: ctx.ArtifactSources.Elemental.SystemAgentRepository,
},
}, combustion.ElementalPackages...)
}

func appendRPMs(ctx *image.Context, repository image.AddRepo, packages ...string) {
func appendRPMs(ctx *image.Context, repos []image.AddRepo, packages ...string) {
repositories := ctx.ImageDefinition.OperatingSystem.Packages.AdditionalRepos
repositories = append(repositories, repository)
repositories = append(repositories, repos...)

packageList := ctx.ImageDefinition.OperatingSystem.Packages.PKGList
packageList = append(packageList, packages...)
Expand Down
8 changes: 4 additions & 4 deletions pkg/env/env.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package env

var (
ElementalPackageRepository = "https://download.opensuse.org/repositories/isv:/Rancher:/Elemental:/Maintenance:/5.5/standard/"
)

type ArtifactSources struct {
MetalLB struct {
Chart string
Expand All @@ -15,4 +11,8 @@ type ArtifactSources struct {
Repository string
Version string
}
Elemental struct {
RegisterRepository string
SystemAgentRepository string
}
}

0 comments on commit 074876d

Please sign in to comment.