Commit Graph

1004 Commits

Author SHA1 Message Date
champly
50f1346977 fix staticcheck 2021-05-19 09:17:06 +08:00
champly
66fc9d476f fix staticcheck 2021-05-19 09:13:28 +08:00
Brian Goff
0543245668 lifecycle test: timeout send goroutine on context
In error cases these goroutines never exit.
Trying to debug cases we end up with a bunch of these goroutines stuck
making it difficult to troubleshoot.

We could just make a buffered channel, however this will makes it less
clear, in cases of an error, what all is happening.
2021-05-18 23:06:55 +00:00
Brian Goff
d245d9b8cf Merge branch 'master' into apa/add_liqo 2021-05-18 13:36:53 -07:00
Brian Goff
4fe8496dd1 Fix TestMapReference needed an ordered mapping
In 405d5d63b1 we changed for an ordered
list to a map, however the test is order dependent go maps are
randomized.

Change the test to use a slice with an internal type (instead of pulling
back in k8s.io/kubernetes).

Without this change this test will fail occasionally and has no
guarentee for success because of the random order of maps.
2021-05-18 19:07:46 +00:00
Brian Goff
5cd25230c5 Merge pull request #972 from cpuguy83/remove_kk
Remove remaining deps on k8s.io/kubernetes
2021-05-18 09:22:30 -07:00
Brian Goff
04cdec767b Remove remaining deps on k8s.io/kubernetes
These are mostly helper code for setting up env vars.  There is a single
file copied verbatim, although much of this downward api stuff is a
copy.  We may want to pull this out and do a direct copy of the the code
so it is easier to update and work with upstream to have a shared
package that lives outside of k8s.io/kubernetes for downward api.
2021-05-17 21:42:49 +00:00
champly
822dc8bb4a Merge branch 'master' into fix-jaeger-deprecated-config 2021-05-16 20:12:38 +08:00
Brian Goff
40b4425804 Merge pull request #811 from TBBle/patch-1
Fix non-linked reference to Providers in Usage
2021-05-14 11:01:37 -07:00
Brian Goff
be0a062aec Merge pull request #969 from cpuguy83/copy_metrics
Copy stats types from upstream.
2021-05-13 16:26:53 -07:00
Paul "Hampy" Hampson
a2515d859a Fix non-linked reference to Providers in Usage
Fixes a typo ("provides") and also replaces "listed above" with a link to the list. Which had moved below, as it happens.
2021-05-14 02:45:33 +10:00
champly
0df7ac4e80 fix jaeger deprecated config 2021-05-12 10:36:58 +08:00
Alex Palesandro
96eae1906b Adding Liqo to README.md 2021-05-07 22:58:46 +02:00
Brian Goff
8437e237be Copy stats types from upstream.
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>
2021-05-05 23:01:52 +00:00
Brian Goff
baa0e6e8fc Merge pull request #968 from cpuguy83/cleanup_some_kk
Don't import pod util package from k/k
2021-05-04 17:26:49 -07:00
Brian Goff
405d5d63b1 Don't import pod util package from k/k
These are all simple changes that will not change w/o breaking API
changes upstream anyway.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-05-04 23:55:30 +00:00
Brian Goff
e1486ade00 Merge pull request #966 from sargun/upgrade-k8s
Upgrade k8s to v19
2021-04-25 07:18:39 -07:00
Sargun Dhillon
4c223a8cd9 Upgrade to Kubernetes 19.10
Kubernetes 18.X is deprecated and no longer receiving updates.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2021-04-23 00:47:51 -07:00
Brian Goff
bf3a764409 Merge pull request #962 from sargun/expose-custom-retry 2021-04-15 15:35:34 -07:00
Sargun Dhillon
b259cb0548 Add the ability to dictate custom retries
Our current retry policy is naive and only does 20 retries. It is
also based off of the rate limiter. If the user is somewhat aggressive in
rate limiting, but they have a temporary outage on API server, they
may want to continue to delay.

In facts, K8s has a built-in function to suggest delays:
https://pkg.go.dev/k8s.io/apimachinery/pkg/api/errors#SuggestsClientDelay

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2021-04-14 10:52:26 -07:00
Sargun Dhillon
e95023b76e Fix test
This starts watching for events prior to the start of the controller.
This smells like a bug in the fakeclient bits, but it seems to fix
the problem.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2021-04-14 10:52:26 -07:00
Sargun Dhillon
5fd08d4619 Merge pull request #958 from sargun/fix-deletionQ
Remove errant double queue
2021-03-24 12:12:29 -07:00
Sargun Dhillon
c40a255eae Remove errant double queue
This seems to be a typo where we erroneously double-queue a deletion,
but one without the "key".
2021-03-24 10:21:27 -07:00
Sargun Dhillon
616538ef01 Merge pull request #955 from sargun/fix-pod-status-update
Fix pod status update
v1.5.0
2021-02-17 12:02:38 -08:00
Sargun Dhillon
c4582ccfbc Allow providers to update pod statuses
We had added an optimization that made it so we dedupe pod status updates
from the provider. This ignored two subfields that could be updated along
with status.

