Commit Graph

12252 Commits

Author SHA1 Message Date
Tim Hockin
25da6a0660 Change AfterCreate/Update to take Options
Also adds typedefs for these function signatures for code clarity.
2021-01-08 11:08:12 -08:00
Tim Hockin
9402f48e05 Change AfterDelete to take DeleteOptions
All of the After* hooks are called, whether the operation is dry-run or
not.  Create and Upate both have BeginCreate() hooks which know about
dry-run but delete doesn't, and can't (because of graceful deletion and
finalizers, the Delete() method may return and the object is actually
deleted later).

This adds an argument to AfterDelete(), and the others will follow.

This commit also adds tests for AfterDelete being called in the right
places.
2021-01-08 11:08:08 -08:00
Tim Hockin
bb79475a86 Remove ObjectFunc 2021-01-08 11:00:39 -08:00
Tim Hockin
625713008d Make REST Decorator funcs not return error 2021-01-08 11:00:39 -08:00
Tim Hockin
64491be328 Make REST After* funcs not return error 2021-01-08 11:00:39 -08:00
Tim Hockin
67c9761623 Add BeginCreate and BeginUpdate REST hooks
These hooks return a "cleanup" func which is called when the top-level
operation completes, with an indicator of which result.

This is to enable much simpler handling of allocations in Service's REST
implementation, in particular.

Some discussion in https://github.com/kubernetes/kubernetes/pull/95967

This also adds tests for the almost totally untested Decorator,
AfterCreate, and AfterUpdate hooks.
2021-01-08 11:00:12 -08:00
Kubernetes Prow Robot
cfc96c7db7 Merge pull request #97820 from tkashem/webhook-error
prevent panic on webhook authenticator and authorizer timeout before response
2021-01-08 10:34:41 -08:00
Mike Spreitzer
611184aa59 move all variables in sampleAndWaterMarkHistograms::innerSet
to tiptoe around https://github.com/golang/go/issues/43570 for #97685
2021-01-08 13:32:38 -05:00
Jordan Liggitt
ecbff22ca1 Track opened connections with a single tracker per authenticator 2021-01-08 13:21:09 -05:00
Kubernetes Prow Robot
0fe6f72d9b Merge pull request #96011 from mikedanese/bazel
build: Update bazel to 3.4.1 and k/repo-infra to v0.2.0
2021-01-08 09:24:53 -08:00
Abu Kashem
ae2b353fbf handle webhook authenticator and authorizer error
webhook.WithExponentialBackoff returns an error, and the priority is:
- A: if the last invocation of the webhook function returned an error
  that error should be returned, otherwise
- B: the error associated with the context if it has been canceled or
  it has expired, or the ErrWaitTimeout returned by the wait package
  once all retries have been exhausted.

caller should check the error returned by webhook.WithExponentialBackoff
to handle both A and B. Currently, we only handle A.
2021-01-08 11:30:35 -05:00
Kubernetes Prow Robot
9a386cdd5d Merge pull request #97845 from mborsz/cacher-metrics2
Add 'apiserver_terminated_watchers_total'
2021-01-08 07:06:53 -08:00
Maciej Borsz
342ad48feb Add 'apiserver_terminated_watchers_total' 2021-01-08 10:55:44 +01:00
Kubernetes Prow Robot
d1db90ba57 Merge pull request #97693 from enj/enj/i/oidc_fast_init
oidc authenticator: attempt to immediately initialize verifier
2021-01-07 18:12:53 -08:00
Mike Danese
77261377de fixup fixture logic
There was a bug with init() but it was resolved in
https://github.com/bazelbuild/rules_go/pull/2696

Changed to match other fixture methods.

Change-Id: I882b8535e5c5c117fb10c41d34c8eed1ccdb74bb
2021-01-07 15:26:20 -08:00
xiongzhongliang
0c74749ec9 Add statefulset to kubectl autoscale bash completions
Add statefulset to kubectl autoscale bash completions
2021-01-08 05:59:45 +08:00
Kubernetes Prow Robot
f2e1ee0500 Merge pull request #97675 from wanghaoran1988/proxy_handler
Add NewProxyHandler func
2021-01-07 11:50:53 -08:00
Kubernetes Prow Robot
e765ab2e7e Merge pull request #97370 from MikeSpreitzer/relax-apf-controller
Relax apf_controller's reaction to certain errors
2021-01-07 08:17:57 -08:00
Kubernetes Prow Robot
f9c7c59e25 Merge pull request #97451 from pacoxu/fix/cluster-ip-quota
bugfix: nodeport quota check failure result into failing to create a clusterip service
2021-01-07 06:41:45 -08:00
Kubernetes Prow Robot
c5cc25d1cb Merge pull request #97615 from wojtek-t/immutable_secrets_ga
Promote Immutable Secrets/ConfigMaps to Stable
2021-01-07 00:03:45 -08:00
pacoxu
aaa7084a4a fix static check for vendor/k8s.io/apiserver/pkg/storage/etcd3/ 2021-01-07 11:27:03 +08:00
qini
a2350b5b2c Skip standalone VM when reconciling LoadBalancer 2021-01-07 10:20:14 +08:00
qini
f51014673d Use network.Interface.VirtualMachine.ID to get the binded VM 2021-01-07 10:18:42 +08:00
pacoxu
15867d9e8a bugfix: check Spec.AllocateLoadBalancerNodePorts for nodeport and skip zero usage in delta evaluator
Signed-off-by: pacoxu <paco.xu@daocloud.io>

