Skip to content

Commit d76db6b

Browse files
committed
Add PRO flag/switch to k3sup installer
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 5e5228b commit d76db6b

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,12 @@ The recommended option is to use K3sup CE to obtain K3sup Pro:
175175

176176
```bash
177177
# Get the latest K3sup CE version
178-
curl -sLS https://get.k3sup.dev | sudo sh
178+
PRO=1 curl -sLS https://get.k3sup.dev | sudo sh
179+
```
180+
181+
Or, if you already have the latest K3sup CE version, it can replace itself:
179182

180-
# Use K3sup CE to replace itself with the Pro edition
183+
```bash
181184
sudo k3sup get pro
182185
```
183186

get.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ export REPO=k3sup
1212
export BINLOCATION="/usr/local/bin"
1313
export SUCCESS_CMD="$BINLOCATION/$REPO version"
1414

15+
GET_PRO=false
16+
17+
if [ "$PRO" = "true" ]; then
18+
GET_PRO=true
19+
fi
20+
21+
if [ "$PRO" = "1" ]; then
22+
GET_PRO=true
23+
fi
24+
25+
if [ "$GET_PRO" = "true" ]; then
26+
echo "PRO=true"
27+
echo ""
28+
echo "Plan: download K3sup CE then upgrade to K3sup Pro"
29+
echo ""
30+
fi
31+
1532
###############################
1633
# Content common across repos #
1734
###############################
@@ -185,6 +202,7 @@ getPackage() {
185202
fi
186203
}
187204

205+
188206
thanks() {
189207
echo
190208
echo "================================================================"
@@ -197,4 +215,11 @@ thanks() {
197215

198216
hasCli
199217
getPackage
200-
thanks
218+
219+
if [ "$GET_PRO" = "false" ]; then
220+
thanks
221+
else
222+
echo "Upgrading to K3sup Pro"
223+
224+
$BINLOCATION/$REPO get pro
225+
fi

0 commit comments

Comments
 (0)