Because the details of subresource updating is a bit API server centric,
I wrote an envtest which checks for this behaviour.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
2021-02-16 12:30:53 -08:00
Sargun Dhillon
7feb175720 Split up lifecycle test wireUpSystem function
This splits up the wireUpSystem function into a chunk that makes it
"client agnostic". It also removes the requirement that the client
is faked.
2021-02-16 12:30:51 -08:00
Sargun Dhillon
0e1cc1566e Create envtest wrapper
Lift up a little bit of the common envtest code into a common wrapper function.
2021-02-16 12:30:51 -08:00
Pires
d11968a0fd Merge pull request #908 from cwdsuzhou/race_delete
Fix race between k8s and provider when deleting pod
2021-02-16 15:44:48 +00:00
wadecai
3ff1694252 Fix race between k8s and provider when deleting pod 2021-02-16 17:45:55 +08:00
Sargun Dhillon
53e96e03a9 Merge pull request #952 from sargun/add-tracking-info
Add Alternative Workqueue Implementation
2021-02-12 15:20:06 -08:00
Sargun Dhillon
3a361ebabd queue: Add tracing
This adds tracing throughout the queues, so we can determine what's going on.
2021-02-08 11:07:03 -08:00
Sargun Dhillon
ac9a1af564 Replace golang workqueue with our own
This is a fundamentally different API than that of the K8s workqueue
which is better suited for our needs. Specifically, we need a simple
queue which doesn't have complex features like delayed adds that
sit on "external" goroutines.

In addition, we need deep introspection into the operations of the
workqueue. Although you can get this on top of the K8s workqueue
by implementing a custom rate limiter, the problem is that
the underlying rate limiter's behaviour is still somewhat
opaque.

This basically has 100% code coverage.
2021-02-08 11:07:03 -08:00
Sargun Dhillon
fd3da8dcad Merge pull request #954 from feiskyer/clean-charts
clean-up charts
2021-02-07 23:49:54 -08:00
Pengfei Ni
731d0d6f5c clean-up charts 2021-02-08 13:18:00 +08:00
Sargun Dhillon
2ac4ff9b35 Merge pull request #953 from sargun/break-up-ratelimiters 2021-02-03 04:18:07 -08:00
Sargun Dhillon
82452a73a5 Split out rate limiter per workqueue
If you share a ratelimiter between workqueues, it breaks.

WQ1: Starts processing item (When)
WQ1: Fails to process item (When)
WQ1: Fails to process item (When)
WQ1: Fails to process item (When)
--- At this point we've backed off a bit ---
WQ2: Starts processing item (with same key, When)
WQ2: Succeeds at processing item (Forget)
WQ1: Fails to process item (When) ---> THIS RESULTS IN AN ERROR

This results in an error because it "forgot" the previous
rate limit.
2021-02-02 11:40:58 -08:00
Brian Goff
2fa03a15a2 Merge pull request #951 from Jeffwan/update_email_list
Update mailing list link
2021-01-29 09:25:39 -08:00
Jiaxin Shan
eb7553e6c4 Update mailing list link 2021-01-26 16:21:41 -08:00
Brian Goff
3cfd4737dc Merge pull request #949 from pires/bugfix/klogv2_withfields
log: fix klogv2.WithField(s)
v1.4.0
2021-01-20 09:44:10 -08:00
Pires
346c20c005 log: fix klogv2.WithField(s)
Signed-off-by: Pires <pjpires@gmail.com>
2021-01-20 13:53:23 +00:00
Pires
fa139bfe27 Merge pull request #947 from pires/bugfix/klogv2
log: fix klog depth and output format
2021-01-15 19:00:34 +00:00
Pires
cb0e18e6a1 log: refactor klogv2 tests
Signed-off-by: Pires <pjpires@gmail.com>
2021-01-15 18:47:50 +00:00
Brian Goff
379031eb61 Merge pull request #945 from miekg/no-kube2 2021-01-15 10:23:35 -08:00
Pires
25b8c546a0 log: process fields only on first klog call
Signed-off-by: Pires <pjpires@gmail.com>
2021-01-15 18:23:32 +00:00
Miek Gieben
53fcbe7abe Merge branch 'master' into no-kube2 2021-01-15 09:42:44 +01:00
Miek Gieben
7662a48922 Skip internal/kubenernetes from linting
Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-15 09:25:17 +01:00
Pires
46bfb01cd4 log: fix klogv2 With* funcs
Signed-off-by: Pires <pjpires@gmail.com>
2021-01-14 21:07:04 +00:00
Pires
c2b4863f40 log: fix klog depth
Signed-off-by: Pires <pjpires@gmail.com>
2021-01-14 20:23:46 +00:00
Brian Goff
5edfe23bd5 Merge pull request #944 from miekg/no-kubernetes 2021-01-13 15:48:33 -08:00
Miek Gieben
c9969ee33d Import kubernetes/remotecommand
Copy/paste some more kubernetes code. This is to remove the dep on
kubernetes/kubernetes from within exec.go

See #940

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-01-12 13:18:30 +01:00