Skip to content

Commit

Permalink
DT-151 configure settings in rancher (#45)
Browse files Browse the repository at this point in the history
In order to configure Rancher Desktop to disable kubernetes and use moby
as the container engine, we are forcing the factory reset first.

In addition to this, we check if Rancher Desktop was installed manually
with `brew` command. If this is true we uninstall that package to avoid
any conflict.
  • Loading branch information
DanielSotoEstrada authored Mar 23, 2023
1 parent 998d8ce commit f1e13a3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.18
0.1.19
2 changes: 1 addition & 1 deletion formula/ih-core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class IhCore < Formula
VERSION="0.1.18"
VERSION="0.1.19"
desc "Brew formula for installing core tools used at Included Health engineering."
homepage "https://github.com/ConsultingMD/homebrew-ih-public"
license "CC BY-NC-ND 4.0"
Expand Down
23 changes: 21 additions & 2 deletions lib/core/rancher/step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,28 @@ function ih::setup::core.rancher::install() {

cp "${THIS_DIR}/io.rancherdesktop.profile.defaults.plist" "$HOME/Library/Preferences/io.rancherdesktop.profile.defaults.plist"

if command -v rdctl; then
rdctl shutdown
# Check if Rancher was installed manually
brew list rancher > /dev/null 2>&1
RANCHERINSTALLED=$?

#Check if IH Rancher is already installed
brew list ih-rancher > /dev/null 2>&1
IHRANCHERINSTALLED=$?

# If rancher or ih-rancher is already installed reset to factory
if [ $RANCHERINSTALLED -eq 0 ] || [ $IHRANCHERINSTALLED -eq 0 ]
then
$(/Applications/Rancher\ Desktop.app/Contents/Resources/resources/darwin/bin/rdctl factory-reset)
fi

# Check if Rancher was installed manually with brew
if [ $RANCHERINSTALLED -eq 0 ]
then
echo "Rancher Desktop was installed previously with brew command. In order to avoid any conflicts this script will uninstall that package".
echo "You may be required to enter your password"
brew uninstall rancher
fi


CASKSUCCEEDED=1
# Installation and configuration of Rancher Desktop
Expand Down

0 comments on commit f1e13a3

Please sign in to comment.