Skip to content

Commit

Permalink
Merge pull request #4110 from LiilyZhang/zhangl/Issue4108
Browse files Browse the repository at this point in the history
Issue #4108 - Feature Request: Fail on agent-install.sh f…
  • Loading branch information
LiilyZhang committed Jul 19, 2024
2 parents 6c3c898 + 2de617d commit 5ed9120
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions agent-install/agent-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,8 @@ function get_all_variables() {

# get other variables for cluster agent
get_variable EDGE_CLUSTER_STORAGE_CLASS 'gp2'
check_cluster_storage_class "$EDGE_CLUSTER_STORAGE_CLASS"

get_variable EDGE_CLUSTER_PVC_SIZE "$DEFAULT_PVC_SIZE"
get_variable AGENT_NAMESPACE "$DEFAULT_AGENT_NAMESPACE"
get_variable NAMESPACE_SCOPED 'false'
Expand Down Expand Up @@ -3307,6 +3309,18 @@ function get_cluster_image_arch() {
echo $image_arch
}

# check if the storage class exists in the edge cluster
function check_cluster_storage_class() {
log_debug "check_cluster_storage_class() begin"
local storage_class=$1
if $KUBECTL get storageclass ${storage_class} >/dev/null 2>&1; then
log_verbose "storage class $storage_class exists in the edge cluster"
else
log_fatal 2 "storage class $storage_class does not exist in the edge cluster"
fi
log_debug "check_cluster_storage_class() end"
}

# checks if OS/distribution/codename/arch is supported
function check_support() {
log_debug "check_support() begin"
Expand Down

0 comments on commit 5ed9120

Please sign in to comment.