Commit Graph

725 Commits

Author SHA1 Message Date
Sargun Dhillon
65c5446c94 Set timeout for tests on CI to 9 minutes
Right now, if the tests get stuck (on CI), they are terminated
after 10 minutes. This means as well that we get 0 output about
what went wrong.

Instead, this triggers a panic after 9 minutes on CI.
2019-08-12 13:45:30 -07:00
Brian Goff
cafcdeeefa Merge pull request #723 from sargun/lifecycle-test-fixes
Array of minor fixups to lifecycle tests
2019-08-12 13:22:51 -07:00
Sargun Dhillon
5c2b682cdc Array of minor fixups to lifecycle tests
* Fix the deletion test to actually test the pod is deleted
 * Fix the update pods test to update a value which is allowed
   to be updated
 * Shut down watches after tests
 * Do not delete pod statuses on DeletePod in mock_test

This intentionally leaks pod statuses, but it makes the situation
a lot less complicated around handling race conditions with
the GetPodStatus callback
2019-08-12 12:10:29 -07:00
Sargun Dhillon
e1c3bc3151 Merge pull request #725 from sargun/fix-race-conditions-in-node-test
Fix race conditions in node_test
2019-08-12 11:43:06 -07:00
Sargun Dhillon
5ac33e4b0a Fix race conditions in node_test 2019-08-12 11:33:48 -07:00
Sargun Dhillon
42656aae2f Merge pull request #719 from ethan-daocloud/patch-1
cleanup: fix misspelled words in error message
2019-08-12 11:09:35 -07:00
Brian Goff
10b291dba1 Merge branch 'master' into patch-1 2019-08-12 10:48:15 -07:00
Brian Goff
9d90c599e7 Merge pull request #721 from sargun/fix-race-condition
Fix race condition around worker ID generation in podcontroller.go
2019-08-12 10:43:32 -07:00
Sargun Dhillon
82de7f02c4 Upgrade Kubernetes e2e test cluster to 1.15.2 2019-08-12 10:30:04 -07:00
Sargun Dhillon
ad6cd7d552 Upgrade K8s
* Upgrade k8s.io/api
   go get k8s.io/api@kubernetes-1.15.2
 * Upgrade k8s.io/apimachinery
   go get k8s.io/apimachinery@kubernetes-1.15.2
 * Upgrade kubernetes-1.15.2
   go get k8s.io/client-go@kubernetes-1.15.2
 * Upgrade kk8s.io/kubernetes to v1.15.2
   go get k8s.io/kubernetes@v1.15.2

This also locks the the dependency for
github.com/prometheus/client_golang/prometheus due to a golang bug, and to
please the validation scripts.

The replaces were generated by:
go get k8s.io/kubernetes@v1.15.2 2> fail
for i in $(cat fail|grep unknown|cut -f1 -d@|cut -f2 -d" ")
  do echo "replace ${i} => ${i} kubernetes-1.15.2"
