Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to check if bin folder exists #63

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions enabler/commands/cmd_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def init(ctx, kube_context_cli):
kind_url = urls["kind"].format(ostype)
skaffold_url = urls["skaffold"].format(ostype)

# Check if bin folder exists
check_bin_folder()

with click_spinner.spinner():
# Download kubectl and make executable
kubectl_location = shutil.which('kubectl')
Expand Down Expand Up @@ -214,7 +217,7 @@ def metallb(ctx, kube_context_cli, kube_context, ip_addresspool, version):
yaml_file.write(updated_yaml)

elif int(version.split('.')[0]) >= 4:
yaml_file_path = 'enabler/metallb-crd.yaml'
yaml_file_path = 'metallb-crd.yaml'
with open(yaml_file_path, 'r') as yaml_file:
config = list(yaml.safe_load_all(yaml_file))

Expand Down Expand Up @@ -358,6 +361,15 @@ def istio(ctx, kube_context_cli, kube_context, monitoring_tools):

def get_path():
enabler_path = os.getcwd()
logger.info("------")
logger.info(enabler_path)
return enabler_path


def check_bin_folder():
enabler_path = os.getcwd()
full_path = enabler_path + '/bin'
if not os.path.exists(full_path):
logger.info("Creating bin folder...")
os.makedirs(full_path)
else:
logger.info("Bin folder already exists. Continue...")
pass
2 changes: 1 addition & 1 deletion enabler/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kubectl: "https://storage.googleapis.com/kubernetes-release/release/v1.17.3/bin/{}/amd64/kubectl" # noqa
helm: "https://get.helm.sh/helm-v3.1.2-{}-amd64.tar.gz" # noqa
istioctl: "https://github.com/istio/istio/releases/download/1.5.1/istioctl-1.5.1-{}.tar.gz" # noqa
kind: "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-{}-amd64" # noqa
kind: "https://github.com/kubernetes-sigs/kind/releases/download/v0.22.0/kind-{}-amd64" # noqa
skaffold: "https://storage.googleapis.com/skaffold/releases/latest/skaffold-{}-amd64" # noqa
Loading