Commit Graph

98476 Commits

Author SHA1 Message Date
Patrick Ohly
3adcf11b45 e2e storage: use embedded mock CSI driver
This replaces embedding of JavaScript code into the mock driver that
runs inside the cluster with Go callbacks which run inside the
e2e.test suite itself. In contrast to the JavaScript hooks, they have
direct access to all parameters and can fabricate arbitrary responses,
not just error codes.

Because the callbacks run in the same process as the test itself, it
is possible to set up two-way communication via shared variables or
channels. This opens the door for writing better tests. Some of the
existing tests that poll mock driver output could be simplified, but
that can be addressed later.

For now, only tests using hooks use embedding. How gRPC calls are
retrieved is abstracted behind the CSIMockTestDriver interface, so
tests don't need to be modified when switching between embedding
and remote mock driver.
2021-03-01 19:22:37 +01:00
Patrick Ohly
92bac8afc1 mock driver: fix no-op setDefaultCreds
The function must modify the content of the "creds" pointer, not the
pointer.

Found via hack/verify-staticcheck.sh after importing the code into
Kubernetes. It is uncertain whether this bug had any consequences.
2021-03-01 19:22:37 +01:00
Patrick Ohly
a2a34bb744 mock driver fixes 2021-03-01 19:22:37 +01:00
Patrick Ohly
ab365c091c mock driver: replace logrus with klog
klog now has structured logging.
2021-03-01 19:22:37 +01:00
Patrick Ohly
df6d3bc7dd CSI mock driver: fix faulty error message
Caught by verify-typecheck.sh after importing the code into
Kubernetes:

ERROR(linux/arm): /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:404:20: math.MaxUint32 (untyped int constant 4294967295) overflows int
ERROR(linux/arm): /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:795:20: math.MaxUint32 (untyped int constant 4294967295) overflows int
ERROR(linux/386): /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:404:20: math.MaxUint32 (untyped int constant 4294967295) overflows int
ERROR(linux/386): /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:795:20: math.MaxUint32 (untyped int constant 4294967295) overflows int
ERROR(windows/386): /home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:404:20: math.MaxUint32 (untyped int constant 4294967295) overflows int
ERROR(windows/386):
/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/storage/drivers/csi-test/mock/service/controller.go:795:20:
math.MaxUint32 (untyped int constant 4294967295) overflows int

Instead of producing our own error message, we can show the original
value and the error from strconv.
2021-03-01 19:22:37 +01:00
Patrick Ohly
7008196093 csi-test: import copyright clarification
The code originates in csi-test and this copyright change was made by
the original author in https://github.com/kubernetes-csi/csi-test/pull/324
2021-03-01 19:22:37 +01:00
Patrick Ohly
7f2b438020 e2e: import csi-test mock driver
This is a verbatim copy of the corresponding files in csi-test v4.0.2.

