Yumrepofs should translate i386 to i686

This commit is contained in:
Mustafa Gezen 2022-07-14 18:58:49 +02:00
parent e7e949fc39
commit 80a9f32441
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1
4 changed files with 21 additions and 4 deletions

View File

@ -62,6 +62,9 @@ func (s *Server) GetBlob(ctx context.Context, req *yumrepofspb.GetBlobRequest) (
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
if strings.HasSuffix(req.Blob, ".sqlite.gz") {
s3Req, _ := s.s3.GetObjectRequest(&s3.GetObjectInput{

View File

@ -44,6 +44,9 @@ func (s *Server) GetRepoMd(_ context.Context, req *yumrepofspb.GetRepoMdRequest)
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
latestRevision, err := s.db.GetLatestActiveRepositoryRevisionByProjectIdAndNameAndArch(req.ProjectId, req.RepoName, req.Arch)
if err != nil {
@ -66,6 +69,9 @@ func (s *Server) GetRepoMdSignature(_ context.Context, req *yumrepofspb.GetRepoM
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
latestRevision, err := s.db.GetLatestActiveRepositoryRevisionByProjectIdAndNameAndArch(req.ProjectId, req.RepoName, req.Arch)
if err != nil {
@ -88,6 +94,9 @@ func (s *Server) GetPublicKey(_ context.Context, req *yumrepofspb.GetPublicKeyRe
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
key, err := s.db.GetDefaultKeyForProject(req.ProjectId)
if err != nil {
@ -104,6 +113,9 @@ func (s *Server) GetUrlMappings(_ context.Context, req *yumrepofspb.GetUrlMappin
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
latestRevision, err := s.db.GetLatestActiveRepositoryRevisionByProjectIdAndNameAndArch(req.ProjectId, req.RepoName, req.Arch)
if err != nil {

View File

@ -51,6 +51,9 @@ func (s *Server) GetRpm(ctx context.Context, req *yumrepofspb.GetRpmRequest) (*y
if err := req.ValidateAll(); err != nil {
return nil, err
}
if req.Arch == "i386" {
req.Arch = "i686"
}
fileName := fmt.Sprintf("%s/%s.rpm", req.ParentTaskId, strings.TrimSuffix(req.FileName, ".rpm"))
if len(req.ParentTaskId) == 1 {

View File

@ -1,5 +1,5 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push", "container_layer")
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
REGISTRY_VARIANT = "aws"
@ -63,10 +63,10 @@ def container(image_name, files, tars_to_layer = [], base = "//bases/bazel/go",
if len(server_files) > 0:
nodejs_image(
name = "%s_image_node" %image_name,
name = "%s_image_node" % image_name,
entry_point = server_entrypoint,
data = server_files,
base = ":%s_image" % image_name
base = ":%s_image" % image_name,
)
container_push(
@ -88,4 +88,3 @@ def container(image_name, files, tars_to_layer = [], base = "//bases/bazel/go",
}) if should_use_aws_format and not disable_conditional else tag,
visibility = ["//visibility:public"],
)