Commit Graph

103627 Commits

Author SHA1 Message Date
Tim Hockin
6d640aa244 Svc REST: Remove redundant Get test 2021-09-11 11:01:32 -07:00
Tim Hockin
15c513cc36 Svc REST: IP and port reallocation
Make sure the logic that was covered in rest_test is covered in
storage_test.
2021-09-11 11:01:23 -07:00
Tim Hockin
a957f63ec5 Svc REST: HealthCheckNodePort tests
This commit ports the ExternalTrafficPolicy and HealthCheckNodePort
tests from rest_test to storage_test.  It's not a direct port, though.
I have added more cases (much more exhaustive) and more assertions.
2021-09-11 11:01:07 -07:00
Tim Hockin
2212924a96 Svc REST: Better NodePort tests
This commit ports the NodePort test from rest_test to storage_test.
It's not a direct port, though.  I have added many more cases (much more
exhaustive) and more assertions.

This includes cases for gate MixedProtocolLBService.
2021-09-11 11:00:44 -07:00
Tim Hockin
46d7289655 Svc REST: Remove redundant Create tests
These cases are all covered in storage_test.
2021-09-11 11:00:29 -07:00
Tim Hockin
0dc509a0c8 Svc REST: Test that Headless doesn't set IPs 2021-09-11 11:00:11 -07:00
Tim Hockin
9ca582f3b7 Svc REST: Test that ExternalName doesn't set IPs 2021-09-11 10:59:30 -07:00
Tim Hockin
ca4a95ee49 Svc REST: Dedup tests for defaulting 2021-09-11 10:59:02 -07:00
Tim Hockin
b880d3a149 Svc REST: better test checks in new tests
"Has()" was strengthened in the older rest_test, now in the newer.
2021-09-11 10:58:32 -07:00
Tim Hockin
e338c9db4b Svc REST: Set Cluster IPs during dry-run Create
Dry-run should behave like a real API call and return valid results.
2021-09-11 10:57:01 -07:00
Tim Hockin
52856f3fbe Add dry-run support to the IP allocator subsystem 2021-09-11 10:56:39 -07:00
Tim Hockin
237434bd42 Svc REST: Overhaul Create test wrt dual-stack
This includes a few cases.

1) TestCreateIgnoresIPFamilyForExternalName: Prove that ExternalName is
ignored for dual-stack.  A small set of test cases were chosen to
demonstrate.

2) TestCreateIgnoresIPFamilyWithoutDualStack: Prove that when the
dual-stack gate is off, all services are ignored for dual-stack.  A
small set of test cases were chosen to demonstrate

3) TestCreateInitIPFields: Run over a huge array of test cases for
dual-stack.  This was generated by this program:
https://gist.github.com/thockin/cccc9c9a580b4830ee0946ddd43eeafe and
then updated by hand.
2021-09-11 10:56:03 -07:00
Tim Hockin
e4c6d0837e Svc REST: Rename some tests for clarity 2021-09-11 10:55:51 -07:00
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
Patrick Ohly
3af6b94b1c kube-controller-manager: properly check generic ephemeral volume feature
Due to a cut-and-paste error in the original implementation in Kubernetes 1.19,
support for generic ephemeral inline volumes in the PVC protection controller
was incorrectly tied to the "storage object in use" feature gate.
2021-09-10 16:48:32 +02:00
Aldo Culquicondor
7d9cb88fed Limit number of Pods counted in a single Job sync
This prevents big Jobs from starving smaller ones.
2021-09-10 10:32:04 -04:00
Carlos Panato
ee04b4dd37
build/common: check if docker buildx is available
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-09-10 15:57:04 +02: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
wojtekt
4ce452989b Migrate to k8s.io/utils/clock in flowcontrol backoff 2021-09-10 14:27:44 +02:00
wojtekt
792408ae48 Migrate to k8s.io/utils/clock in lease controller 2021-09-10 14:27:44 +02: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
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
wojtekt
392292ba81 Migratet to k8s.io/utils/clock in workqueue 2021-09-10 12:20:09 +02:00
wojtekt
ef9a90fac1 Migrate to k8s.io/utils/clock in pkg/quota 2021-09-10 11:42:32 +02:00
wojtekt
e233feb99b Migrate to k8s.io/utils/clock in pkg/controller 2021-09-10 11:42:32 +02: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