Skip to content

Commit

Permalink
all kubectl commands will run with the default namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Obliviour committed Nov 22, 2023
1 parent f271045 commit 7281267
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def set_cluster_command(args) -> int:
command = (
'gcloud container clusters get-credentials'
f' {args.cluster} --region={zone_to_region(args.zone)} --project={args.project} &&'
' kubectl config view'
' kubectl config view && kubectl config set-context --current --namespace=default'
)
return_code = run_command_with_updates(
command, 'Set Cluster', args, verbose=False
Expand Down Expand Up @@ -1558,7 +1558,7 @@ def workload_create(args) -> int:
docker_image=docker_image,
command=command)
tmp = write_temporary_file(yml_string)
command = f'kubectl apply -f {str(tmp.file.name)} --namespace=default'
command = f'kubectl apply -f {str(tmp.file.name)}'

return_code = run_command_with_updates(command, 'Creating Workload', args)

Expand Down Expand Up @@ -1591,7 +1591,7 @@ def workload_delete(args) -> int:

yml_string = workload_delete_yaml.format(args=args)
tmp = write_temporary_file(yml_string)
command = f'kubectl delete -f {str(tmp.file.name)} --namespace=default'
command = f'kubectl delete -f {str(tmp.file.name)}'
return_code = run_command_with_updates(command, 'Delete Workload', args)

if return_code != 0:
Expand Down

0 comments on commit 7281267

Please sign in to comment.