k3s/hack
Kubernetes Submit Queue 07f85565a2 Merge pull request #36721 from smarterclayton/initializers
Automatic merge from submit-queue

Add initializer support to admission and uninitialized filtering to rest storage

Initializers are the opposite of finalizers - they allow API clients to react to object creation and populate fields prior to other clients seeing them.

High level description:

1. Add `metadata.initializers` field to all objects
2. By default, filter objects with > 0 initializers from LIST and WATCH to preserve legacy client behavior (known as partially-initialized objects)
3. Add an admission controller that populates .initializer values per type, and denies mutation of initializers except by certain privilege levels (you must have the `initialize` verb on a resource)
4. Allow partially-initialized objects to be viewed via LIST and WATCH for initializer types
5. When creating objects, the object is "held" by the server until the initializers list is empty
6. Allow some creators to bypass initialization (set initializers to `[]`), or to have the result returned immediately when the object is created.

The code here should be backwards compatible for all clients because they do not see partially initialized objects unless they GET the resource directly. The watch cache makes checking for partially initialized objects cheap. Some reflectors may need to change to ask for partially-initialized objects.

```release-note
Kubernetes resources, when the `Initializers` admission controller is enabled, can be initialized (defaulting or other additive functions) by other agents in the system prior to those resources being visible to other clients.  An initialized resource is not visible to clients unless they request (for get, list, or watch) to see uninitialized resources with the `?includeUninitialized=true` query parameter.  Once the initializers have completed the resource is then visible.  Clients must have the the ability to perform the `initialize` action on a resource in order to modify it prior to initialization being completed.
```
2017-06-03 07:16:52 -07:00
..
boilerplate
cmd/teststale
e2e-internal Split federation-{up,down} from e2e-{up,down}. 2017-02-24 14:27:31 -08:00
gen-swagger-doc update url information to prevent http 304 redirection 2017-05-25 14:05:02 +08:00
jenkins Export patch files to artifacts 2017-03-25 12:16:50 -07:00
lib Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission 2017-06-02 23:37:42 -07:00
make-rules Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
testdata Remove vestiges of defaulting from conversion path, switch to top-level default registration only 2017-04-12 13:36:15 -04:00
verify-flags Merge pull request #45919 from ericchiang/audit-webhook-backend 2017-06-01 13:41:59 -07:00
.linted_packages Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission 2017-06-02 23:37:42 -07:00
BUILD Add verify-gofmt as a Bazel test. 2017-02-10 17:00:28 -08:00
OWNERS Merge pull request #45996 from cblecker/hack-owner 2017-05-19 16:06:27 -07:00
autogenerated_placeholder.txt
benchmark-go.sh
build-cross.sh
build-go.sh
build-ui.sh move swagger route to apiserver 2017-02-01 15:18:32 -05:00
cherry_pick_pull.sh
dev-build-and-push.sh
dev-build-and-up.sh
dev-push-hyperkube.sh
e2e-node-test.sh
e2e.go return nil when err is nil 2017-05-27 14:34:45 +08:00
e2e_test.go hack/e2e_test.go's tester shouldn't stat files from the future 2017-02-15 15:59:47 -08:00
federated-ginkgo-e2e.sh Default FEDERATION_KUBE_CONTEXT to FEDERATION_NAME in federation e2e up/down scripts. 2017-04-05 18:47:03 -07:00
generate-bindata.sh Adding an installer script that installs Nvidia drivers in Container Optimized OS 2017-05-20 21:17:19 -07:00
generate-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
get-build.sh
ginkgo-e2e.sh e2e test: test azure disk volume 2017-04-28 18:51:34 +00:00
godep-restore.sh hack/godep-restore.sh: use godep v79 which works 2017-03-12 18:43:10 +01:00
godep-save.sh wire new staging repo 2017-05-02 08:43:31 -04:00
grab-profiles.sh
install-etcd.sh
list-feature-tests.sh
local-up-cluster.sh Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
lookup_pull.py update url information to prevent http 304 redirection 2017-05-25 14:05:02 +08:00
print-workspace-status.sh Use munged semantic version for side-loaded docker tag 2017-04-27 15:05:40 -07:00
run-in-gopath.sh
test-cmd.sh
test-go.sh
test-integration.sh hack/test-integration.sh: provide a recommended command and exit 2017-02-17 08:44:49 -08:00
test-update-storage-objects.sh Support storageclass storage upgrades to v1 2017-05-24 10:43:56 -04:00
update-all.sh Add update-federation-* scripts to update-all.sh 2017-05-15 16:51:09 -07:00
update-api-reference-docs.sh
update-bazel.sh Update gazel to v17 2017-04-27 15:01:34 -07:00
update-codecgen.sh Add internal audit API types 2017-05-18 10:30:21 -07:00
update-codegen.sh Enable client-gen for k8s.io/metrics 2017-05-10 13:33:18 -04:00
update-federation-api-reference-docs.sh
update-federation-generated-swagger-docs.sh
update-federation-openapi-spec.sh Fix hack/update-federation-openapi-spec.sh flakyness 2017-05-19 15:39:08 -07:00
update-federation-swagger-spec.sh
update-generated-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
update-generated-protobuf-dockerized.sh
update-generated-protobuf.sh
update-generated-runtime-dockerized.sh Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
update-generated-runtime.sh
update-generated-swagger-docs.sh Add priority and condition to column definitions 2017-05-29 18:23:48 -04:00
update-godep-licenses.sh
update-gofmt.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
update-openapi-spec.sh
update-staging-client-go.sh Use "hack/godep-restore.sh" instead of godep restore 2017-03-28 04:05:47 -04:00
update-staging-godeps.sh move metrics to staging 2017-05-01 16:43:50 -07:00
update-swagger-spec.sh hack/update-swagger-spec.sh: use posix regex syntax 2017-05-31 11:57:03 +02:00
update-translations.sh Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
update_owners.py Make update_owners.py also emit a JSON sig-owners list. 2017-05-11 17:01:29 -07:00
verify-all.sh
verify-api-groups.sh add "admission" API group 2017-05-19 10:17:37 -06:00
verify-api-reference-docs.sh
verify-bazel.sh Update gazel to v17 2017-04-27 15:01:34 -07:00
verify-boilerplate.sh
verify-cli-conventions.sh More cli sanity verifications 2017-05-18 15:44:49 -03:00
verify-codecgen.sh
verify-codegen.sh Merge pull request #45184 from DirectXMan12/feature/metrics-client-gen-tweaks 2017-06-02 18:05:50 -07:00
verify-description.sh
verify-federation-api-reference-docs.sh Adding verify-federation-api-reference-docs.sh 2017-05-14 17:20:24 -07:00
verify-federation-generated-swagger-docs.sh Adding verify-federation-generated-swagger-docs.sh 2017-05-14 17:20:24 -07:00
verify-federation-openapi-spec.sh
verify-federation-swagger-spec.sh Adding verify-federation-swagger-spec.sh 2017-05-14 17:15:41 -07:00
verify-flags-underscore.py check flag format in file known-flags.txt 2017-05-22 10:51:04 +08:00
verify-generated-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
verify-generated-protobuf.sh [go-to-protobuf] generate proto for k8s.io/metrics 2017-05-26 19:59:27 -04:00
verify-generated-runtime.sh Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
verify-generated-swagger-docs.sh
verify-godep-licenses.sh
verify-godeps.sh Export patch files to artifacts 2017-03-25 12:16:50 -07:00
verify-gofmt.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
verify-golint.sh
verify-govet.sh
verify-import-boss.sh
verify-linkcheck.sh
verify-no-vendor-cycles.sh remove excpetion in verify-no-vendor-cycles.sh 2017-05-15 20:17:38 -07:00
verify-openapi-spec.sh
verify-pkg-names.sh add "admission" API group 2017-05-19 10:17:37 -06:00
verify-readonly-packages.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
verify-staging-client-go.sh hack/verify-staging-client-go.sh: fail on changes 2017-02-27 14:11:41 +01:00
verify-staging-godeps.sh update-staging-{client-go,godeps}.sh: no godep-restore, pin godep, check workdir 2017-02-25 22:38:23 +01:00
verify-staging-imports.sh hack/verify-staging-imports.sh: simplify by negating package list 2017-06-01 14:49:13 +02:00
verify-swagger-spec.sh
verify-symbols.sh
verify-test-images.sh
verify-test-owners.sh