done
2019-08-12 10:29:19 -07:00
Sargun Dhillon
a28969355e Fix race condition around worker ID generation in podcontroller.go 2019-08-12 10:27:21 -07:00
ethan
75a1877d9f cleanup: fix misspelled words in error message
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-10 19:03:44 +08:00
Sargun Dhillon
a87af0818f Merge pull request #708 from sargun/better-docs
Add a little bit of documentation to NotifyPods
2019-08-08 03:10:15 -07:00
Sargun Dhillon
3efc9229ba Add a little bit of documentation to NotifyPods
As far as I can tell, based on the implementation in MockProvider
NotifyPods is called with the mutated pod. This allows us to
take a copy of the Pod object in NotifyPods, and make it so
(eventually) we don't need to do a callback to GetPodStatus.
2019-08-06 20:20:59 -07:00
choury
d0c91a1933 Fix log.Infof in mock (#714) 2019-08-05 20:30:59 +01:00
Sakura
7188238caa fix a to an in annotation (#715) 2019-08-05 20:13:40 +01:00
Brian Goff
9a7698b09f Merge pull request #706 from virtual-kubelet/better-test
Add a test which tests the e2e lifecycle of the pod controller
2019-07-31 11:05:29 -07:00
Sargun Dhillon
50bbc3d1d4 Add tests around updates
This makes sure the update function works correctly after the pod
is running if the podspec is changed. Upon writing the test, I realized
we were accessing the variables outside of the goroutine that the
workers with tests were running in, and we had no locks. Therefore,
I converted all of those numbers to use atomics.
2019-07-30 09:13:43 -07:00
Sargun Dhillon
bd8e39e3f9 Add a benchmark for pod creation
This adds a benchmark for pod creation and makes the mock_test
provider actually work correctly in concurrent situations.
2019-07-30 09:12:56 -07:00
Sargun Dhillon
ce38d72c0e Add additional lifecycle tests
* Don't scheduled failed, or succeeded pods
 * Delete dangling pods
2019-07-30 06:56:54 -07:00
Sargun Dhillon
4a270fea08 Add a test which tests the e2e lifecycle of the pod controller
This uses the mock provider, so I moved the mock provider to a
location where the node test can use it.
2019-07-30 06:56:54 -07:00
Sargun Dhillon
2974de3961 Merge pull request #711 from sargun/avoid-startup-race
Setup event handler at Pod Controller creation time
2019-07-29 09:37:28 -07:00
Sargun Dhillon
4d60fc2049 Setup event handler at Pod Controller creation time
This seems to avoid a race conditions where at pod informer
startup time, the reactor doesn't properly get setup.

It also refactors the root command example to start up
the informers after everything is wired up.
2019-07-26 13:57:00 -07:00
Brian Goff
28dac027ce Merge pull request #700 from cpuguy83/jaeger_exporter_import
Update jaeger exporter import path
2019-07-24 08:44:58 -07:00
Brian Goff
732c0a82d6 Merge branch 'master' into jaeger_exporter_import 2019-07-23 11:15:42 -07:00
Brian Goff
b056ac08bb Merge pull request #705 from virtual-kubelet/fix-new-pod-controller
Make NewPodController function validate that provider is set
2019-07-23 11:15:01 -07:00
Sargun Dhillon
ce60fb81d4 Make NewPodController function validate that provider is set
In NewPodController we validate that the rest of the config is
set to non-nil values. The provider must be non-nil as well.
2019-07-21 16:19:00 -07:00
Brian Goff
46591ad811 Merge pull request #703 from zhuangqh/fix-typo
fix several typo
2019-07-19 07:15:07 -07:00
jerryzhuang
0ba0200067 fix several typo
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
2019-07-17 10:36:17 +08:00
Brian Goff
29d2bd251d Merge branch 'master' into jaeger_exporter_import 2019-07-09 11:39:39 -07:00
Brian Goff
d3ff785e08 Add godoc to the repo root. (#702) v1.0.0 2019-07-05 22:42:56 +01:00
Brian Goff
8493cbb42a Unexport node update helper functions (#701)
Thinking these maybe should either not be exposed or in a separate
package.
For 1.0 let's unexport them and we may re-introduce later.
2019-07-05 19:24:46 +01:00
Brian Goff
e7e692bcb6 Update jaeger exporter import path 2019-07-05 10:22:32 -07:00
Brian Goff
7bd0bd0f0e Merge pull request #699 from virtual-kubelet/pires/cleanup_after_e2e
e2e: cleanup after run
2019-07-05 09:57:45 -07:00
Pires
10126924f9 e2e: cleanup after run
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-04 18:22:52 +01:00
Brian Goff
afaae4454f Update README.md to account for recent changes (#698)
This is preparing for 1.0
2019-07-04 17:06:45 +01:00
Brian Goff
f7fee27790 Move CLI related packages into internal (#697)
We don't want people to import these packages, so move these out into
private packages.
2019-07-04 10:14:38 +01:00
Brian Goff
327c6cf319 skaffold target requires .SECONDEXPANSION (#696)
Otherwise the variable is evaluated before it's even set (assuming it's
not set from the CLI).

skaffold also requires bin/e2e/virtual-kubelet to work on it's own.
2019-07-03 21:00:51 +01:00
Brian Goff
1c4aa5d575 Merge pull request #695 from virtual-kubelet/pires/revisit_e2e
e2e: misc improvements
2019-07-03 11:18:40 -07:00
Pires
ab3086436e e2e: silence kubectl context validation
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:16 +01:00
Pires
ad943ebbd8 e2e: remove unnecessary steps
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:16 +01:00
Pires
3371c727a6 e2e: bump Go to v1.12.6
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:15 +01:00
Pires
1bab3ea80f e2e: bump Minikube to v1.2.0
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:15 +01:00
Pires
3a88dfd413 e2e: use Kubernetes v1.13.7 in CI
I failed to do this as part of #683.

Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:14 +01:00
Pires
5854904f0d skaffold: bump to 0.33.0 and API v1beta12
Signed-off-by: Pires <pjpires@gmail.com>
2019-07-03 14:27:13 +01:00
Brian Goff
905709c646 Don't ignore all GetPod errors on deletePod (#691)
A legit error could be passed here and we don't want to ignore it.
2019-07-03 09:31:44 +01:00
Brian Goff
3840bc2666 Remove vendor/ (#688)
Vendoring seems to be problematic with go modules.
In addition to causing issues with transitive dependencies and being
problematic when trying to pull in the node-cli code, it also seems to
be pulling different versions than what is computed in go.mod.
This can be seen by comparing commits from the computed version in
go.mod with very small diffs (like a single Godep change in k8s) but massive
vendoring changes.

Basically I have very little confidence that this is even working.
This should be better in go1.13, but this is not released yet.
v0.11.1
2019-07-02 18:04:40 +01:00
Brian Goff
b915cde1ae Fix error handling for delete pod (#685)
* Fix error handling for delete pod

- Error handling was looking for a k8s error from the provider, but
  providers should be using errdefs.
- Error handling was returning early if pod was not found and deleting
  from k8s in all other cases.

* Don't run unit tests twice
v0.11.0
2019-06-29 08:07:24 +01:00
Brian Goff
07379f7b1f Merge pull request #683 from virtual-kubelet/pires/k8s_version_bump
version: ensure Kubernetes v1.13.7
2019-06-27 08:41:52 -07:00
Brian Goff
7d84d93199 Merge pull request #682 from grahamhayes/fix-readme-links
Update README links to providers READMEs
2019-06-27 06:42:16 -07:00