vmware-archive / buildkit-cli-for-kubectl

BuildKit CLI for kubectl is a tool for building container images with your Kubernetes cluster
Other
499 stars 41 forks source link

feat: Allow to add environment variable on builder instance #98

Closed disaster37 closed 2 years ago

disaster37 commented 2 years ago

Signed-off-by: disaster37 linuxworkgroup@hotmail.com

Fix #54.

This PR allow to add environment variable when create new builder instance. For exemple:

kubectl builder create --env "http_proxy=http://my-proxy:8080" --env "https_proxy=https://my-proxy:8080"

More over, if you run kubectl build before create builder, it will check if http_proxy, https_proxy, no_proxy, HTTP_PROXY, HTTPS_PROXY and NO_PROXY are set on current shell. And then pass them on builder factory...

vmwclabot commented 2 years ago

@disaster37, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 2 years ago

@disaster37, your company's legal contact has approved your signed contributor license agreement. It will also be reviewed by VMware, but the merge can proceed.

vmwclabot commented 2 years ago

@disaster37, VMware has approved your signed contributor license agreement.

codecov-commenter commented 2 years ago

Codecov Report

Merging #98 (d796462) into main (2abb51e) will decrease coverage by 53.67%. The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #98       +/-   ##
==========================================
- Coverage   62.70%   9.03%   -53.68%     
==========================================
  Files          39      39               
  Lines        2644    2667       +23     
==========================================
- Hits         1658     241     -1417     
- Misses        792    2399     +1607     
+ Partials      194      27      -167     
Flag Coverage Δ
integration-tests ?
unit-tests 9.03% <16.66%> (+0.07%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/cmd/build.go 0.00% <0.00%> (-66.94%) :arrow_down:
pkg/cmd/create.go 0.00% <0.00%> (-78.13%) :arrow_down:
pkg/driver/kubernetes/factory.go 1.98% <0.00%> (-68.57%) :arrow_down:
pkg/driver/kubernetes/manifest/manifest.go 28.29% <80.00%> (-68.55%) :arrow_down:
pkg/cmd/root.go 0.00% <0.00%> (-100.00%) :arrow_down:
pkg/progress/progress.go 0.00% <0.00%> (-100.00%) :arrow_down:
integration/common/runners.go 0.00% <0.00%> (-100.00%) :arrow_down:
integration/common/basesuites.go 0.00% <0.00%> (-91.18%) :arrow_down:
pkg/driver/kubernetes/execconn/execconn.go 0.00% <0.00%> (-90.91%) :arrow_down:
pkg/progress/reset.go 0.00% <0.00%> (-90.33%) :arrow_down:
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2abb51e...d796462. Read the comment docs.

dhiltgen commented 2 years ago

I just approved running the github action CI. The lint error looks legitimate - can you adjust that code to keep the linter happy?

  Running [/home/runner/golangci-lint-1.29.0-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
  Error: File is not `goimports`-ed (goimports)
  Error: S1019: should use make([]string, 0) instead (gosimple)

  Error: issues found
  Ran golangci-lint in 87190ms

The two integration tests look more like unrelated CI problems - I'll investigate those in another PR so for now you can ignore them.

disaster37 commented 2 years ago

Lint issue is fixed and I have adapated the code like you say.

dhiltgen commented 2 years ago

Sorry for the lag again - took a while to figure out the CI failures, but I think I have those sorted, so we can merge this one now.

disaster37 commented 2 years ago

Can you create new release that include this PR please ?

dhiltgen commented 2 years ago

We've got one other PR we want to land, then we'll cut a release.

Thanks for the contribution!