This repository was archived by the owner on Apr 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-17
lines changed
core/src/main/java/io/javaoperatorsdk/jenvtest/binary Expand file tree Collapse file tree 1 file changed +24
-17
lines changed Original file line number Diff line number Diff line change 11package io .javaoperatorsdk .jenvtest .binary ;
22
33public class OSInfo {
4+ private final String os ;
5+ private final String arch ;
46
5- public String getOSName () {
6- String os = System .getProperty ("os.name" ).toLowerCase ();
7+ public OSInfo () {
8+ final var osArch = System .getProperty ("os.arch" ).toLowerCase ();
9+ switch (osArch ) {
10+ case "ppc64" :
11+ arch = "ppc64le" ;
12+ break ;
13+ case "aarch64" :
14+ arch = "arm64" ;
15+ break ;
16+ default :
17+ arch = "amd64" ;
18+ }
19+
20+ final var os = System .getProperty ("os.name" ).toLowerCase ();
721 if (os .contains ("win" )) {
8- return "windows" ;
22+ this . os = "windows" ;
923 } else if (os .contains ("mac" )) {
10- return "darwin" ;
24+ this . os = "darwin" ;
1125 } else {
12- return os ;
26+ this . os = os ;
1327 }
1428 }
1529
16- /**
17- * Only amd64 and ppc64 binaries available.
18- *
19- * @return ppc64le if on that architecture otherwise amd64.
20- */
21- public String getOSArch () {
22- var osArch = System .getProperty ("os.arch" ).toLowerCase ();
23- if (osArch .contains ("ppc64" )) {
24- return "ppc64le" ;
25- } else {
26- return "amd64" ;
27- }
30+ public String getOSName () {
31+ return os ;
2832 }
2933
34+ public String getOSArch () {
35+ return arch ;
36+ }
3037}
You can’t perform that action at this time.
0 commit comments