Skip to content

Commit

Permalink
Merge pull request #322 from cderici/add-riscv-architecture
Browse files Browse the repository at this point in the history
[JUJU-1750] Add riscv among supported architectures
  • Loading branch information
jack-w-shaw authored Jan 23, 2023
2 parents ce9eede + 4dbe60c commit b276d10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
ARM64 = "arm64"
PPC64EL = "ppc64el"
S390X = "s390x"
RISCV64 = "riscv64"

// Older versions of Juju used "ppc64" instead of ppc64el
LEGACY_PPC64 = "ppc64"
Expand All @@ -30,6 +31,7 @@ var AllSupportedArches = []string{
ARM64,
PPC64EL,
S390X,
RISCV64,
}

// Info records the information regarding each architecture recognised by Juju.
Expand All @@ -40,6 +42,7 @@ var Info = map[string]ArchInfo{
ARM64: {64},
PPC64EL: {64},
S390X: {64},
RISCV64: {64},
}

// ArchInfo is a struct containing information about a supported architecture.
Expand All @@ -60,6 +63,7 @@ var archREs = []struct {
{regexp.MustCompile("aarch64"), ARM64},
{regexp.MustCompile("ppc64|ppc64el|ppc64le"), PPC64EL},
{regexp.MustCompile("s390x"), S390X},
{regexp.MustCompile("riscv64|risc$|risc-[vV]64"), RISCV64},
}

// Override for testing.
Expand Down
4 changes: 4 additions & 0 deletions arch/arch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (s *archSuite) TestNormaliseArch(c *gc.C) {
{"ppc64le", "ppc64el"},
{"ppc64", "ppc64el"},
{"s390x", "s390x"},
{"riscv64", "riscv64"},
{"risc", "riscv64"},
{"risc-v64", "riscv64"},
{"risc-V64", "riscv64"},
} {
arch := arch.NormaliseArch(test.raw)
c.Check(arch, gc.Equals, test.arch)
Expand Down

0 comments on commit b276d10

Please sign in to comment.