Commit Graph

103498 Commits

Author SHA1 Message Date
Tim Hockin
bdbf2c6ef4 Svc REST: Allow multi-IP-family in tests 2021-09-11 10:54:24 -07:00
Tim Hockin
6cc9ef3874 Svc REST: Rename a long, hard function name 2021-09-11 10:54:03 -07:00
Tim Hockin
634055bded Svc REST: De-layer Create
Gut the "outer" Create() and move it to the inner BeginCreate().  This
uses a "transaction" type to make cleanup functions easy to read.

Background:

Service has an "outer" and "inner" REST handler.  This is because of how we do IP and port allocations synchronously, but since we don't have API transactions, we need to roll those back in case of a failure.  Both layers use the same `Strategy`, but the outer calls into the inner, which causes a lot of complexity in the code (including an open-coded partial reimplementation of a date-unknown snapshot of the generic REST code) and results in `Prepare` and `Validate` hooks being called twice.

The "normal" REST flow seems to be:

```
mutating webhooks
generic REST store Create {
    cleanup = BeginCreate
    BeforeCreate {
        strategy.PrepareForCreate {
            dropDisabledFields
        }
        strategy.Validate
        strategy.Canonicalize
    }
    createValidation (validating webhooks)
    storage Create
    cleanup
    AfterCreate
    Decorator
}
```

Service (before this commit) does:

```
mutating webhooks
svc custom Create {
    BeforeCreate {
        strategy.PrepareForCreate {
            dropDisabledFields
        }
        strategy.Validate
        strategy.Canonicalize
    }
    Allocations
    inner (generic) Create {
        cleanup = BeginCreate
        BeforeCreate {
            strategy.PrepareForCreate {
                dropDisabledFields
            }
            strategy.Validate
            strategy.Canonicalize
        }
        createValidation (validating webhooks)
        storage Create
        cleanup
        AfterCreate
        Decorator
    }
}
```

After this commit:

```
mutating webhooks
generic REST store Create {
    cleanup = BeginCreate
        Allocations
    BeforeCreate {
        strategy.PrepareForCreate {
            dropDisabledFields
        }
        strategy.Validate
        strategy.Canonicalize
    }
    createValidation (validating webhooks)
    storage Create
    cleanup
    AfterCreate
        Rollback allocations on error
    Decorator
}
```

This same fix pattern will be applied to Delete and Update in subsequent
commits.
2021-09-11 10:51:45 -07:00
Tim Hockin
5e7e35ca45 Svc REST: Add stub begin* hooks
These will be used in the next set of commits to de-0layer service REST.
2021-09-11 10:51:09 -07:00
Tim Hockin
f3c7e846f1 Svc REST: Move allocations in Create into funcs
All the logic remains unchanged, just reorganized.  The functions are
imperfect but emphasize the change being made and can be cleaned up
subsequently.

