Skip to content
This repository was archived by the owner on Nov 8, 2026. It is now read-only.

Add flag to set kubectl binary location - #138

Merged
KashifSaadat merged 2 commits into
UKHomeOffice:masterfrom
jacobwoffenden:add-binary-location-flag
Jan 5, 2021
Merged

KashifSaadat merged 2 commits into
UKHomeOffice:masterfrom
jacobwoffenden:add-binary-location-flag

Conversation

@jacobwoffenden

Copy link
Copy Markdown

Fixes #137

@jacobwoffenden

Copy link
Copy Markdown
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?

@KashifSaadat KashifSaadat left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Setting of kubectl location

2 participants

⌂ 换网址