This drops another dependency on k8s.io/kubernetes.
This does have the unfortunate side effect that implementers will now
get a compile error until they update their code to use the new type.
Just as a note:
The stats types have moved to k8s.io/kubelet, however the stats types
are only there as of v1.20.
Currently we support older versions than v1.20, and even our go.mod
imports from v1.19.
For now we copy the types in. Later we can remove the type defs and
change them to type aliases to the k8s.io/kubelet types (which prevents
another compile time issue).
Anything relying on type assertions to determine if something implements
this method will, unfortunately, be broken and it will be hard to notice
until runtime. We need to make sure to call this out in the release
notes.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This creates a new package -- podutils. The env var related code
doesn't really have any business being part of the node package,
and to create a separation of concerns, faster tests, and just
general code isolation and cleanliness, we can move the env
var related code into this package. This change is purely hygiene,
and not logic related.
For node, the package is under internal, because the constructor
references manager, which is an internal package.
This allows the use of a built-in provider to do things like mark a node
as ready once all the controllers are spun up.
The e2e tests now use this instead of waiting on the pod that the vk
provider is deployed in to be marked ready (this was waiting on
/stats/summary to be serving, which is racey).
* Rename VK to chewong for development purpose
* Rename basic_test.go to basic.go
* Add e2e.go and suite.go
* Disable tests in node.go
* End to end tests are now importable as a testing suite
* Remove 'test' from test files
* Add documentations
* Rename chewong back to virtual-kubelet
* Change 'Testing Suite' to 'Test Suite'
* Add the ability to skip certain testss
* Add unit tests for suite.go
* Add README.md for importable e2e test suite
* VK implementation has to be based on VK v1.0.0
* Stricter checks on validating test functions
* Move certain files back to internal folder
* Add WatchTimeout as a config field
* Add slight modifications
This moves the logic for re-creating the a missing node up into the CLI.
We can make this optional, but for now I've just preserved existing
functionality.
* Use the VKUBELET API for fetching the pods during testing, which
makes it easier to run testing without wiring up an entire cluster
* Runningpods does not require each provider to implement the
optional stats interface for testing.
For some reason the kubelet tries to do things that it gets perm
denied. This changes the base.yml in the skaffold file to have
the permissions. In turn, this broke the node deletion test. So,
instead of looking for the deletion event (imperative), we wait
for the node UID to change (declarative).
We're in effect testing the K8s scheduler logic in the test
by setting taints, as opposed to the actual VK itself. If we
want to make sure the taint is set, we can just observe the node
object.
Instead, bind to the pod to the VK node explicitly.
node.ResourceVersion must not be set when creating a node.
This issue prevents vk from resolving issues after the vk node instance
has been deleted (for whatever reason).
* vendor: add vendored code
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* controller: use shared informers and a work queue
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* errors: use cpuguy83/strongerrors
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* aci: fix test that uses resource manager
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* readme: clarify skaffold run before e2e
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* cmd: use root context everywhere
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: refactor pod lifecycle management
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* e2e: fix race in test when observing deletions
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* e2e: test pod forced deletion
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* cmd: fix root context potential leak
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: rename metaKey
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: remove calls to HandleError
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* Revert "errors: use cpuguy83/strongerrors"
This reverts commit f031fc6d.
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* manager: remove redundant lister constraint
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: rename the pod event recorder
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: amend misleading comment
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* mock: add tracing
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: add tracing
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* test: observe timeouts
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* trace: remove unnecessary comments
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: limit concurrency in deleteDanglingPods
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: never store context, always pass in calls
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: remove HandleCrash and just panic
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: don't sync succeeded pods
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* sync: ensure pod deletion from kubernetes
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* mock: implement GetStatsSummary
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* make: use skaffold to deploy vk
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* test: add an e2e test suite
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* test: add vendored code
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* docs: update README.md
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* ci: run e2e on circleci
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* make: improve the skaffold target
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* e2e: fix defer pod deletion
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* e2e: improve instructions
Signed-off-by: Paulo Pires <pjpires@gmail.com>
* makefile: default shell is bash
Signed-off-by: Paulo Pires <pjpires@gmail.com>