-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DT-158 permission for file copy and architecture detected (#53)
In order to automatically configure Rancher Desktop, a file should be copied into the computer systems of the users. Sometimes this requires additional permissions. So I added the sudo command. In addition to this we are detecting the architecture of the computer to provide the brew version that will be executed. In addition to this, we are checking if Rancher Desktop was installed successfully in order to continue with the settings such as symlinks. --------- Co-authored-by: SteveRuble <[email protected]>
- Loading branch information
1 parent
db65553
commit ca340a6
Showing
4 changed files
with
145 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.26 | ||
0.1.27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
function ih-rancher-validate() { | ||
|
||
if command -v rdctl >/dev/null; then | ||
echo "✅ Rancher CLI rdctl is available in PATH..." | ||
else | ||
echo "❗ Rancher CLI rdctl is not available in PATH, add $HOME/.rd/bin/ to your PATH." | ||
return 1 | ||
fi | ||
|
||
local config | ||
if config=$(rdctl list-settings); then | ||
echo "✅ Rancher desktop appears to be running" | ||
else | ||
echo "❗ Rancher does does not appear to be running. You must start Rancher Desktop through Finder or by running 'rdctl start'." | ||
return 1 | ||
fi | ||
|
||
local config_version | ||
local kubernetes_enabled | ||
local container_engine | ||
local admin_access | ||
|
||
config_version=$(echo "$config" | jq -r '.version') | ||
kubernetes_enabled=$(echo "$config" | jq -r '.kubernetes.enabled') | ||
container_engine=$(echo "$config" | jq -r '.containerEngine.name') | ||
admin_access=$(echo "$config" | jq -r '.application.adminAccess') | ||
|
||
if [[ "${config_version:-}" -eq "6" ]]; then | ||
echo "✅ Rancher config version is as expected..." | ||
else | ||
echo "❗ Rancher config version is ${config_version:-} (expected 6). Update Rancher Desktop." | ||
return 1 | ||
fi | ||
|
||
if [[ "${kubernetes_enabled:-true}" == 'squid' ]]; then | ||
echo "✅ Kubernetes is disabled..." | ||
else | ||
echo "⚠️ Kubernetes is enabled, which steals port 443. If you need port 443, disable kubernetes by running 'rdctl set --kubernetes-enabled=false'." | ||
fi | ||
|
||
if [[ "${container_engine:-}" == "moby" ]]; then | ||
echo "✅ Using dockerd container engine..." | ||
else | ||
echo "❗ Using incorrect container engine '${container_engine:-}' (expected moby). Switch to dockerd by running 'rdctl set --container-engine.name=moby'" | ||
return 1 | ||
fi | ||
|
||
if [[ "${admin_access:-}" == "true" ]]; then | ||
echo "✅ Admin access is configured to support networking." | ||
else | ||
echo "❗ Rancher Desktop needs admin access to configure networking. Run 'rdctl set --application.admin-access=true', then restart Rancher Desktop." | ||
exit 1 | ||
fi | ||
|
||
echo "Rancher configuration seems to be correct." | ||
echo "If you still need help, include the output above in your message to #infrastructure-support." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters