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 flag to set kubectl binary location #138

Merged
merged 2 commits into from
Jan 5, 2021
Merged

Add flag to set kubectl binary location #138

merged 2 commits into from
Jan 5, 2021

Conversation

jacobwoffenden
Copy link
Contributor

Fixes #137

@jacobwoffenden
Copy link
Contributor Author

Testing Implementation

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# make
--> Installing build dependencies
make dep-install
make[1]: Entering directory '/go/src/github.com/UKHomeOffice/kd'
--> Retrieving dependencies
make[1]: Leaving directory '/go/src/github.com/UKHomeOffice/kd'
--> Compiling the project
mkdir -p bin
go build -ldflags "-X main.Version=v1.17.0-1-gff754a0" -o bin/kd ./...

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# ./bin/kd --file test/deployment.yaml 
[INFO] 2020/12/15 18:22:45 main.go:645: deploying deployment/nginx-deployment
[ERROR] 2020/12/15 18:22:45 main.go:264: exec: "kubectl": executable file not found in $PATH

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 38.3M  100 38.3M    0     0  2992k      0  0:00:13  0:00:13 --:--:-- 2831k

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# chmod +x kubectl 

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# mv kubectl /tmp/kubectl

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# ./bin/kd --kubectl-binary /tmp/kubectl --file test/deployment.yaml 
[INFO] 2020/12/15 18:24:42 main.go:645: deploying deployment/nginx-deployment
[ERROR] 2020/12/15 18:24:42 main.go:264: The connection to the server localhost:8080 was refused - did you specify the right host or port?

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# export KUBE_BINARY=/tmp/kubectl 

root@e97ec0260b1f:/go/src/github.com/UKHomeOffice/kd# ./bin/kd --file test/deployment.yaml 
[INFO] 2020/12/15 18:25:07 main.go:645: deploying deployment/nginx-deployment
[ERROR] 2020/12/15 18:25:07 main.go:264: The connection to the server localhost:8080 was refused - did you specify the right host or port?

Copy link
Contributor

@KashifSaadat KashifSaadat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@KashifSaadat KashifSaadat merged commit 14fba0b into UKHomeOffice:master Jan 5, 2021
@jacobwoffenden jacobwoffenden deleted the add-binary-location-flag branch January 5, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Setting of kubectl location
2 participants