They'll be modified in future commits to make the code usable when
embedded in e2e.test. Some of those changes may be worthwhile
backporting to csi-test, but this is uncertain at this time.
2021-03-01 19:22:37 +01:00
Patrick Ohly
21ffdd1a28 test: update CSI mock driver
The new release properly checks for existence of the staging
directory. The names of the volumes are now the same as in
https://github.com/kubernetes-csi/csi-test/blob/master/mock/example/deploy/csi-mock-driver-deployment.yaml
2021-03-01 19:22:37 +01:00
Patrick Ohly
99248b1406 e2e: reduce worker threads during mock testing
We don't need much concurrency and having too many worker threads has
one disadvantage (besides resource usage): when the sidecar looses the
connection to the CSI driver, it calls klog.Fatal, which prints all
gouroutines. This can lead to much output.
2021-03-01 19:22:37 +01:00
cici37
69fee369c9 Update extension mechanism and related sample. 2021-03-01 10:22:22 -08:00
cici37
781d7cf134 Address review comments 2021-03-01 10:22:19 -08:00
cici37
9849079d4e Address review comments 2021-03-01 10:22:18 -08:00
cici37
b669f04648 Modify integration test to fill CCM test gap 2021-03-01 10:22:16 -08:00
cici37
3c150e8e1f Update test 2021-03-01 10:22:10 -08:00
cici37
27aaee2b40 Move initialize cloud provider with client builder reference inside controller start func 2021-03-01 10:22:10 -08:00
cici37
498fa39af2 Separate example func and add README.md 2021-03-01 10:22:09 -08:00
cici37
edc5b58e23 Update BUILD and staticcheck. 2021-03-01 10:22:06 -08:00
cici37
52bab024af Separate func 2021-03-01 10:21:57 -08:00
cici37
7b0a6db097 Add demonstration of wiring nodeIPAMController config object 2021-03-01 10:21:52 -08:00
cici37
4729fa49e1 Remove cloud provider name as input parameter. 2021-03-01 10:21:49 -08:00
cici37
2b3d2303a5 Fix flag passing in CCM. 2021-03-01 10:21:46 -08:00
Kubernetes Prow Robot
35c233f18d
Merge pull request #99590 from liggitt/kubelet-warning
Avoid kubelet warnings for imagePullSecret entries with empty names
2021-03-01 09:55:39 -08:00
Kubernetes Prow Robot
5498ee641b
Merge pull request #99561 from BenTheElder/remove-bazel
Remove Bazel
2021-03-01 09:55:27 -08:00
Krzysztof Gibuła
7097d4f8e2 Migrate pkg/kubelet/stats to structured logging 2021-03-01 18:52:34 +01:00
Kubernetes Prow Robot
f6152d1521
Merge pull request #97086 from xing-yang/check_datasource
Only CSI plugin can have a DataSource
2021-03-01 06:53:26 -08:00
Jordan Liggitt
4798d0bce2 Avoid kubelet warnings for imagePullSecret entries with empty names 2021-03-01 08:32:09 -05:00
Alan Zhu
8ffdc674b2 update kubeadm upgrade description
Signed-off-by: Alan Zhu <zg.zhu@daocloud.io>
2021-03-01 20:42:57 +08:00
Kubernetes Prow Robot
793390e13b
Merge pull request #99538 from liggitt/skip-empty-names
Skip visiting empty secret and configmap names
2021-03-01 00:12:39 -08:00
Kubernetes Prow Robot
6a9182c944
Merge pull request #98867 from nikhita/kind-feature-template-remove
.github: update enhancement issue template to point to KEPs
2021-02-28 20:22:41 -08:00
pacoxu
96f8d62624 print log for default container of kubectl 2021-03-01 12:04:29 +08:00
wzshiming
67e4ba0797 Speed up pkg/controller/volume/scheduling unit tests 2021-03-01 11:53:45 +08:00
pacoxu
71db08d15a fix: will logs the default container only even --all-containers is specified
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-01 11:26:59 +08:00
SataQiu
2ba178c92c kubeadm: skip validating pod subnet against node-cidr-mask when allocate-node-cidrs is set to be false 2021-03-01 11:19:47 +08:00
Kubernetes Prow Robot
74811759dc
Merge pull request #99564 from aojea/tcpproxy_ntry
fix e2e test kube-proxy tcp_wait
2021-02-28 16:58:39 -08:00
Benjamin Elder
d296698b1a remove BUILD copy from verify-openapi-spec.sh 2021-02-28 15:57:13 -08:00
Antonio Ojea
1b61f49995 fix e2e test kube-proxy tcp_wait 2021-03-01 00:54:57 +01:00
Benjamin Elder
603c942e41 drop directories that only contained bazel-related sources 2021-02-28 15:17:30 -08:00
Benjamin Elder
b1b2f239fe remove bazel related entries in build/dependencies.yaml 2021-02-28 15:17:30 -08:00
Benjamin Elder
d9ef7cbe8c drop bazel related tools from hack/tools module 2021-02-28 15:17:29 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Benjamin Elder
95e4a6bcda remove now-unecessary logic from hack/verify-bazel.sh 2021-02-28 15:16:53 -08:00
Benjamin Elder
a1f2787897 automate removing bazel in hack/update-bazel.sh 2021-02-28 15:16:53 -08:00
Kubernetes Prow Robot
4880b996b5
Merge pull request #99433 from navist2020/fix/kubeadm/out_info
Replace yml with yaml
2021-02-28 09:50:39 -08:00
Kubernetes Prow Robot
c410910c1f
Merge pull request #99512 from knabben/add-netpol-ports
Adding specific protocol network policy test
2021-02-28 07:36:39 -08:00
Kubernetes Prow Robot
a185bafa0c
Merge pull request #99549 from BenTheElder/conformance-make
conformance.yaml: generate with make
2021-02-28 05:30:39 -08:00
andyzhangx
2e4896dd55 fix smb mount issue on Windows 2021-02-28 13:19:15 +00:00
mengjiao.liu
cb4139cdde update SingnerName field doc 2021-02-28 18:21:29 +08:00
Benjamin Elder
025e6de3eb don't run generated_files when generating specsummaries.json 2021-02-28 00:54:54 -08:00
Benjamin Elder
ed09168e8a fix generated conformance filepaths when test binary is not stripped 2021-02-28 00:54:54 -08:00
Benjamin Elder
c1c3fdefe3 port conformance yaml generation to hack 2021-02-28 00:54:54 -08:00