File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ RUN apk add --no-cache \
5656# install plural cli
5757ARG TARGETARCH
5858RUN VERSION=$(curl -sL https://api.github.com/repos/pluralsh/plural-cli/releases/latest | jq -r '.tag_name' | tr -d v) && \
59- curl -L https://github.com/pluralsh/plural-cli/releases/latest/ download/plural-cli_${VERSION}_Linux_${TARGETARCH}.tar.gz \
59+ curl -L https://github.com/pluralsh/plural-cli/releases/download/v${VERSION} /plural-cli_${VERSION}_Linux_${TARGETARCH}.tar.gz \
6060 | tar zx && \
6161 mv plural /usr/local/bin/plural && \
6262 chmod +x /usr/local/bin/plural
Original file line number Diff line number Diff line change @@ -6,14 +6,29 @@ import (
66 console "github.com/pluralsh/console/go/client"
77)
88
9+ var (
10+ distroPriorities = map [console.ClusterDistro ]int {
11+ console .ClusterDistroEks : 1 ,
12+ console .ClusterDistroAks : 2 ,
13+ console .ClusterDistroGke : 3 ,
14+ console .ClusterDistroRke : 4 ,
15+ console .ClusterDistroK3s : 5 ,
16+ console .ClusterDistroOpenshift : 6 ,
17+ console .ClusterDistroGeneric : 7 ,
18+ }
19+ )
20+
921func findDistro (vals []string ) console.ClusterDistro {
22+ currentDistro := console .ClusterDistroGeneric
1023 for _ , v := range vals {
1124 if dist , ok := distro (v ); ok {
12- return dist
25+ if distroPriorities [dist ] <= distroPriorities [currentDistro ] {
26+ currentDistro = dist
27+ }
1328 }
1429 }
1530
16- return console . ClusterDistroGeneric
31+ return currentDistro
1732}
1833
1934func distro (val string ) (console.ClusterDistro , bool ) {
You can’t perform that action at this time.
0 commit comments