Commit Graph

173 Commits (13b12e89408869c5b560a81e95bca33267bdb8e1)

Author SHA1 Message Date
Jordan Liggitt a371f3ba8e
Track run status explicitly rather than non-nil check on stopCh 2018-01-17 11:04:55 -05:00
Kubernetes Submit Queue 23c87f0ca7
Merge pull request #55218 from chentao1596/optimize-error-nomatchkind
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Print apiVersion info when failed to execute kubectl apply -f XXX.yaml

**What this PR does / why we need it**:

Fixes https://github.com/kubernetes/kubernetes/issues/55216

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-01-04 20:43:20 -08:00
chentao1596 42bd794654 fix-bug: version info should be printed when failed to execute 'kubectl apply -f XXXXX' 2018-01-05 09:49:02 +08:00
Kubernetes Submit Queue ff58401257
Merge pull request #57503 from liggitt/gc-virtual-node-fix
Automatic merge from submit-queue (batch tested with PRs 57735, 57503). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure virtual nodes aren't stranded in GC graph

Fixes #56121

See https://github.com/kubernetes/kubernetes/issues/56121#issuecomment-353265160 for details on the sequence of events that can lead to virtual nodes getting stranded in the graph

```release-note
Fixed garbage collection hang
```

(a branch with a commit that reliably triggers the cascading deletion test failure is at https://github.com/liggitt/kubernetes/commits/gc-debug-cascading... it's not easily made into a permanent test case because it only works when that test is run in isolation, and requires plumbing test hooks deep into the watch cache layer)
2018-01-02 07:51:30 -08:00
Christoph Blecker 80e344644e
Regenerate all generated code 2018-01-02 00:21:07 -08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Jordan Liggitt df60789a7e
Requeue unobserved nodes in attemptToDelete 2017-12-21 14:00:07 -05:00
Jordan Liggitt a7c7da76d5
Ensure dependents are added to virtual node before attemptToDelete 2017-12-21 02:57:47 -05:00
Kubernetes Submit Queue f588bb02f3
Merge pull request #56150 from php-coder/fix_format_string
Automatic merge from submit-queue (batch tested with PRs 57211, 56150, 56368, 56271, 55957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

pkg/controller/garbagecollector/garbagecollector.go: fix string format

**What this PR does / why we need it**:
This PR fixes broken formatting in the warning message by using appropriate function:
> W1121 13:13:39.359283   19160 garbagecollector.go:601] failed to discover preferred resources: %vGet https://127.0.0.1:37983/api: dial tcp 127.0.0.1:37983: getsockopt: connection refused

**Special notes for your reviewer**:
This change was introduced in #55259

**Release note**:
```release-note
NONE
```

PTAL @ironcladlou 
CC @simo5
2017-12-15 14:00:41 -08:00
Jordan Liggitt 34c3a254d8
Process cluster-scoped owners correctly 2017-12-14 22:53:59 -05:00
Dan Mace a62d07ce2a Add a GC deadlock note 2017-11-27 16:50:29 -05:00
Dan Mace eeeabce831 Add more GC sync logging 2017-11-27 16:47:37 -05:00
Dan Mace 9b2886df29 Ensure sync failures are correctly retried
Only track the last synced resources when all preceding steps have
completed to ensure that failures will be correctly retried.
2017-11-27 16:29:18 -05:00
Dan Mace d89f58fcc8 Fix GC sync race condition
Remove faulty diff detection logic from GC sync which leads to a race
condition: If the GC's discovery client is returning a fully up to date
view of server resources during the very first GC sync, the sync
function will never sync monitors or reset the REST mapper unless
discovery changes again. This causes REST mapping to fail for any custom
types already present in discovery.
2017-11-27 16:11:47 -05:00
David Eads 19578eb1a1 log errors while trying to GC resources 2017-11-22 10:40:03 -05:00
Slava Semushin 2b86881ab3 pkg/controller/garbagecollector/garbagecollector.go: fix string format. 2017-11-21 15:24:34 +01:00
Kubernetes Submit Queue 69098ad7b3
Merge pull request #55653 from hzxuzhonghu/test-flaky
Automatic merge from submit-queue (batch tested with PRs 55908, 55829, 55293, 55653, 55665). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[bug fix] TestCascadingDeletion during pull-kubernetes-unit-test flaky

**What this PR does / why we need it**:
fix pull-kubernetes-unit-test flaky.

```
go test -v k8s.io/kubernetes/test/integration/garbagecollector -run TestCascadingDeletion$
panic: close of closed channel
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:58 +0x111
/usr/local/go/src/runtime/panic.go:491 +0x283
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/garbagecollector/graph_builder.go:259 +0xb80
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/garbagecollector/garbagecollector.go:123 +0x39
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/garbagecollector/garbagecollector.go:211 +0x20f
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x5e
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134 +0xbd
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88 +0x4d
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/controller/garbagecollector/garbagecollector.go:172 +0xd9
/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/integration/garbagecollector/garbage_collector_test.go:268 +0xc9
				from junit_3a3d564eebb1750e5c904cc525d117617fc0af51_20171113-090812.xml
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55652

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-17 17:11:13 -08:00
hzxuzhonghu fbf81bc7ad fix underlying bug: double close channel when stop 2017-11-17 10:35:03 +08:00
Jordan Liggitt dbfc43f723
Only attempt to construct GC informers for watchable resources 2017-11-15 02:26:58 -05:00
Dr. Stefan Schimanski 1e79dfb959 Update generated code 2017-11-10 18:26:46 +01:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Dan Mace c3dd82c30c Tolerate partial discovery in garbage collector
Allow the garbage collector to tolerate partial discovery failures. On a
partial failure, use whatever was discovered, log the failures, and
allow the resync logic to try again later.

Fixes #55022.
2017-11-07 16:54:49 -05:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jordan Liggitt a0f8a36e48
Remove GC rate limiter metrics 2017-09-21 19:23:27 -04:00
Clayton Coleman 8b571bb63b
Disable default paging in list watches
For 1.8 this will be off by default. In 1.9 it will be on by default.
Add tests and rename some fields to use the `chunking` terminology.

Note that the pager may be used for other things besides chunking.
2017-09-06 23:10:59 -04:00
Kubernetes Submit Queue 35ffb5c6cf Merge pull request #48921 from smarterclayton/paging_prototype
Automatic merge from submit-queue (batch tested with PRs 50832, 51119, 51636, 48921, 51712)

Alpha list paging implementation

Design in kubernetes/community#896

Support `?limit=NUMBER`, `?continue=CONTINUATIONTOKEN`, and a `continue` field
on ListMeta and pass through to etcd. Perform minor validation as an example.

```
# first out of three
$ curl http://127.0.0.1:8080/api/v1/namespaces?limit=1
{
  "kind": "NamespaceList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces",
    "resourceVersion": "146",
    "next": "ZGVmYXVsdA"
  },
  "items": [
    {
      "metadata": {
        "name": "default",
        "selfLink": "/api/v1/namespaces/default",
        "uid": "f95e1390-6852-11e7-ab03-7831c1b76042",
        "resourceVersion": "4",
        "creationTimestamp": "2017-07-14T05:12:03Z"
      },
      "spec": {
        "finalizers": [
          "kubernetes"
        ]
      },
      "status": {
        "phase": "Active"
      }
    }
  ]
}
...
# last
$ curl "http://127.0.0.1:8080/api/v1/namespaces?limit=1&continue=a3ViZS1wdWJsaWM"
{
  "kind": "NamespaceList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces",
    "resourceVersion": "145"
  },
  "items": [
    {
      "metadata": {
        "name": "kube-system",
        "selfLink": "/api/v1/namespaces/kube-system",
        "uid": "f95e9484-6852-11e7-ab03-7831c1b76042",
        "resourceVersion": "5",
        "creationTimestamp": "2017-07-14T05:12:03Z"
      },
      "spec": {
        "finalizers": [
          "kubernetes"
        ]
      },
      "status": {
        "phase": "Active"
      }
    }
  ]
}
```
2017-09-02 19:26:29 -07:00
Clayton Coleman 8952a0cb72
Server side implementation of paging for etcd3
Add a feature gate in the apiserver to control whether paging can be
used. Add controls to the storage factory that allow it to be disabled
per resource. Use a JSON encoded continuation token that can be
versioned. Create a 410 error if the continuation token is expired.

Adds GetContinue() to ListMeta.
2017-09-01 10:47:01 -04:00
xilabao f14c138438 add selfsubjectrulesreview api 2017-09-01 19:09:43 +08:00
Tim Hockin 9e2fccd1de Remove generated JSON code 2017-08-31 23:31:12 -07:00
David Eads 253b047d89 update GC controller to wait until controllers have been initialized once 2017-08-31 09:01:38 -04:00
ymqytw 7500b55ce4 move retry to client-go 2017-08-14 14:16:26 -07:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Dan Mace 3d6d57a18f Improve GC discovery sync performance
Improve GC discovery sync performance by only syncing when discovered
resource diffs are detected. Before, the GC worker pool was shut down
and monitors resynced unconditionally every sync period, leading to
significant processing delays causing test flakes where otherwise
reasonable GC timeouts were being exceeded.

Related to https://github.com/kubernetes/kubernetes/issues/49966.
2017-08-09 09:16:05 -04:00
Malepati Bala Siva Sai Akhil 83603f0358 Fix typo in comment
Fix typo in comment in garbagecollector
2017-08-05 22:47:48 +05:30
Kubernetes Submit Queue cba21511bd Merge pull request #49980 from caesarxuchao/gc-minor
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899)

GC shouldn't send empty patch

The scope of the `if` statement was wrong, causing GC to sometimes send empty patch.

Found this bug while investigating https://github.com/kubernetes/kubernetes/issues/49966.
2017-08-02 19:11:13 -07:00
Kubernetes Submit Queue 84e0326eb1 Merge pull request #49782 from supereagle/update-generated-deepcopy
Automatic merge from submit-queue (batch tested with PRs 50029, 48517, 49739, 49866, 49782)

Update generated deepcopy code

**What this PR does / why we need it**:
In generated deepcopy code, the method names in comments do not match the real method names.

**Which issue this PR fixes**: fixes #49755

**Special notes for your reviewer**:
/assign @sttts @caesarxuchao 


**Release note**:
```release-note
NONE
```
2017-08-02 12:46:57 -07:00
Chao Xu 3060e925f5 GC shouldn't send empty patch 2017-08-01 13:06:36 -07:00
supereagle a1c880ece3 update generated deepcopy code 2017-07-31 22:33:00 +08:00
Dan Mace d08dfb92c7 Enable garbage collection of custom resources
Enhance the garbage collector to periodically refresh the resources it
monitors (via discovery) to enable custom resource definition GC.

This implementation caches Unstructured structs for any kinds not
covered by a shared informer. The existing meta-only codec only supports
compiled types; an improved codec which supports arbitrary types could
be introduced to optimize caching to store only metadata for all
non-informer types.
2017-07-28 10:00:10 -04:00
Kubernetes Submit Queue 89525c62fd Merge pull request #49516 from caesarxuchao/parallel-patch
Automatic merge from submit-queue (batch tested with PRs 48360, 48469, 49576, 49516, 49558)

Let garbage collector send orphaning patches in parallel

Garbage collector sends orphaning patches in parallel now.
2017-07-26 13:02:43 -07:00
Kubernetes Submit Queue 393b1228c9 Merge pull request #45431 from DirectXMan12/feature/fake-dynamic-client
Automatic merge from submit-queue (batch tested with PRs 48224, 45431, 45946, 48775, 49396)

[client-go] Fake Dynamic Client

This commit converts `"k8s.io/client-go/dynamic".Client` to an interface, and implements fake versions of both `ClientPool` and `Client`.  This allows components which make uses of these clients to be tested in the same way that clientset-based components can be tested, using the standard `testing.Fake` machinery.

**Release note**:
```release-note
NONE
```
2017-07-25 11:06:49 -07:00
deads2k 151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
Chao Xu 5e7d7c00a2 let garbage collector send orphaning patches in parallel 2017-07-24 13:56:39 -07:00
Solly Ross f78d61e7c2 [client-go] Add dynamic.Interface
This adds an interface form of dynamic.Client and
dynamic.ResourceClient, making those two follow the general client
conventions: `Interface` is an interface, and `Client` is the concrete
implementation.  `ClientPool` retains it's interface status.

This allows us to create a fake implemenation of dyanmic.Interface,
dynamic.ResourceInterface, and dynamic.ClientPool for testing.
2017-07-21 14:24:06 -04:00
Dr. Stefan Schimanski 8dd0989b39 Update generated code 2017-07-18 09:28:49 +02:00
Dr. Stefan Schimanski 39d95b9b06 deepcopy: add interface deepcopy funcs
- add DeepCopyObject() to runtime.Object interface
- add DeepCopyObject() via deepcopy-gen
- add DeepCopyObject() manually
- add DeepCopySelector() to selector interfaces
- add custom DeepCopy func for TableRow.Cells
2017-07-18 09:28:47 +02:00