Commit Graph

697 Commits

Author SHA1 Message Date
Brian Goff
4e399f93b1 Merge pull request #868 from cpuguy83/1.2_fix_missing_stats_route
Add GetStatsSummary to PodHandlerConfig
v1.2.2
2020-07-30 14:02:41 -07:00
Vilmos Nebehaj
c621acc8d2 Add GetStatsSummary to PodHandlerConfig
If both the metrics routes and the pod routes are attached to the same
mux with the pattern "/", it will panic. Instead, add the stats handler
function to PodHandlerConfig and set up the route if it is not nil.

(cherry picked from commit 56b248c854)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-07-30 10:25:34 -07:00
Brian Goff
e6e1dbed87 Merge pull request #794 from cpuguy83/cherry_picks_1.2.1
Cherry picks 1.2.1
v1.2.1
2019-11-15 15:19:11 -08:00
Thomas Hartland
eb9498cdde Add test for node ping interval
(cherry picked from commit 3783a39b26)
2019-11-15 14:31:04 -08:00
Thomas Hartland
df16317a89 After handling status update, reset update timer with correct duration
If the ping timer is being used, it should be reset with the ping update
interval. If the status update interval is used then Ping stops being
called for long enough to cause kubernetes to mark the node as NotReady.

(cherry picked from commit c258614d8f)
2019-11-15 14:30:54 -08:00
Brian Goff
7585e11542 [Sync Provider] Fix panic on not found pod status
(cherry picked from commit 6e33b0f084)
2019-11-15 14:30:22 -08:00
Brian Goff
ba940a9739 Merge pull request #786 from cpuguy83/add_sync_provider_support
Re-add support for sync providers
v1.2.0
2019-11-01 09:23:38 -07:00
Brian Goff
0ccf5059e4 Put sync lifecycle tests being -short flag.
This lets you skip tests for the slower sync provider.
2019-10-29 15:05:35 -07:00
Brian Goff
31c8fbaa41 Apply suggestions from code review
Typos and punctuation fixes.

