Skip to content

Commit

Permalink
Support arbitrary registration URL
Browse files Browse the repository at this point in the history
Add support for `operatingSystem.packages.sccRegistrationUrl` to allow
for registration against an RMT/SMT/SUMA.
  • Loading branch information
josegomezr committed Nov 12, 2024
1 parent c0d3780 commit 8b28958
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/image/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ type Packages struct {
PKGList []string `yaml:"packageList"`
AdditionalRepos []AddRepo `yaml:"additionalRepos"`
RegCode string `yaml:"sccRegistrationCode"`
RegUrl string `yaml:"sccRegistrationUrl"`
}

type AddRepo struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/rpm/resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (r *Resolver) prepareLocalRPMs(localRPMConfig *image.LocalRPMConfig) error
func (r *Resolver) writeRPMResolutionScript(localRPMConfig *image.LocalRPMConfig, packages *image.Packages) error {
values := struct {
RegCode string
RegUrl string
AddRepo []image.AddRepo
CacheDir string
PKGList string
Expand All @@ -191,6 +192,7 @@ func (r *Resolver) writeRPMResolutionScript(localRPMConfig *image.LocalRPMConfig
Arch string
}{
RegCode: packages.RegCode,
RegUrl: packages.RegUrl,
AddRepo: packages.AdditionalRepos,
CacheDir: r.generateResolverImgRPMRepoPath(),
NoGPGCheck: packages.NoGPGCheck,
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpm/resolver/templates/rpm-resolution.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -euo pipefail
# Arch - sets the architecture of the rpm packages to pull

{{ if ne .RegCode "" }}
suseconnect -r {{ .RegCode }}
suseconnect -r {{ .RegCode }} {{- with .RegUrl }} --url "{{ . }}" {{- end }}
zypper ref
trap "suseconnect -d" EXIT
{{ end -}}
Expand Down

0 comments on commit 8b28958

Please sign in to comment.