Pass context.Context as functions parameter instead of storing the context in the struct.

Values of the context.Context type carry security credentials, tracing information, deadlines, and cancellation signals across API and process boundaries. Unlike C++ and Java, which in the Google codebase use thread-local storage, Go programs pass contexts explicitly along the entire function call chain from incoming RPCs and HTTP requests to outgoing requests.

BUG=b/308853611
TEST=test GPU driver installation with this docker container in vm

Change-Id: Ifd02e45ee5d6f53d7634de84cac6c9d46868d0f5
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/62224
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Tested-by: Shuo Yang <gshuoy@google.com>
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
12 files changed
tree: 95b21d8be6b92bd7df90e23e1eb8a70ef3e55409
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. .gitignore
  6. BUILD.bazel
  7. cloudbuild.yaml
  8. CONTRIBUTING.md
  9. deps.bzl
  10. go.mod
  11. go.sum
  12. LICENSE
  13. postsubmit-cloudbuild.yaml
  14. README.md
  15. run_tests.sh
  16. run_unit_tests.sh
  17. WORKSPACE
README.md

Tools for Container-Optimized OS

This is a repository of various tools developed for Container-Optimized OS. Examples include cos-gpu-installer, cos-toolbox, etc.

See CONTRIBUTING.md for how to contribute.