When Spec.AllocateLoadBalancerNodePorts is "false" NodePort shall
not be included when computing quota for type:LoadBalancer.

Co-authored-by: uablrek
2021-01-07 07:11:22 +08:00
Kubernetes Prow Robot
3552bb5d8a Merge pull request #97645 from pandaamanda/kubectl_auth_reconcile_fatal
cleanup: change klog.Fatalf to fmt.Errorf for `kubectl auth reconcile`
2021-01-06 13:53:45 -08:00
xiongzhongliang
3b3a6d27cd cleanup: change klog.Fatalf to fmt.Errorf for kubectl auth reconcile
cleanup: change klog.Fatalf to fmt.Errorf for kubectl auth reconcile

cleanup: change klog.Fatalf to fmt.Errorf for
2021-01-07 06:40:06 +08:00
Chotiwat Chawannakul
1f4f78ac41 Fix stale object causing a panic on DELETE event 2021-01-06 10:38:31 -08:00
Mike Spreitzer
194c22fed5 Explain warnings in new test
Add info message that explains what warnings are deliberate and expected.
2021-01-06 13:10:40 -05:00
Kubernetes Prow Robot
e9353e9a8b Merge pull request #97740 from prameshj/release-ip
Release reserved GCE IP address after ensure completes, irrespective of outcome.
2021-01-06 08:44:11 -08:00
Kubernetes Prow Robot
5ee1726793 Merge pull request #97532 from pandaamanda/portforward
code cleanup for kubectl port-forward
2021-01-06 08:44:04 -08:00
Kubernetes Prow Robot
6af5fdcf98 Merge pull request #94396 from habibrosyad/patch-92402-10
fix vendor/k8s.io/apimachinery/pkg/runtime staticcheck
2021-01-06 08:43:52 -08:00
Kubernetes Prow Robot
eff5b075f1 Merge pull request #97379 from kebe7jun/fix/token-request-proto-name
Fix BoundObjectRef APIVersion proto name
2021-01-06 07:48:04 -08:00
Jordan Liggitt
5e6f3fe4a1 Remove 1.18.0 API test data 2021-01-06 08:12:50 -05:00
Jordan Liggitt
3fa94b79e3 Add 1.20 API test data 2021-01-06 08:12:18 -05:00
xiongzhongliang
555fa97cda code cleanup for kubectl port-forward
code cleanup for kubectl port-forward

code cleanup for kubectl port-forward
2021-01-06 17:12:19 +08:00
Mike Spreitzer
5fe48be506 Add unit test for sample-and-watermark histograms 2021-01-06 03:21:49 -05:00
Kubernetes Prow Robot
c73a1e7ece Merge pull request #97540 from chymy/just-comments
Fix on comments
2021-01-05 17:10:11 -08:00
Kubernetes Prow Robot
10c1c3acf6 Merge pull request #96906 from Rajalakshmi-Girish/issue-96853
Fixes the unit tests to be more tolerant with error messages
2021-01-05 17:09:51 -08:00
yoyinzyc
b561127e50 add interfaces to record metric with context. 2021-01-05 15:51:35 -08:00
Pavithra Ramesh
690189178d Release reserved GCE IP address after ensure completes.
Previous behavior was to release the ip only upon success, but it should be released
on failure as well. Otherwise, an IP address will be unnecessarily consumed due to an
in-error service.
2021-01-05 14:12:03 -08:00
Kubernetes Prow Robot
0300aa712e Merge pull request #97543 from pacoxu/fix/94495-ga
remove LegacyNodeRoleBehavior and mv ServiceNodeExclusion to GA
2021-01-05 11:46:45 -08:00
Kubernetes Prow Robot
3209dabb0d Merge pull request #97466 from geegeea/lint-kubelet
Fix golint issues in api/admission and api/admissionregistration
2021-01-05 09:01:59 -08:00
Kubernetes Prow Robot
815d7769f3 Merge pull request #97440 from pandaamanda/kubectl_label_errorlog
fix kubectl label error when local=true is set.
2021-01-05 07:03:58 -08:00
xiongzhongliang
cb7009a63b fix kubectl label error when local=true is set.
fix kubectl label error when local=true is set.

fix kubectl label error when local=true is set.
2021-01-06 06:04:56 +08:00
pacoxu
441985afb6 set LegacyNodeRoleBehavior to false and mv ServiceNodeExclusion to GA
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-01-05 22:34:18 +08:00
Kubernetes Prow Robot
7e677be77a Merge pull request #97656 from ialidzhikov/staticchec/initializers
Fix staticcheck in staging/src/k8s.io/apiserver/pkg/admission/initializer
2021-01-05 03:11:58 -08:00
xiongzhongliang
5a77916666 cleanup: fix the format of kubectl proxy examples 2021-01-05 06:02:37 +08:00
Monis Khan
be99f37a68 oidc authenticator: attempt to immediately initialize verifier
This change updates the OIDC authenticator to not wait 10 seconds
before attempting to fetch the /.well-known/openid-configuration
metadata from the OIDC issuer.  In most situations this results in
the API server being able to verify ID tokens sooner.

Signed-off-by: Monis Khan <mok@vmware.com>
2021-01-04 14:59:56 -05:00
Kubernetes Prow Robot
b7afcf52b8 Merge pull request #97307 from nearora-msft/fix-azure-diskclient-mock
fix: Fix ListByResourceGroup in azure diskClient mock
2021-01-04 11:37:56 -08:00
Haoran Wang
930cfe7408 Add NewProxyHandler func 2021-01-04 16:03:55 +08:00