@@ -767,7 +767,7 @@ func findPrefetchResources(prefetchDir string) (*prefetchResources, error) {
767767 resources .envFile = envfiles [0 ]
768768 }
769769
770- currentArch := goArchToArchitectureLabel (runtime .GOARCH )
770+ currentArch := goArchToRpmArch (runtime .GOARCH )
771771
772772 reposD := filepath .Join (prefetchDir , "output" , "deps" , "rpm" , currentArch , "repos.d" )
773773 if _ , err := os .Lstat (reposD ); err == nil {
@@ -873,7 +873,7 @@ func (c *Build) copyPrefetchDir() (string, error) {
873873
874874 l .Logger .Debugf ("Copying prefetch resources to %s" , prefetchDirCopy )
875875
876- currentArch := goArchToArchitectureLabel (runtime .GOARCH )
876+ currentArch := goArchToRpmArch (runtime .GOARCH )
877877 // Clean the filepaths, we do string comparisons below
878878 prefetchDir = filepath .Clean (prefetchDir )
879879 prefetchDirCopy = filepath .Clean (prefetchDirCopy )
@@ -1335,7 +1335,7 @@ func (c *Build) processLabelsAndAnnotations() error {
13351335 if c .Params .AddLegacyLabels {
13361336 defaultLabels = append (defaultLabels , "build-date=" + buildTimeStr )
13371337
1338- arch := goArchToArchitectureLabel (runtime .GOARCH )
1338+ arch := goArchToRpmArch (runtime .GOARCH )
13391339 defaultLabels = append (defaultLabels , "architecture=" + arch )
13401340
13411341 if c .Params .ImageSource != "" {
@@ -1406,11 +1406,8 @@ func parseAnnotationsFile(filePath string) ([]string, error) {
14061406 return annotationStrings , nil
14071407}
14081408
1409- // Convert Go's GOARCH value to the value used for the 'architecture' label.
1410- //
1411- // Historically, the 'architecture' label used the RPM architecture names rather
1412- // than the GOARCH names. Keep that the same.
1413- func goArchToArchitectureLabel (goarch string ) string {
1409+ // Convert a supported GOARCH value to the corresponding RPM architecture name.
1410+ func goArchToRpmArch (goarch string ) string {
14141411 switch goarch {
14151412 case "amd64" :
14161413 return "x86_64"
0 commit comments