This makes the following steps easier to comprehend.
2021-09-11 10:50:27 -07:00
Tim Hockin
960b36b124 Svc REST: Add a transaction API
This will be used in upcoming commits, but for easier history and review
it is pretty stand-alone.
2021-09-11 10:49:37 -07:00
Tim Hockin
14d0571a5f Svc REST: Don't call validation directly
The validation is called soon after anyway.
2021-09-11 10:49:13 -07:00
Tim Hockin
b76a8c3c40 Svc REST: move allocator methods -> alloc object
Move all allocator-related methods onto the alloc object so it can be
used in either REST layer.  There's an INORDINATE amount of test code
here and I am skeptical that it is all useful.  That's for later
commits.
2021-09-11 10:48:32 -07:00
Tim Hockin
89587b3c6a Svc REST: Encapsulate IP and Port allocator logic
Encapsulate the allocator logic so it can be shared across REST
layers while we stage a series of commits to get rid of one layer.
2021-09-11 10:46:48 -07:00
Tim Hockin
d13c920606 Svc: Move ETP clearing to dropTypeDependentFields
I  am not sure why ExternalTrafficPolicy was different, but this is more
consistent with other field clearing logic.
2021-09-11 10:45:30 -07:00
Yecheng Fu
82b50dcb7b scheduler/volumebinding: migrate to use pkg/scheduler/framework/plugins/feature 2021-09-11 10:17:28 +08:00
Kubernetes Prow Robot
6b21e064be
Merge pull request #104917 from vinayakankugoyal/e2e
Skip externalips service tests if admission controller to deny externalip services is enabled.
2021-09-10 19:08:06 -07:00
Kubernetes Prow Robot
8ac9526475
Merge pull request #101928 from alexanderConstantinescu/drain-workqueue
client-go/workqueue: Drain work queue on shutdown
2021-09-10 18:02:06 -07:00
Kubernetes Prow Robot
b47f8263e1
Merge pull request #104858 from pohly/generic-ephemeral-volume-intree-tests
e2e: enable generic ephemeral inline volume also for in-tree drivers
2021-09-10 14:49:01 -07:00
Vinayak Goyal
b3c23290b4 Skip service external ips tests if admission controller to deny externalip services is enabled. 2021-09-10 12:51:31 -07:00
Kubernetes Prow Robot
1e607a500f
Merge pull request #104880 from dcantah/update-hcsshim-0.8.21
vendor: bump hcsshim to v0.8.22
2021-09-10 11:21:21 -07:00
Kubernetes Prow Robot
528859ef9d
Merge pull request #104901 from soltysh/refactor_printers
Move `YamlPrinter` to its own file
2021-09-10 09:04:00 -07:00
Kubernetes Prow Robot
d6acb7ce01
Merge pull request #104884 from eddiezane/ez/update-kubectl-run-flags
Remove functionality from deprecated kubectl run flags
2021-09-10 07:52:00 -07:00
Kubernetes Prow Robot
cf535b0339
Merge pull request #104866 from zzchun/fix-typo-in-framework-interface
fix typo in framework interface
2021-09-10 06:46:01 -07:00
Maciej Szulik
281231e074
Move YamlPrinter to its own file 2021-09-10 13:23:25 +02:00
Kubernetes Prow Robot
5261433627
Merge pull request #104606 from endocrimes/dani/device-driver-deflake
[Failing Test] Fix GPU Device Driver test in kubelet-serial
2021-09-10 04:20:00 -07:00
Kubernetes Prow Robot
758ad0790c
Merge pull request #104572 from andyzhangx/detach-disk-deleting
fix detach disk issue on deleting vmss node
2021-09-10 01:58:00 -07:00
Daniel Canter
3eef755b3b vendor: bump hcsshim to v0.8.22
This tag of hcsshim brings in a couple welcome features/improvements. One being
exposing a way to query for hns endpoint statistics (Packets received/sent etc.).
This tag also contains some optimizations for querying whether a certain HCN feature
is supported, which is a common workflow in kube-proxy on Windows. The first result
from querying HCN is now cached so further calls can skip the hcn query as well as the
version range parsing that was performed. This also gets rid of some redundant logs
that used to hit everytime the version range parsing occurred.

The Go-winio dep bump, and all of the ctrd deps are transitive only. Nothing new is needed/intended
to be used.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-09-10 00:54:24 -07:00
Kubernetes Prow Robot
34003c5aee
Merge pull request #104841 from h4ghhh/deltafifo_rv
client-go: para 'resourceVersion' in DeltaFIFO.Replace is not used, so remove it
2021-09-10 00:48:00 -07:00
Kubernetes Prow Robot
1dcea5cb02
Merge pull request #104817 from smarterclayton/pod_status
kubelet: Rejected pods should be filtered from admission
2021-09-09 22:15:59 -07:00
Kubernetes Prow Robot
5724484bda
Merge pull request #104069 from pacoxu/fix-data-race-104057
fix data race in kubelet volume test: add lock for ut
2021-09-09 21:09:59 -07:00
Kubernetes Prow Robot
51ff4bb814
Merge pull request #104881 from MikeSpreitzer/relax-queueset-tests
Widen margins of TestDifferentWidths and TestTooWide
2021-09-09 19:49:59 -07:00
zzchun
3ad158d62c fix typo in framework interface
Signed-off-by: zzchun <zzchun@zju.edu.cn>
2021-09-10 10:14:21 +08:00
Kubernetes Prow Robot
c91287c7b9
Merge pull request #104747 from kinvolk/invidian/typos
Fix typos in files which are used for generating OpenAPI
2021-09-09 18:04:57 -07:00
Kubernetes Prow Robot
a402f1753c
Merge pull request #104756 from tnqn/ipvs-sctp-masquerade
Fix client IP preservation for NodePort service with protocol SCTP
2021-09-09 15:34:56 -07:00
Kubernetes Prow Robot
5b49d125b7
Merge pull request #104103 from pohly/logr-1.0
klog 2.20.0, logr v1.1.0, zapr v1.1.0
2021-09-09 14:28:56 -07:00
Eddie Zaneski
da8f404ae0
Remove functionality from deprecated kubectl run flags
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>
2021-09-09 15:25:52 -06:00
Mike Spreitzer
59d319ec06 Widen margins of TestDifferentWidths and TestTooWide
These behavioral unit tests of queueset were failing because the
evaluation criteria were too strict.
2021-09-09 17:08:50 -04:00
Kubernetes Prow Robot
73453e473b
Merge pull request #104826 from cici37/UpdateOWNERS
Update CHANGELOG OWNERS
2021-09-09 10:50:11 -07:00
Kubernetes Prow Robot
669de4b957
Merge pull request #104666 from alculquicondor/tracking-beta
Fix Job tracking with finalizers for more than 500 pods
2021-09-09 09:26:11 -07:00
Kubernetes Prow Robot
c0c7039f3a
Merge pull request #103751 from y-tag/approx-float64
fix AsApproximateFloat64() for BinarySI
2021-09-09 08:22:11 -07:00
Patrick Ohly
cb6a653777 klog 2.20.0, logr v1.1.0, zapr v1.1.0
This replaces the experimental logr v0.4 with the stable v1.1.0
release. This is a breaking API change for some users because:
- Comparing logr.Logger against nil is not possible anymore:
  it's now a struct instead of an interface. Code which
  allows a nil logger should switch to *logr.Logger as type.