Co-Authored-By: Pires <1752631+pires@users.noreply.github.com>
2019-10-24 09:23:33 -07:00
Brian Goff
4ee2c4d370 Re-add support for sync providers
This brings back support for sync providers by wrapping them in a
provider that handles async notifications.
2019-10-24 09:23:28 -07:00
Sargun Dhillon
c314045d60 Ensure that delete dangling pods which are still deleting at startup (#784)
If a pod is being gracefully deleted at podcontroller startup,
it will not get deleted via the deletedanglingpods code. This
ensures the normal deletion loop covers the case.
2019-10-22 06:45:36 -04:00
Brian Goff
d455bd16fc Merge pull request #760 from sargun/notify-pods-v7
Do not delete pods in a non-graceful manner
2019-10-18 11:21:31 -07:00
Sargun Dhillon
d22265e5f5 Do not delete pods in a non-graceful manner
This moves from forcefully deleting pods to deleting pods in a
graceful manner from the API Server. It waits for the pod to
get to a terminal status prior to deleting the pod from api
server.
2019-10-17 09:58:21 -07:00
Sargun Dhillon
871424368f Fix pod status updates for when pod is updated outside of VK
Pods can be updated outside of VK. Right now, if this happens, pod
status updates are dropped because the resourceversion from the
provider will mismatch with what's on the server, breaking
pod status updates.

Since we're the only ones writing to the pod status, we
can do a blind overwrite.
2019-10-11 16:32:48 -07:00
Sargun Dhillon
cdc261a08d Use go-cmp to compare pods to suppress duplicate updates
Rather than copying the pods, this uses go-cmp and filters out
the paths which should not be compared.
2019-10-10 13:25:27 -07:00
Brian Goff
d878af3262 Merge pull request #770 from sargun/remove-sync-providers
Remove sync providers
2019-10-07 11:02:22 -07:00
Sargun Dhillon
4202b03cda Remove sync provider support
This removes the legacy sync provider interface. All new providers
are expected to implement the async NotifyPods interface.

The legacy sync provider interface creates complexities around
how the deletion flow works, and the mixed sync and async APIs
block us from evolving functionality.

This collapses in the NotifyPods interface into the PodLifecycleHandler
interface.
2019-10-02 09:28:09 -07:00
Brian Goff
b3aa0f577b Merge pull request #776 from Uzuku/fix-log-format
Fix log format
2019-09-27 11:05:25 -07:00
Uzuku
f80f823e8b Fix log format
Correctly expand the log args
2019-09-28 01:54:46 +08:00
Brian Goff
1bd53c15d1 Merge pull request #774 from toshi0607/feature/fix-lint-warnings
fix lint warnings
2019-09-26 21:48:04 -07:00
Brian Goff
6f6b92ba57 Merge pull request #772 from sargun/add-linters
Add varcheck, deadcode, and mispell linters
2019-09-26 21:47:02 -07:00
toshi0607
bcfc2accf8 misspell 2019-09-26 20:52:06 +09:00
toshi0607
b712751c6d gofmt 2019-09-26 20:50:36 +09:00
Brian Goff
11321d5092 Merge pull request #771 from virtual-kubelet/rbitia-patch-1
Update ADOPTERS.md
2019-09-25 14:31:55 -07:00
Sargun Dhillon
e02c4d9e1e Add varcheck, deadcode, and mispell linters 2019-09-25 09:03:34 -07:00
Ria Bhatia
eda3e27c9f Update ADOPTERS.md
adding adopters
2019-09-25 08:59:01 -07:00
Ria Bhatia
e37a5cebca Update ADOPTERS.md
adding public end-users
2019-09-25 08:57:55 -07:00
Brian Goff
c0746372ad Merge pull request #769 from sargun/add-unused-linter
Add unused code linter
2019-09-24 22:13:39 -07:00
Sargun Dhillon
82a430ccf7 Add unused code linter 2019-09-24 12:55:52 -07:00
Ria Bhatia
8a5f4af171 readme updates (#766) 2019-09-19 11:33:47 -07:00
Brian Goff
9510b370cf Merge pull request #763 from sargun/wait-for-worker-shutdown-v2
Wait for Workers to exit prior to returning from PodController.Run
v1.1.0
2019-09-12 14:33:59 -07:00
Sargun Dhillon
ea8495c3a1 Wait for Workers to exit prior to returning from PodController.Run
This changes the behaviour slightly, so rather than immediately exiting on
context cancellation, this calls shutdown, and waits for the current
items to finish being worked on before returning to the user.
2019-09-12 11:04:32 -07:00
Brian Goff
334baa73cf Merge pull request #743 from chewong/pod-status-nil-pointer
Add unit tests for #584
2019-09-11 14:49:55 -07:00
Brian Goff
bb9ff1adf3 Adds Done() and Err() to pod controller (#735)
Allows callers to wait for pod controller exit in addition to readiness.
This means the caller does not have to deal handling errors from the pod
controller running in a gorutine since it can wait for exit via `Done()`
and check the error with `Err()`
2019-09-10 17:44:19 +01:00
Brian Goff
db146a0e01 Merge pull request #761 from sargun/cache-deps
Cache Downloaded Go Modules
2019-09-06 15:20:37 -07:00
Ernest Wong
fdb0c805f7 Add more unit test to #584 2019-09-05 10:48:35 -07:00
Ernest Wong
dc7ff44303 Add unit tests for #584 2019-09-05 09:49:41 -07:00
Sargun Dhillon
e7a36c3505 Cache Downloaded Go Modules
This caches the downloaded go modules. It invalidates them based on
a hash of the go.mod, and go.sum. The test step showed a reduction
from 1:30 -> 1:00, and the e2e tests from 8:30 to 5 minutes.
2019-09-05 09:23:13 -07:00
Ernest Wong
f10a16aed7 Importable End-To-End Test Suite (#758)
* 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
2019-09-04 22:25:43 +01:00
Sargun Dhillon
da57373abb Test pods going missing while they're running in legacy providers (#759)
We poll legacy providers for their pod(s) status periodically. This is because
we have no way of knowing when the pod is updated. If the pod somehow goes
missing in the provider, that state must be handled. Currently, we update
API server, and mark the pod as failed, or ignore it.
2019-09-04 22:16:14 +01:00
Sargun Dhillon
33df981904 Have NotifyPods store the pod status in a map (#751)
We introduce a map that can be used to store the pod status. In this,
we do not need to call GetPodStatus immediately after NotifyPods
is called. Instead, we stash the pod passed via notifypods
as in a map we can access later. In addition to this, for legacy
providers, the logic to merge the pod, and the pod status is
hoisted up to the loop.

It prevents leaks by deleting the entry in the map as soon
as the pod is deleted from k8s.
2019-09-04 20:14:34 +01:00
Brian Goff
ecf6e45bfc Merge pull request #755 from sargun/fix-golang-lint
Fix golang lint
2019-09-03 11:25:21 -07:00
Sargun Dhillon
3f85705461 Upgrade linter, and move away from incremental linting
Incremental linting doesn't seem to catch issues correctly. This
runs the linters in a more standard way.
2019-09-03 11:00:33 -07:00
Sargun Dhillon
7133a372d6 Mark current linting errors as non-errors
This is basically claiming linting bankruptcy. It marks all of the
issues we had up until this point as nolint.
2019-09-03 11:00:33 -07:00
Sargun Dhillon
5949e6279d Miscellaneous cleanup for linting 2019-09-03 11:00:33 -07:00
Sargun Dhillon
9cce8640a5 Fix linting errors in node/pod_test.go
This moves away from defining pods independently. It moves pod (spec)
generation to an independent function.
2019-09-03 11:00:33 -07:00
Sargun Dhillon
7accddcaf4 Fix linting errors in node/podcontroller.go 2019-09-03 11:00:33 -07:00
Ernest Wong
ee31118596 Update docs on virtual-kubelet.io (#754)
* Update website content

* Add PodLifecycleHandler
2019-09-03 10:52:23 -07:00
Brian Goff
2507f57f97 Merge pull request #732 from sargun/move-around-reactor
Move location of eventhandler registration
2019-09-03 10:44:52 -07:00
Sargun Dhillon
9a461a61ad Bump the Circle CI build job to an resource_class of xlarge (#722) 2019-09-02 07:11:11 +01:00