- Logger implementations must be updated in lockstep.

Instead of updating the forked zapr code in json.go, directly using
the original go-logr/zapr is simpler and avoids duplication of effort.

The updated zapr supports logging of numeric verbosity. Error messages
don't have a verbosity (= always get logged), so "v" is not getting
added to them anymore.

Source code logging for panic messages got fixed so that it references
the code with the invalid log call, not the json.go implementation.

Finally, zapr includes additional information in its panic
messages ("zap field", "ignored key", "invalid key").
2021-09-09 14:43:43 +02:00
Abu Kashem
28f2b42a41
apf: update apf logic to use v1beta2 2021-09-09 08:28:58 -04:00
Abu Kashem
d99497ef6d
apf: update e2e test to use v1beta2 2021-09-09 08:28:58 -04:00
Abu Kashem
2f19f8c2df
apf: regenerate for v1beta2 2021-09-09 08:28:58 -04:00
Abu Kashem
e2b8701545
apf: ebable v1beta2 2021-09-09 08:28:53 -04:00
Kubernetes Prow Robot
c964fe6001
Merge pull request #104812 from astraw99/fix-sharedInformer-doc
Fix comment of `processorListener.requestedResyncPeriod`
2021-09-09 01:42:11 -07:00
Patrick Ohly
468acb7418 e2e: enable generic ephemeral inline volume also for in-tree drivers
Previously, the ephemeral volume test suite was only enabled for CSI
drivers. By splitting the test patterns into those that work for all drivers
and the one for CSI ephemeral inline volumes it becomes possible to
define the former for all drivers and the latter only for CSI.

This increases test coverage, in particular also for migration to
CSI (https://testgrid.k8s.io/provider-gcp-compute-persistent-disk-csi-driver#Migration%20Kubernetes%20Master%20Driver%20Latest).
2021-09-09 09:59:39 +02:00
kitianFresh
305c13faca avoid sharedIndexInformer run more than once, avoid more cache and memory consume 2021-09-09 13:37:25 +08:00
Kubernetes Prow Robot
95390e6476
Merge pull request #103023 from tiloso/staticcheck-apiserver-clientgo
Fix staticcheck in k8s.io/{apiserver/pkg/storage,client-go/rest/watch}
2021-09-08 18:50:10 -07:00
Kubernetes Prow Robot
d25a4c40cf
Merge pull request #104849 from Huang-Wei/revert-103515
Revert PR 103515
2021-09-08 17:44:21 -07:00
Kubernetes Prow Robot
9956551b62
Merge pull request #104848 from ehashman/node-api-shadow
Request: Add ehashman as a sig-node API review shadow
2021-09-08 17:44:10 -07:00
Kubernetes Prow Robot
5990b3c76a
Merge pull request #104828 from leiyiz/mock_volume_flake
increasing sleep timer to 5 sec in attempt to deflake token test
2021-09-08 15:48:52 -07:00
Léiyì Zhang
f1bfd8f8df increasing sleep timer to 5 sec 2021-09-08 21:41:31 +00:00
Wei Huang
c2e9305173
Revert PR 103515 2021-09-08 13:23:30 -07:00