Compare commits

...

465 Commits

Author SHA1 Message Date
Kubernetes Publisher
9dfd0befa6 Merge pull request #138260 from liggitt/inline-json
use `json:""` consistently for inlined fields

Kubernetes-commit: 12484ce715d4c2030d894ebb2841e2cb027db7d0
2026-05-13 18:45:48 +00:00
Jordan Liggitt
06945f2b0e switch tag Get("json") to Lookup("json")
Kubernetes-commit: ef2e578f14fe666eb8a7296ea19f8284c1df5e7b
2026-04-07 18:12:54 -04:00
Jordan Liggitt
a16e1bb854 Drop meaningless ,inline from json tags
Kubernetes-commit: bed4a34ad8901d9a01efcb9594838f96ec9d4563
2026-04-07 13:30:08 -04:00
Jordan Liggitt
ef5f95859e Bump sigs.k8s.io/structured-merge-diff/v6
Kubernetes-commit: 8a5c4d9d58739782de5b142c77d08d8fb459372c
2026-04-14 14:27:54 -04:00
Kubernetes Publisher
14ef437cc6 Merge pull request #139001 from jpbetz/bump-kube-openapi-for-revert
Bump kube-openapi to pick up #609

Kubernetes-commit: 34e600ec497ff6bd81a0c6c98b0f764900fa2643
2026-05-13 02:45:26 +00:00
Joe Betz
f49c3b763f Bump kube-openapi to pick up API Definitions revert
Kubernetes-commit: 89549643b89eefccefdf1d30bb328e74914614c9
2026-05-12 11:09:49 -04:00
Kubernetes Publisher
11948c1336 Merge pull request #138657 from jpbetz/codegen-discovery
Enable validation-gen for all existing and future APIs

Kubernetes-commit: 553312e6c22a6a9c176f5530a18691c7f03b126d
2026-05-12 22:44:53 +00:00
Joe Betz
63b2f68438 Explicitly disable validation-gen where not needed
Kubernetes-commit: 9d65aeabb631d387ef1da15c0765eb8e297fb6aa
2026-05-07 17:49:35 -04:00
Kubernetes Publisher
ca52b81a29 Merge pull request #138931 from Jefftree/bump-kube-openapi
Bump kube-openapi to latest

Kubernetes-commit: 50bda3a6bf90bfa8157522cda5e91ffb0194f92f
2026-05-09 20:51:01 +00:00
Jefftree
c2ce71e1e5 Bump kube-openapi to 312035bf509b
Kubernetes-commit: 58400287bc6f58e228d5cecb798b04f2710ad7cc
2026-05-09 12:04:54 -04:00
Kubernetes Publisher
0582d760ec Merge pull request #138271 from Jefftree/remove-agg-v2beta1
Remove v2beta1 aggregated discovery support from clients

Kubernetes-commit: 5ad5004d594a97495d6005513787a54b5aa2972b
2026-05-07 20:50:23 +00:00
Kubernetes Publisher
0a31f6e5eb Merge pull request #138759 from soltysh/drop_job_features
Drop job features

Kubernetes-commit: af6d86c7cc933ce1ff7159bad1eceaf9a60144e3
2026-05-07 16:50:18 +00:00
Kubernetes Publisher
24705f39ff Merge pull request #138819 from skitt/goyaml-yaml-v2.4.4
Bump go.yaml.in/yaml/v2 to 2.4.4

Kubernetes-commit: 43fe7b425091a6581e0f6777ef89a215e229eebb
2026-05-06 20:50:28 +00:00
Stephen Kitt
f2e82a9540 Bump go.yaml.in/yaml/v2 to 2.4.4
This only changes tests to drop gopkg.in/check.v1, which helps our
dependency tree a little.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: edf0df348c217271f4ed7acee3b436c27e71df88
2026-05-06 18:24:52 +02:00
Kubernetes Publisher
d7e05a3637 Merge pull request #138786 from dims/update-x-packages
Update golang.org/x/* dependencies

Kubernetes-commit: 5d6e917ac112bf7f2b139da77c2e765784473bb2
2026-05-06 00:50:27 +00:00
Davanum Srinivas
818cfeb954 Update golang.org/x/* dependencies
- golang.org/x/exp: 944ab1f22d93 -> 746e56fc9e2f
- golang.org/x/mod: v0.34.0 -> v0.35.0
- golang.org/x/oauth2: v0.35.0 -> v0.36.0
- golang.org/x/time: v0.14.0 -> v0.15.0
- golang.org/x/tools: v0.43.0 -> v0.44.0

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4b0e01df008f9f44bab98b0712ede29fdb6f4ccb
2026-05-05 07:22:08 -04:00
Kubernetes Publisher
535f2d0806 Merge pull request #138722 from qflen/fix/mountpath-doc-colon-129453
Fix v1.VolumeMount.MountPath doc to match validator (allow ':')

Kubernetes-commit: 209d50cef164494dc18586aca0bd082914e677ab
2026-05-04 20:50:03 +00:00
Kubernetes Publisher
14ae5b45e1 Merge pull request #138741 from dims/update-kube-openapi
bump k8s.io/kube-openapi to v0.0.0-20260502001324-b7f5293f4787

Kubernetes-commit: 0fe8ee192270e99e222cf04fb6492a4c584690eb
2026-05-04 20:50:00 +00:00
Maciej Szulik
e7adb43e4b Generated changes
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 978f5741d81a448fd7e4339e5ca99c8c75c92862
2026-05-04 16:45:18 +02:00
Davanum Srinivas
47b7dd6ca6 bump k8s.io/kube-openapi to v0.0.0-20260502001324-b7f5293f4787
Updates k8s.io/kube-openapi across all staging modules and vendors the new
revision. Key changes upstream:

- builder/openapi.go, builder3/openapi.go: use common.EscapeJsonPointer()
  when keying definition names into swagger.Definitions / spec.Components.Schemas,
  fixing incorrect lookups for types whose names contain JSON-Pointer-reserved
  characters (e.g. '/', '~').

- pkg/generators/apidefinitions/loader.go (new): LoadAPIVersion() reads an
  apiversion.yaml from a source-tree directory and validates its TypeMeta,
  providing a declarative way to describe API versions in-tree.

- pkg/generators/apidefinitions/types.go (new): APIVersion type that carries
  the schemeGroupVersion / kindAPIVersion metadata consumed by the loader.

- pkg/generators/config.go, openapi.go, model_names.go: minor generator
  improvements accompanying the apidefinitions loader addition.

- pkg/generators/rules/list_type_streaming_tags.go: streaming-tag rule fix.

- pkg/schemaconv/openapi.go, proto_models.go: schema conversion cleanups.

- pkg/validation/validate/result.go: validation result cleanup.

Previous version: v0.0.0-20260317180543-43fb72c5454a
New version:      v0.0.0-20260502001324-b7f5293f4787

Kubernetes-commit: eaf347cecb168ee85fc77ffc9a5cda4eb99ce1ca
2026-05-01 20:50:32 -04:00
Kimon N
b46a0c233f Fix v1.VolumeMount.MountPath doc to match validator (allow ':')
The v1.VolumeMount.MountPath doc claims the path must not contain
':', but the validator does not enforce this. The internal type in
pkg/apis/core/types.go carries no such constraint, and existing
TestValidateVolumeMounts success cases use mountPath values like "d:",
"F:", and "G:\mount".

This is a doc-only change. The validator is unchanged; the public doc
now matches what the validator actually accepts. Regenerated proto and
openapi snapshots to propagate the doc update.

Signed-off-by: Kimon N. <nkimon00@gmail.com>

Kubernetes-commit: 6691ecaf2f5ce3076f3c61eca5355cc99535d1bd
2026-04-30 22:51:30 +02:00
Kubernetes Publisher
98a97d3bea Merge pull request #136709 from gzb1128/dra-cel-no-such-key-error-enhancement
DRA: improve CEL error message for "no such key" errors

Kubernetes-commit: c485ef21ab23ba1a244b2c9843868f1a6da54060
2026-04-29 19:15:56 +00:00
Kubernetes Publisher
224d0b9220 Merge pull request #138576 from p0lyn0mial/upstream-reflector-list-trace-obj-count
client-go/reflector: Add object count to reflector "Objects listed" trace step

Kubernetes-commit: 5ce17ed71b124a8c89414f929a58d536e008cce7
2026-04-28 11:16:22 +00:00
Kubernetes Publisher
f854ec26d2 Merge pull request #138340 from pacoxu/bump-unwanted
bump stretchr/objx to v0.5.3

Kubernetes-commit: ef1853d811fb004f24e73494b1753b7beb977390
2026-04-27 19:13:58 +00:00
Paco Xu
d0e1111cfa bump github.com/stretchr/objx to v0.5.3
Kubernetes-commit: 8730b0ebc99d0554e318138d2c83370a6bdef12c
2026-04-27 14:59:42 +08:00
Kubernetes Publisher
fbda1bea62 Merge pull request #138573 from dims/update-go-openapi-deps-rebase
Update go-openapi dependencies (jsonpointer, jsonreference, swag)

Kubernetes-commit: e9b95827ebf963f7bab0a1a8ddd90e408858c892
2026-04-26 03:13:14 +00:00
Kubernetes Publisher
34c8061b60 Merge pull request #138393 from humblec/bump-etcd-sdk-3.6.10
etcd: bump etcd sdk to v3.6.10

Kubernetes-commit: e1cf06b9b41f3534fd1ce475a18ef20d46e8f876
2026-04-25 15:17:53 +00:00
Humble Devassy Chirammal
cb70ef072c etcd: bump etcd sdk to v3.6.10
Bump go.etcd.io/etcd/{api,client/pkg,client,pkg,server}/v3 from v3.6.8 to v3.6.10.
go.etcd.io/etcd/raft/v3 is intentionally left unchanged (separate release cadence).

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>

Kubernetes-commit: 15492a41ed637237cf1891ef140544f64197643d
2026-04-25 09:08:49 +05:30
Kubernetes Publisher
9c68566d66 Merge pull request #138295 from kencochrane/retrywatcher-downgrade-410-gone-log
client-go/tools/watch: downgrade 410 Gone error to V(4) debug log in RetryWatcher

Kubernetes-commit: 301946d15e67a4a2e8a5fb8292eb836acd366d78
2026-04-24 19:14:37 +00:00
Lukasz Szaszkiewicz
768b463699 client-go/reflector: add object count to "Objects listed" trace step
Kubernetes-commit: c83716b7885647e089cd44f74090caaf95da7be6
2026-04-24 16:40:12 +02:00
Davanum Srinivas
236db84a02 Update go-openapi dependencies (jsonpointer, jsonreference, swag)
Bump go-openapi dependencies to latest versions:
- github.com/go-openapi/jsonpointer v0.21.0 → v0.22.4
- github.com/go-openapi/jsonreference v0.20.2 → v0.21.4
- github.com/go-openapi/swag v0.23.0 → v0.25.4

The new swag version has been restructured into a multi-module monorepo
with submodules (cmdutils, conv, fileutils, jsonname, jsonutils, loading,
mangling, netutils, stringutils, typeutils, yamlutils). As a result:
- mailru/easyjson and josharian/intern are no longer transitive deps
  and have been removed from vendor
- go-openapi/jsonpointer and go-openapi/swag no longer reference
  unwanted deps davecgh/go-spew, mailru/easyjson, or gopkg.in/yaml.v3
- Updated hack/unwanted-dependencies.json accordingly

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 693dc57f5753ce69f7d3f49f26bfefc9554e47e6
2026-04-24 08:13:31 -04:00
Kubernetes Publisher
5834c79c33 Merge pull request #138562 from dims/update-cbor-dep
Update github.com/fxamacker/cbor/v2 to v2.9.1

Kubernetes-commit: 6e4605d14e04ea9681b6dd6b5729c788e28e89b7
2026-04-24 11:13:58 +00:00
Kubernetes Publisher
1f2893e611 Merge pull request #138561 from dims/update-xnet-dep
Update golang.org/x/net to v0.53.0

Kubernetes-commit: 1f22abeebcb4e1ecae2f3dbcf3f0cd747ecfb3d6
2026-04-24 11:13:55 +00:00
Davanum Srinivas
ab9883c3cd Update github.com/fxamacker/cbor/v2 to v2.9.1
Parser hardening for the kube-apiserver CBOR deserializer (PRs #750,
#753, #757): fixes tag-1 epoch float64 overflow into time.Time fields
(directly reachable via DecTagOptional decode path), RawMessage clone
defense, and keyasint type-confusion fixes.

Kubernetes-commit: dc29a934e460eb29130de6724787ca1b677e31e0
2026-04-23 21:43:02 -04:00
Davanum Srinivas
e584095d82 Update golang.org/x/net to v0.53.0
Fixes CVE-2026-33814 (golang/go#78476): HTTP/2 Transport hangs
indefinitely when a peer sends a SETTINGS frame with MaxFrameSize=0.
This is reachable from kube-apiserver's OIDC, admission webhook,
and aggregated API client paths.

Kubernetes-commit: 12a2470693d86f63f4614048ffdd43dc393dd7e0
2026-04-23 21:36:05 -04:00
Ken Cochrane
fd78cbf903 client-go/tools/watch: downgrade 410 Gone error to V(4) debug log in RetryWatcher
Also check apierrors.IsResourceExpired in addition to IsGone.

Kubernetes-commit: 08e07a914281cda80b8541b444b6d6f1f8e754e2
2026-04-23 18:23:46 -04:00
Kubernetes Publisher
af852a6051 Merge pull request #138192 from skitt/otel-1.42
Bump otel to 1.43.0 and contrib to 0.68.0

Kubernetes-commit: 5ed1fd971d594a3cda7f7e26cd037e8be37f520f
2026-04-23 18:47:31 +00:00
Jefftree
d59f4e8465 Remove aggregated discovery v2beta1 client-side references
Kubernetes-commit: 6d48f50dcf41c11c72f511ca51b5aa8b580782af
2026-04-08 10:44:27 -04:00
Stephen Kitt
54edeb4bfe Bump otel to 1.43.0 and contrib to 0.68.0
See
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.43.0
and
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.43.0
for details.

otelgrpc no longer produces "messages" span events so these are
removed from the tracing test.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 1a63916abee48d6356fbc2e6965433647e6cf073
2026-04-03 10:10:53 +02:00
Kubernetes Publisher
3273f3d7b7 Merge pull request #135708 from michaelschiff/informer-generated-docs
informer-gen generated comments reference non-existent method

Kubernetes-commit: 88bf9c97c4285de0d83e227159a9698015b3927e
2026-04-23 10:26:23 +00:00
Kubernetes Publisher
9dcacd934a Merge pull request #138070 from Jefftree/deprecate-multilock
Deprecate MultiLock in client-go leader election

Kubernetes-commit: cb9696a5c4ab8a45a741ef76017a38e31d6a010e
2026-04-23 02:24:21 +00:00
Kubernetes Publisher
f596361399 Merge pull request #135336 from carlory/clean-AnyVolumeDataSource
[1.37] Remove feature gate AnyVolumeDataSource

Kubernetes-commit: cbd6fe51c906f32ebbaa5970e449264470965e6f
2026-04-22 22:26:57 +00:00
Kubernetes Publisher
3c8a6967ba Merge pull request #138354 from dims/update-moby-spdystream-v0.5.1
Update github.com/moby/spdystream from v0.5.0 to v0.5.1

Kubernetes-commit: 02b979213695b4e3d707ceb5a79095ae7d81b7a0
2026-04-14 14:38:51 +00:00
Davanum Srinivas
6e6322efd1 Update github.com/moby/spdystream from v0.5.0 to v0.5.1
Kubernetes-commit: 7e9c2c8eef26f99aa2f94d8e09d6d32de86c7769

Kubernetes-commit: f6209104d25a6c0ea7605a73b9ec4085aacbca03
2026-04-13 13:57:52 -04:00
Jefftree
53b6fdc0a0 Deprecate MultiLock, UnknownLeader, and ConcatRawRecord in client-go leader election
Kubernetes-commit: 875a572f25bb7da59ccaf487d889658a10448a63
2026-03-27 15:06:39 -04:00
Kubernetes Publisher
b5cc94ef3b Merge pull request #136589 from tosi3k/preemption-mode
Add Workload-Aware Preemption fields to Workload and PodGroup APIs

Kubernetes-commit: c1ebc2c3e2f6aa1e4a5f8be5e2f78763d0da29eb
2026-03-24 11:02:08 +00:00
gzb1128
6fd7c180ef DRA: add hint for CEL "no such key" errors
When CEL expressions access non-existent map keys, add a helpful hint
suggesting optional chaining (.? followed by orValue()) or has() macro.

Kubernetes-commit: 5e2d5b9a621109bd89f2dbc4092e0123ab500c85
2026-03-24 16:09:26 +08:00
Antoni Zawodny
1f6e0f4541 Add Workload-Aware Preemption fields to Workload and PodGroup APIs
Co-authored-by: Omar Sayed <omarsayed@google.com>

Kubernetes-commit: 59c9f75133f22ed24e944cf0b8a1a68e1c49af32
2026-03-12 17:25:06 +01:00
Kubernetes Publisher
df2d882697 Merge pull request #136989 from nojnhuh/podgroup-resourceclaim
KEP-5729: DRA: ResourceClaim Support for Workloads

Kubernetes-commit: b5a943f629904bda73a8f6784ad3cd8325ead57c
2026-03-23 19:02:58 +00:00
michaelschiff
71d7d2af1e run ./hack/udpate-codegen.sh
Kubernetes-commit: f4b14448e917dc384e071329c400b747eba77995
2026-02-13 11:53:32 -08:00
Jon Huhn
4eece5291a Workload API: PodGroup ResourceClaims (KEP-5729)
Kubernetes-commit: d80f384b702e4c6630e6f46b2926ab5e45553c97
2026-02-10 14:42:04 -06:00
Kubernetes Publisher
3d35c51207 Merge pull request #137190 from everpeace/KEP-5491-alpha
KEP-5491: DRA: List Types for Attributes [Alpha]

Kubernetes-commit: ef247770b50e7105eb7453c8bfd5279b5a3656ae
2026-03-21 11:02:46 +00:00
Kubernetes Publisher
0434117726 Merge pull request #137028 from nmn3m/feature/dra-resource-pool-status
KEP-5677: Add ResourcePoolStatusRequest API for DRA resource availability visibility

Kubernetes-commit: 15eaed180f8f4d1a6188922a8258392896f7dc4c
2026-03-21 03:02:38 +00:00
Nour
ba785be0ac Drop CSR analogy, mark ObjectMeta +required,reduce limits (maxItems=500, maxLength=128) for etcd safety, add Errors printer column
Signed-off-by: Nour <nurmn3m@gmail.com>

Kubernetes-commit: 8b9159baa41418bcc62592e9da3b878e7cd138ca
2026-03-18 05:17:28 +02:00
Nour
4a9c8783a9 Add ResourcePoolStatusRequest API types and generated code
Introduce the ResourcePoolStatusRequest resource type in the
resource.k8s.io/v1alpha3 API group, gated behind the
DRAResourcePoolStatus feature gate. This includes external and internal
type definitions, protobuf/OpenAPI generated code, client-go typed
clients, informers, listers, apply configurations, deepcopy, defaults,
conversion, fuzzer, declarative validation tags, and API discovery
metadata.

Kubernetes-commit: 29601b8628ac8ea512960bc373511ae46888e502
2026-03-17 14:25:06 +02:00
Kubernetes Publisher
0131054016 Merge pull request #137753 from adamkasztenny/fix-lease-optimistic-update-log-level-v2
Reduce log level for optimistic lease update fallback

Kubernetes-commit: 158b69d2234f2b07ba7b6c5e182fa9df417bdf73
2026-03-19 04:26:11 +00:00
Kubernetes Publisher
9b29e67df1 Merge pull request #136355 from enj/enj/i/tls_cache_gc
Add GC to client-go TLS cache

Kubernetes-commit: bf1abbf2e987883ffacaaf6f84218bcbfd444876
2026-03-19 04:26:09 +00:00
Kubernetes Publisher
4c2ee9a3e2 Merge pull request #136725 from pravk03/native-dra-2
Introduce support of DRA for Native Resources

Kubernetes-commit: 7a3a6cf4be719a2eaed14e48a701cbdd2f0e8400
2026-03-19 00:05:16 +00:00
Kubernetes Publisher
2fb6b9cac0 Merge pull request #137849 from bryantbiggs/deps/update-kube-openapi
deps: Update `kube-openapi` to drop `ginkgo/gomega` indirect deps

Kubernetes-commit: ec68099e62c85901c8d225705d55adfac26cf69d
2026-03-18 20:05:15 +00:00
Praveen Krishna
b2267f3d75 make update
Kubernetes-commit: f266fe4118e52605ba9cf02e1ab2ed68988d56e9
2026-03-18 14:18:22 +00:00
Bryant Biggs
382d307f87 dependencies: bump kube-openapi to drop ginkgo/gomega indirect deps
Bump k8s.io/kube-openapi to pick up kubernetes/kube-openapi#579 which
moved the last ginkgo/gomega tests to stdlib testing and ran go mod
tidy, removing ginkgo/gomega from kube-openapi's go.mod.

This drops ginkgo/gomega as indirect deps from apimachinery. It also
prunes Masterminds/semver, google/pprof, and golang.org/x/tools from
client-go and other staging modules where they were only needed
through kube-openapi's ginkgo/gomega chain.

Contributes to kubernetes/kubernetes#127888

Kubernetes-commit: 56cd74d879f1ba11aadcff95326f17a1cc2c82ef
2026-03-18 09:09:11 -05:00
Kubernetes Publisher
6c21384776 Merge pull request #137795 from ttsuuubasa/dra-binding-conditions-beta
DRA Device Binding Conditions: graduate to beta

Kubernetes-commit: 0d28578de14fce641a39d6415d2068e1f39283a4
2026-03-18 16:07:10 +00:00
Tsubasa Watanabe
69d2e66589 DRA Device Binding Conditions: run make update
Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>

Kubernetes-commit: 6bf9cd5053cf9b2b2b9ef7045a6705f928c949c6
2026-03-17 21:31:32 +09:00
Kubernetes Publisher
bb93391625 Merge pull request #137836 from BenTheElder/fix-api
Fix API serialization compatibility regression in VolumeMountStatus

Kubernetes-commit: a1293fe6b1e423869a28e35b5b8c297e2a6f3b5f
2026-03-18 04:04:24 +00:00
Kubernetes Publisher
828813ca69 Merge pull request #137271 from brejman/tas-constraints
KEP-5732: Add SchedulingConstraints to PodGroup API and use them in TopologyPlacement plugin

Kubernetes-commit: 299ab0d68a9d70b3c39d63210de47ac01d18e74b
2026-03-18 00:05:16 +00:00
Benjamin Elder
27bd9ce449 hack/update-codegen.sh
Kubernetes-commit: 9f60cc3c4e8ddb373b1816a7e28b159db08f6a30
2026-03-17 16:23:57 -07:00
Shingo Omura
15a9dffb52 KEP-5491: generated code for list attribute fields in DeviceAttribute API ("make update"-ed)
Kubernetes-commit: 3902f5611f29a80dad6c43618c1d87af7baa9637
2026-03-16 19:03:01 +09:00
Adam Kasztenny
ea7a7e7cf9 Reduce log level for optimistic lease update fallback
The "Failed to update lease optimistically, falling back to slow path"
message was logged at Error level, but this is expected behavior during
normal leader election when the optimistic update encounters a conflict.
The system gracefully falls back to the slow path (Get + Update), so
this is not a real error. Downgrade to V(2) Info to reduce log noise.

Kubernetes-commit: 04977a0ea4592bfaa70d5095a4cfe99dd4b847e1
2026-03-14 16:51:49 -04:00
Bartosz
61a40f5111 Add scheduling constraints to v1alpha2 pod group api
Add plugin to generate placements based on scheduling constraints

Co-authored-by: Antoni Zawodny <zawodny@google.com>

Kubernetes-commit: d9da8c7c4a25cee553720737fdec07006e063da1
2026-02-25 16:36:07 +00:00
Kubernetes Publisher
39f55294aa Merge pull request #137454 from haircommander/proc-mount-ga
KEP-4265: feature: promote ProcMountType to GA

Kubernetes-commit: 040ca59611d5bb5976ad4cb47f1e80f8c877d0d8
2026-03-17 08:00:09 +00:00
Peter Hunt
c73e37f377 proc mount: drop featuregate note on API
Signed-off-by: Peter Hunt <pehunt@redhat.com>

Kubernetes-commit: 389825754c8d3fe4292c38facc0bbb80ec8efdfd
2026-03-13 15:20:49 -04:00
Kubernetes Publisher
9dc763689d Merge pull request #137298 from dims/dsri/cri-streaming-option-a-hardcut
cri streaming option a hardcut - add new staging repositories `streaming` and `cri-streaming`

Kubernetes-commit: 2bd6c7fe3cb8663804dc6e7672ff01aeebc97274
2026-03-17 07:59:59 +00:00
Kubernetes Publisher
c07c271a94 Merge pull request #137398 from Rajneesh180/fix-client-go-nil-event-key-v4
client-go: fix goroutine hot-loop in StartEventWatcher on broadcaster shutdown

Kubernetes-commit: 8ebee69b1587a71efb23144300dcf34bdbf2d3b3
2026-03-12 20:51:03 +00:00
Kubernetes Publisher
2517e8773a Merge pull request #137170 from pohly/dra-device-taints-beta
DRA device taints: graduate to beta

Kubernetes-commit: 4e2bbc78bf097afa70b67cb2814623558ab5f0b4
2026-03-12 20:51:02 +00:00
Kubernetes Publisher
3505da0deb Merge pull request #136792 from rata/userns-goes-ga
feature: Migrate UserNamespacesSupport to GA

Kubernetes-commit: f7f694e5e066149a41a7f94394f84977fc6d0ea6
2026-03-12 20:51:00 +00:00
Kubernetes Publisher
97ac09639d Merge pull request #137419 from michaelasp/rvInformerMetrics
Add metric tracking the latest cached rv of informers

Kubernetes-commit: fdbea745459cc570d8fc975c5fcbe42511472aea
2026-03-11 00:39:29 +00:00
Kubernetes Publisher
9cdd63fee2 Merge pull request #137343 from gnufied/prevent-podscheduling-optin
Add API changes to prevent pod scheduling via CSIDriver object

Kubernetes-commit: d47f3f253bcd462a5bfe40625de09fb3a4bc5f2b
2026-03-11 00:39:28 +00:00
Kubernetes Publisher
32a3ac47cf Merge pull request #137495 from pohly/klog-update
dependencies: klog v2.140.0

Kubernetes-commit: 9d0495ec93f7942b9fd6482df79820376a447eee
2026-03-10 16:39:19 +00:00
Kubernetes Publisher
e807f52104 Merge pull request #136435 from Jefftree/leaderelection-client-efficiency
Update leasecandidate client to read from cache

Kubernetes-commit: 4e3e58ffbe28674a5125cff183e8dacf97b07775
2026-03-10 16:39:14 +00:00
Antoni Zawodny
a179e3b9fb Create Workload API v1alpha2 (#136976)
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API

* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API

Co-authored-by: yongruilin <yongrlin@outlook.com>

* Run hack/update-codegen.sh

* Adjust kube-scheduler code and integration tests to v1alpha2 API

* Drop v1alpha1 scheduling API group and run make update

---------

Co-authored-by: yongruilin <yongrlin@outlook.com>

Kubernetes-commit: 3f094dc228318b89f1fef313543b960e35ca6e3e
2026-03-10 04:41:24 +00:00
Kubernetes Publisher
4bf554630d Merge pull request #132922 from yt2985/client-fix
Fix the client-go issue of reloading trust root CAs.

Kubernetes-commit: a01d2e6cd45f7a299b56cacdd8a2d35078bef9b6
2026-03-10 04:41:20 +00:00
Hemant Kumar
2e882c6ea6 Update comment and regenerate API docs
Kubernetes-commit: dede11365be89384facd8226bb547f186446bee5
2026-03-09 12:01:46 -04:00
Kubernetes Publisher
6f2c112d22 Merge pull request #137497 from atombrella/feature/modernize_activate_forvar
Lint: Activate modernize/forvar rule in golangci-lint.

Kubernetes-commit: 090693bd79c405df9122179f5e399adf77b8c023
2026-03-09 12:38:51 +00:00
Kubernetes Publisher
2f31bfec5d Merge pull request #135048 from yliaog/beta_promo
DRA Extended Resource: promote to Beta in 1.36

Kubernetes-commit: f5bafe93ac3edd34de7eb9d59bde9043201c43e5
2026-03-06 20:26:31 +00:00
Patrick Ohly
88da827ca3 dependencies: klog v2.140.0
klog hasn't been updated in Kubernetes for a few releases. Several
enhancements have accumulated that are worth having.

Kubernetes-commit: 56e0565c113107bdea398b075aba5bdef43489ed
2026-03-06 17:43:11 +01:00
Kubernetes Publisher
c826020ed9 Merge pull request #137358 from xigang/processlister_log
client-go/cache: add slow-handler tracing in processorListener

Kubernetes-commit: 1f5701a46d6edeb396531968dc8ed332bf69e5f4
2026-03-06 08:24:26 +00:00
Kubernetes Publisher
c3a1049f7e Merge pull request #137456 from liggitt/go126
Update go.mod to go 1.26, fix 1.26 vet errors

Kubernetes-commit: 800a58b7c515b3d5e2677f6af37f9ece186b67c0
2026-03-06 08:24:25 +00:00
Kubernetes Publisher
989fb5d38c Merge pull request #137473 from jpbetz/fix-set-transform
Fix SetTransform to correctly override per-informer transforms

Kubernetes-commit: 3dceb579f797c88564d03a7bdf91ba8108ffd820
2026-03-06 08:24:22 +00:00
Kubernetes Publisher
294ecb1d8c Merge pull request #137304 from aaron-prindle/fieldsv1-encapsulation
refactor: fieldsv1 encapsulation via accessors and deprecation of direct "Raw" field usage

Kubernetes-commit: 4915f3f8b38318826654199003775d348d3cdafb
2026-03-06 04:24:12 +00:00
Joe Betz
c7f8506da0 Fix informer factory generation and add test
Kubernetes-commit: c0addb352e284feda34667f0a36c06da9f1cf2a6
2026-03-05 20:06:01 -05:00
Kubernetes Publisher
78536fe27c Merge pull request #137451 from dims/update-google-protobuf-deadcode-fix
Update google.golang.org/protobuf to v1.36.12-0.20260120151049-f2248ac996af to prevent file size explosion in go 1.26

Kubernetes-commit: 77c013637cb40e1b5d2b26664dc7b297f1ff2693
2026-03-05 20:24:49 +00:00
Rita Zhang
06163fb266 Move DRAAdminAccess feature to GA (#137373)
* Move DRAAdminAccess feature to GA

Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>

* address comments

Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>

---------

Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>

Kubernetes-commit: c4f88de33e02882e758da8667cfcaf939ed7bc1a
2026-03-05 20:24:46 +00:00
Davanum Srinivas
388997a877 Update google.golang.org/protobuf to v1.36.12-0.20260120151049-f2248ac996af
Pins google.golang.org/protobuf to HEAD commit f2248ac996afc39b3df0777cdcc269f6ade50b07
(v1.36.12-0.20260120151049-f2248ac996af) which includes fixes for dead code
elimination issues surfaced by Go 1.26's reflect changes.

Xref: https://github.com/golang/protobuf/issues/1704
Xref: https://github.com/kubernetes/kubernetes/issues/137445
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: c8826e0d235fde75d02643bd700179ed79897ad6
2026-03-05 09:36:13 -05:00
Kubernetes Publisher
a72ad3ccbc Merge pull request #137349 from Jefftree/fix-model-name-bounding-dirs
Pass --readonly-pkg to openapi-gen in kube_codegen.sh

Kubernetes-commit: ef8a14f679491f858968f49a847c393a3a3fc5e2
2026-03-05 04:26:03 +00:00
Kubernetes Publisher
9f41e94324 Merge pull request #137066 from cnuss/fix/issues/136823
client-go/cache: fix logging

Kubernetes-commit: 8020ce8511aab076f939b104c973b84cb7a1afc3
2026-03-05 00:25:36 +00:00
Mads Jensen
d91024383a Lint: Activate modernize/forvar rule in golangci-lint.
Kubernetes-commit: dd32d7c324b97d259b99c1464802d9e3ca706a94
2026-03-05 00:11:40 +01:00
Michael Aspinwall
aae801378e Add metric tracking the latest cached rv of informers
Kubernetes-commit: 9fb9e933b2ebae2d94edd29b7dec2c1df9e625a6
2026-03-04 22:13:54 +00:00
Aaron Prindle
3e4de9e6b4 refactor: update in-tree FieldsV1 consumers to use format-specific accessors
Kubernetes-commit: e57b3a74f37754c9455a3debafd25c88d434e69d
2026-03-04 21:44:21 +00:00
Jefftree
e45d8623ff update kube-openapi
Kubernetes-commit: 721eea74e75dc95bafbfa450bb2309e494abf45c
2026-03-04 15:33:47 -05:00
Rajneesh180
187c42c884 client-go: guard ResultChan() close in StartEventWatcher
When watch.Broadcaster.Shutdown() is called it drains all queued events
then calls closeAll(), which closes every watcher's result channel.
eventBroadcasterImpl.Shutdown() calls Broadcaster.Shutdown() first,
then calls the cancellation context's cancel() function.  Between those
two steps there is a window in which the result channel is closed while
the cancellation context is still live.

Without the two-value channel receive the goroutine in StartEventWatcher
would spin on the already-closed channel: each select iteration
immediately receives the zero-value watch.Event, the type assertion
fails (nil interface, ok == false), and the loop continues burning CPU
until the select scheduler eventually picks the cancelationCtx.Done()
case.

Guard against this by reading the ok boolean from the channel receive:

  case watchEvent, ok := <-watcher.ResultChan():
    if !ok {
      return
    }

This is the correct and idiomatic Go pattern for a channel that may be
closed by its producer.  Note that when this return path is taken the
broadcaster has already delivered every queued event (Broadcaster.Shutdown
blocks until the distribute loop exits before closeAll runs), so no
events are silently dropped.

Add a regression test (TestStartEventWatcherExitsOnDirectShutdown) that
creates a broadcaster without an external context so Shutdown() is
fully synchronous, starts a watcher, and verifies the goroutine exits
cleanly via goleak.VerifyNone.

Signed-off-by: Rajneesh180 <rajneeshrehsaan48@gmail.com>

Kubernetes-commit: 95c15b54069922b0a66c198a064577ea0a160694
2026-03-04 16:05:26 +05:30
Kubernetes Publisher
2dd466fcfe Merge pull request #137291 from everettraven/upstream/dv/maxLength-fixup
[Declarative Validation] Bring `k8s:maxLength` tag in line with OpenAPI `maxLength` validation semantics

Kubernetes-commit: e08e598df07bc929679ef046418992a8205da18f
2026-03-04 00:25:37 +00:00
Kubernetes Publisher
486be0fbf9 Merge pull request #135196 from harche/i133202
KEP-4680: Add message field support to DRA device health reporting

Kubernetes-commit: be6162afb876e60ded92780786519c976fc0be08
2026-03-03 20:25:21 +00:00
Kubernetes Publisher
e243a98fa8 Merge pull request #137167 from pohly/dra-device-taints-update-timestamp
DRA device taints: automatically bump TimeAdded when changing effect

Kubernetes-commit: 13010f06b270df96c4f558bdadcad93970000a53
2026-03-03 20:25:19 +00:00
xigang
f6c2d7ca65 client-go/cache: add slow-handler tracing in processorListener
Signed-off-by: xigang <wangxigang2014@gmail.com>

Kubernetes-commit: ac1eb12281bdc7fb7e0269fb4bb914369b92bb64
2026-03-03 13:07:08 +08:00
Kubernetes Publisher
55e741a004 Merge pull request #137296 from michaelasp/fixListenerDeadlock
Fix listener deadlock in shared informer

Kubernetes-commit: 1879769b9354b6e47a13dac831aec6fe3e0368b6
2026-03-03 00:24:45 +00:00
Hemant Kumar
27966b2574 Update generated code
Kubernetes-commit: 143c56ddeb8ba470102d5145bbfafca898999763
2026-03-02 17:00:43 -05:00
tinatingyu
8776b282cc client-go CA rotation
Kubernetes-commit: b806a3207beb1afabc3d3d93fbadba38ffb8a110
2026-03-02 20:40:00 +00:00
Davanum Srinivas
9926c67348 staging: extract CRI streaming modules with client-go compatibility
Extract streaming code into dedicated staging modules while keeping stable
compatibility APIs for external client-go consumers.

This commit:
- adds `k8s.io/cri-streaming` for CRI exec/attach/portforward server code
- adds `k8s.io/streaming` as the canonical home for shared transport
  primitives (`httpstream`, `spdy`, `wsstream`, runtime helpers)
- switches in-tree transport consumers to `k8s.io/streaming`
- removes in-tree kubelet CRI streaming package
- preserves NO_PROXY/no_proxy CIDR handling in extracted SPDY proxier logic
- adds deprecated `k8s.io/apimachinery/pkg/util/httpstream` compatibility
  wrappers (`httpstream`, `spdy`, `wsstream`) backed by `k8s.io/streaming`
- restores exported client-go SPDY/portforward API signatures to
  apimachinery `httpstream` types for downstream compatibility
- adds streaming-native client-go adapters/constructors so in-tree callers
  can use `k8s.io/streaming` without changing external compatibility APIs
- deduplicates SPDY-over-websocket dial negotiation shared by compat and
  streaming tunneling dialers
- logs dropped unknown stream types in `RemoveStreams` adapter fallbacks to
  improve compatibility-path debuggability
- adds integration coverage for the streaming-upgrader-to-client-go-compat
  adapter path against a real cri-streaming exec endpoint
- clarifies kubectl streaming import aliasing to avoid `httpstream` package
  ambiguity
- updates tests, import restrictions, publishing metadata, and vendor/module
  metadata for the new staging modules

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 1ee1ff97fb7f9755a44d29bee0c80d2ccbed68dc
2026-02-28 19:40:07 -05:00
Eddie
c86837f7ed Promote sig-storage feature MutableCSINodeAllocatableCount to GA (#136230)
* Promote MutableCSINodeAllocatableCount to GA

Signed-off-by: Eddie Torres <torredil@amazon.com>

* Lock MutableCSINodeAllocatableCount feature gate to default

Signed-off-by: Eddie Torres <torredil@amazon.com>

---------

Signed-off-by: Eddie Torres <torredil@amazon.com>

Kubernetes-commit: 41bb4b6a8b4e0f15ab7ffcc6369c68bc599fb957
2026-02-28 08:42:18 +00:00
Kubernetes Publisher
2f21ae3478 Merge pull request #137272 from pmengelbert/pmengelbert/kuberc_name_to_command/1
Rename `name` to `command` in kuberc credentialPluginAllowlist entries

Kubernetes-commit: cf876463cdf5571d2051096859779d9d210074b3
2026-02-27 20:42:02 +00:00
Bryce Palmer
b59431fbc5 update-codegen: regenerate generated files
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

Kubernetes-commit: 729792e8700780f9cfbb4a14e74621ef219444c1
2026-02-27 15:23:12 -05:00
Michael Aspinwall
54ee8fecae Fix deadlock when listeners get added before processing starts
Kubernetes-commit: 0ce498ff21296f44dfa980d8679c0b7697e2d6b8
2026-02-27 18:55:39 +00:00
Kubernetes Publisher
f037d681ac Merge pull request #137286 from humblec/update-vendored-dependencies
Update vendored dependencies ( gomega/cadvisor)

Kubernetes-commit: 3f2ebc50eecfaeda23df4435dc82422fa65425ed
2026-02-27 16:41:07 +00:00
Humble Devassy Chirammal
99791c7452 dependencies: bump gomega to v1.39.1 and ginkgo to v2.28.1
Kubernetes-commit: 600d188f2b02eea974509062c04186309065ff16
2026-02-27 15:48:21 +05:30
Kubernetes Publisher
1f07d6645b Merge pull request #137189 from dhruv7539/codex/getlogs-reactor-support
client-go: make fake Pods.GetLogs honor reactors

Kubernetes-commit: 44b486f43c9792e812f849d9509449ac69edf55c
2026-02-27 03:58:18 +00:00
Kubernetes Publisher
efbad1b7ed Merge pull request #135775 from bitoku/no-noexec
Update OCI image volume type description to remove "noexec" attribute

Kubernetes-commit: 7d70fe491d50ebbc14a0495ee09fa0e922a2ff82
2026-02-27 03:58:16 +00:00
Hemant Kumar
73f4fa85e7 Update generated fields
Kubernetes-commit: 7d9e61be7ef21576e42ed533a233d7e985358b84
2026-02-26 15:49:52 -05:00
Kubernetes Publisher
f66040b9dc Merge pull request #137261 from tchap/kcm-le-check-context-canceled
client-go/leaderelection: Short-circuit on context canceled

Kubernetes-commit: 0a68f9849435bc5015e4e0ae5b4b661bb927b6db
2026-02-26 19:36:48 +00:00
Peter Engelbert
b840391f92 Rename AllowlistEntry clientcmd.Name to Command
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

Kubernetes-commit: 505b937babc9ab0061ed346ec0278a3a605664ac
2026-02-26 13:27:46 -05:00
dhruv7539
1349319d7c client-go: error on invalid fake pod logs reactor object
Kubernetes-commit: 3ed316397734e59e9a39c662f70de1b86192db17
2026-02-26 09:58:23 -08:00
Ondra Kupka
8a32b4087c client-go/leaderelection: Check context canceled
The change introduced in 59cd1d0b3bb378f40a639e21b615f4df1d4a5a14
causes PollUntilContextTimeout to call the condition function even when
the context is canceled already. This is unnecessary in our case and
only leads to one extra loop of processing and extra error messages.
This change makes the renew loop behave like it did before the change.

Kubernetes-commit: aa494f8174d745c3d9842f3d48272a3c2d6dcbcc
2026-02-26 12:04:01 +01:00
Kubernetes Publisher
764b57d771 Merge pull request #129339 from pohly/log-client-go-features
client-go features: ignore contextual logging

Kubernetes-commit: 31d35e649098be997d31a6bbf9f6a982c486b0ab
2026-02-25 11:35:15 +00:00
dhruv7539
f1d9ba91c7 client-go: keep fake pod log action compatible
Kubernetes-commit: 60c697419d2695108a054d704334778e3d945a6c
2026-02-23 10:35:50 -08:00
Kubernetes Publisher
62f2159da2 Merge pull request #136937 from p0lyn0mial/upstream-reflector-list-unsupported-table
client-go/reflector: reject Table format resources in List and Watch paths

Kubernetes-commit: 3bc0b290e9c1cd81db1ed5119b242b5dfce931af
2026-02-23 18:10:18 +00:00
Kubernetes Publisher
00e45797cb Merge pull request #136923 from jpbetz/mock-limitations-docs
Explain limitations and maintenance policy of fake client

Kubernetes-commit: 21d8cca01dbec9e5e584d5684b2b3a8e8cd9364c
2026-02-23 10:10:45 +00:00
dhruv7539
e8eab37058 client-go: make fake Pods.GetLogs honor reactors
Kubernetes-commit: 3d41b434c0e88e9f74e38fe654d7b5bfd77090d0
2026-02-22 14:47:29 -08:00
Kubernetes Publisher
efc4692504 Merge pull request #135313 from oduludo/enable-commentstart-apiserverinternal
commentstart lint fixes for apiserverinternal API group

Kubernetes-commit: 8bfda5d315977489bd8a2fb1cfceaebd1ee7db8d
2026-02-21 22:09:34 +00:00
Ludo van Orden
648a945fad updated generated code
Kubernetes-commit: 156fc7981c8b8b0f4253420f47e3ad561e389ab9
2026-02-20 23:59:35 +01:00
Kubernetes Publisher
6b803d4e11 Merge pull request #136392 from skitt/unsupported-typo
Align IsWatchListSemanticsUnSupported comment

Kubernetes-commit: 15a2107890558876c35db3e44420575d657ac3a0
2026-02-20 18:10:21 +00:00
Patrick Ohly
f6cd0c0583 DRA device taints: generated files
Kubernetes-commit: 7d2781a0c3c02e2ad47714698f86175cd8b6ec72
2026-02-20 13:19:38 +01:00
Patrick Ohly
67f0d98034 DRA device taints: automatically bump TimeAdded when changing effect
In practice, TimeAdded is managed by the API server. When admins used
DeviceTaintRule to simulate eviction, then change the effect to really evict,
it is useful to calculate tolerations based on the time when that second
update happened. Therefore the TimeAdded field gets bumped automatically
when changing the effect.

Kubernetes-commit: f28dc4139208e64fe2882cd44d548c25020f2e3a
2026-02-20 12:35:40 +01:00
Kubernetes Publisher
100af76fc5 Merge pull request #137101 from richabanker/informer-metric-latency
Add processing latency metric for RealFIFO

Kubernetes-commit: 7336e04752a3ce946697c3524ed40104d6086b73
2026-02-20 02:13:22 +00:00
Jordan Liggitt
97646e5606 Fix vet error
Kubernetes-commit: 45900a1debee388738f299c0a001ed01e8b25208
2026-02-17 16:42:55 -05:00
Jordan Liggitt
103162f118 Bump to go 1.26
Kubernetes-commit: f291ae40b03afaaf49cca43b650bfbd05f4babee
2026-02-17 16:05:07 -05:00
Copilot
78fb6ed2e1 client-go/cache: Remove reflector context cancellation logging
The error returned from Until() is solely from context cancellation
which is expected behavior when the reflector is stopped. Logging
this as an error (or even at V(4)) creates unnecessary noise.

Kubernetes-commit: cc483208aa306b8c4078d4118cf78a10e58481ec
2026-02-16 22:04:52 -05:00
Richa Banker
59f55827e6 Add processing latency metric for RealFIFO
Kubernetes-commit: d049bd123391f4c1a86e493888560d8549a52dc2
2026-02-16 15:15:47 -08:00
Kubernetes Publisher
70ab833f66 Merge pull request #136039 from lalitc375/map-graduation
Promote MutatingAdmissionPolicy to v1 (GA)

Kubernetes-commit: b08fa0cdf18610be74d9741cf361446a5f42ff76
2026-02-18 22:09:27 +00:00
Rodrigo Campos
1d4002e88b Remove references to UserNamespacesSupport feature gate from core types
It's GA now. To regenerate the files I did:
        make WHAT=cmd/kube-apiserver
        make update

While we are there, remove the reference that the field is alpha.

Signed-off-by: Rodrigo Campos <rodrigo@amutable.com>

Kubernetes-commit: 8db51091e82490bccc0018763ba7e05ffb8ab458
2026-02-12 11:14:43 +01:00
Rodrigo Campos
a63d33951d staging/testdata: Remove UserNamespacesSupport reference
This is just a sed to remove the old data from the text fixtures too.

While two files are clearly test data given that they include testdata
in their name, these two is not so obvious but are also test data:

	* openapi/swagger-with-shared-parameters.json: is referenced in "staging/src/k8s.io/cli-runtime/pkg/resource/query_param_verifier_test.go",
          in particular in this part: ´filepath.Join("..", "..", "artifacts", "openapi", "swagger-with-shared-parameters.json")´

	* batch.k8s.io_v1.json: is in
	  `staging/src/k8s.io/kubectl/pkg/explain/v2/templates/plaintext_test.go`,
          in a "//go:embed batch.k8s.io_v1.json".

Signed-off-by: Rodrigo Campos <rodrigo@amutable.com>

Kubernetes-commit: 8d0f80e4ed87658c0e05b9db0690927547be6ad5
2026-02-13 16:04:51 +01:00
Joe Betz
8304d788bb Explain limitations and maintenance policy of fake client
Kubernetes-commit: bce392d1a7dbbe1112d8113ec6539826bfdfcdca
2026-02-10 16:49:53 -05:00
Lukasz Szaszkiewicz
7b594c4c71 reflector: reject Table format resources in List and Watch paths
Kubernetes-commit: a46b1903a5426ede16d021b49c96d3f4ba7aea4d
2026-02-10 21:42:42 +01:00
Jefftree
d6503fcc3e Update leasecandidate client to read from cache
Kubernetes-commit: 5a306036a53754ce26938cedd89b2ddf3b105aa2
2026-01-22 16:55:50 +00:00
Stephen Kitt
80c1d965be Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: af5317bb8842ba758b92bd169056eb9a666198b8
2026-01-21 14:06:32 +01:00
Monis Khan
f5fc1e5f67 Add GC to client-go TLS cache
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: fa9a1fe5f7084c0a1371d87e880c1a9e58f935a4
2026-01-16 14:58:52 -05:00
yliao
e924e3f2c5 codegen
Kubernetes-commit: 58da2e682f1ecba5d848da4810c49ad6baf886a1
2026-01-14 21:34:37 +00:00
Lalit Chauhan
2ca150601d promote MutatingAdmissionPolicy to v1: add types and generated code
Kubernetes-commit: 5505c010fd7c29d24b2718ae8659a4296cb2cc37
2025-12-29 19:15:16 +00:00
Kubernetes Publisher
e334b2d6e7 Merge pull request #136895 from youwalther65/csr-create
Add CertificateSigningRequest create log entry for default kubelet debug level V2

Kubernetes-commit: 4edf082c406416b170d923e8f2c2cee69d933ae6
2026-02-18 06:10:00 +00:00
Kubernetes Publisher
6cda0df027 Merge pull request #136824 from cnuss/issues/136823
client-go: Replace deprecated BackoffManager with DelayFunc in Reflector

Kubernetes-commit: fb78de873af5e2611776f0c5093d994a9331f698
2026-02-13 04:27:35 +00:00
Kubernetes Publisher
fd1b7118fd Merge pull request #134675 from JoelSpeed/enable-kal-optionalorrequired-apiserver-internal
Enforce either optional or required tag on apiserverinternal API group

Kubernetes-commit: 9571e19da950a23312100fbb7c5d4fe76ce0413c
2026-02-13 04:27:34 +00:00
Kubernetes Publisher
ca54862893 Merge pull request #134827 from michaelasp/rvStore
Add Resource Version query and Bookmarks to thread safe store

Kubernetes-commit: 03da2455859aacb1e542e1e46a4c8b41750d55dc
2026-02-13 04:27:31 +00:00
Kubernetes Publisher
7aaede7872 Merge pull request #136921 from dims/dump-from-utils
Move dump package from apimachinery to k8s.io/utils

Kubernetes-commit: 5b63a8c68e8e4d417ab3758c7a80118c2db27ac9
2026-02-12 20:52:28 +00:00
Joel Speed
2c400a844a Restore omitempty on ServerStorageVersion fields
Kubernetes-commit: 82a9a99a44ce2c41fc07dfcd8651d89652659976
2026-02-12 17:59:07 +00:00
Kubernetes Publisher
9f57ca57bd Merge pull request #136729 from ahmedtd/podcert-pkcs10
Pod Certificates: Add StubPKCS10Request; migrate in-tree usages

Kubernetes-commit: 54489c1a338ba521f36f5b73667f03a8e164d18e
2026-02-12 00:52:04 +00:00
Kubernetes Publisher
0efa7daafd Merge pull request #136925 from michaelasp/pipeFeatureGate
Pipe feature gate of unlockWhileProcessing

Kubernetes-commit: 7b999810bf37c025ba146e3e1feae80b44eac6d6
2026-02-11 08:51:42 +00:00
Kubernetes Publisher
82ed9ba53e Merge pull request #135395 from pohly/apimachinery-wait-for-cache-sync
apimachinery + client-go + device taint eviction unit test: context-aware Start/WaitFor, waiting through channels

Kubernetes-commit: eb09a3c23e3c3905c89e996fcec2c02ba8c4bb0e
2026-02-11 08:51:41 +00:00
Kubernetes Publisher
07f99e4437 Merge pull request #135256 from natasha41575/pod-gen-field
remove Pod Generation feature gate from field descriptions

Kubernetes-commit: 99d4b4d426b751cc7ca3f7b3e118c899af8fbfde
2026-02-11 00:51:49 +00:00
Michael Aspinwall
b8c6b3c159 Pipe feature gates
Kubernetes-commit: 718ebb6dfc7a5a64ee17821a0de177e3a1eb11f0
2026-02-10 22:39:18 +00:00
Davanum Srinivas
decb8c0791 Move dump package from apimachinery to k8s.io/utils
Replace all imports of k8s.io/apimachinery/pkg/util/dump with
k8s.io/utils/dump across the repo. The apimachinery dump package
now contains deprecated wrapper functions that delegate to
k8s.io/utils/dump for backwards compatibility.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 550cc8645bedcc8b187e0ebeb52ead29d5631a32
2026-02-10 15:20:41 -05:00
Jens-Uwe Walther
18a54f0a40 Add CertificateSigningRequest create log entry for default kubelet debug level V2
Kubernetes-commit: b7bd70192397c5d52c18a5f85e87cec66ccc9a9f
2026-02-09 21:12:39 +01:00
Christian Nuss
b5668cea26 client-go: Replace deprecated BackoffManager with DelayFunc in Reflector
Move backoff documentation comments to var block for better discoverability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Kubernetes-commit: 33ebd41b2c1abdc03beabd9ccff3428a8fd46473
2026-02-07 12:04:08 -05:00
Taahir Ahmed
3721aecc15 Pod Certificates: make update
Kubernetes-commit: c76efb3a145830f40ee042b8823e83a973e24372
2026-02-03 20:26:42 -08:00
Michael Aspinwall
139a95c065 Plumb bookmark RVs to controller for observation
Kubernetes-commit: 428b903cd990762a2588fa471791d9c8c747c196
2026-01-28 22:30:06 +00:00
Michael Aspinwall
d883e606da Add rv query to store
Kubernetes-commit: 9c6ac550efa6e721c85b0f1074f26f734286fba9
2026-01-28 22:29:39 +00:00
Ayato Tokubi
1f85fd1a13 Update OCI image volume type description to remove "noexec" attribute
Signed-off-by: Ayato Tokubi <atokubi@redhat.com>

Kubernetes-commit: aa1e24659ee18378426fa3b83616c7d96e098bbe
2025-12-16 16:57:37 +00:00
Patrick Ohly
ff8083eb1d client-go informers: context-aware Start + WaitForCacheSync
Passing a context to StartWithContext enables context-aware reflector
logging. This is the main remaining source of log spam (output to stderr
instead of per-test logger) in controller unit tests.

WaitForCacheSynceWithContext takes advantage of the new cache.WaitFor +
NamedHasSynced functionality to finish "immediately" (= no virtual time
passed) in a synctest bubble. While at it, the return type gets improved so
that a failure is easier to handle.

Kubernetes-commit: 5ff323de791df88880f6e065f5de4b445e5c90ed
2025-11-21 16:23:44 +01:00
Patrick Ohly
e70bc766e0 client-go cache: wait for cache sync via channels, better logging
The main advantage is that waiting on channels creates a causal relationship
between goroutines which is visible to synctest. When a controller in a
synctest bubble does a WaitFor in a test's background goroutine for the
controller, the test can use synctest.Wait to wait for completion of cache
sync, without requiring any test specific "has controller synced" API. Without
this, the test had to poll or otherwise wait for the controller.

The polling in WaitForCacheSync moved the virtual clock forward by a random
amount, depending on how often it had to check in wait.Poll. Now tests can be
written such that all events during a test happen at a predictable time. This
will be demonstrated in a separate commit for the
pkg/controller/devicetainteviction unit test.

The benefit for normal production is immediate continuation when the last
informer is synced (not really a problem, but still...) and more important,
nicer logging thanks to the names associated with the thing that is being
waited for. The caller decides whether logging is enabled or disabled and
describes what is being waited for (typically informer caches, but maybe also
event handlers or even something else entirely as long as it implements the
DoneChecker interface).

Before:

    Waiting for caches to sync
    Caches are synced

After:

    Waiting for="cache and event handler sync"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.Pod"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceClaim"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceSlice"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.DeviceClass"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1alpha3.DeviceTaintRule"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceClaim + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.Pod + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1alpha3.DeviceTaintRule + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceSlice + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"

The "SharedIndexInformer *v1.Pod" is also how this appears in metrics.

Kubernetes-commit: fdcbb6cba9a04c028b158bf66d505df7431f63fe
2025-11-18 12:39:11 +01:00
Patrick Ohly
b37e79caad client-go cache: allow passing name+logger to DeltaFIFO, RealFIFO and Reflector
This improves logging and enables more informative waiting for cache sync in a
following commit. It addresses one klog.TODO in the Reflector.

The RealFIFOOptions and InformerOptions structs get extended the same way as
DeltaFIFOOptions before: a logger may be set, but it's not required. This is
not an API break.

That the name has to be passed separately is a bit annoying at first glance
because it could also be set directly on the logger through WithName, but
keeping it separate is better:
- name can be set without providing a logger
- name can be defaulted
- less code in the caller when passing through a logger and adding
  the name only in the field
- last but not least, extracting the name is not supported in a portable
  manner by logr

All in-tree references in production code get updated.

While at it, logging in the fifos gets updated to follow best practices: if
some code encounters an abnormal situation and then continues, it should use
utilruntime.HandleErrorWithLogger instead of normal error logging.

Existing "logger" fields get moved to the top because that is a more common
place for such a read-only field.

Kubernetes-commit: 45251e5f654e6c052659d110cd721f9fbe185191
2025-11-18 18:09:46 +01:00
carlory
6a81dca7e6 run make update
Signed-off-by: carlory <baofa.fan@daocloud.io>

Kubernetes-commit: 95460ea1f897a497d01641986e38cb56b5565bed
2025-11-18 17:35:11 +08:00
carlory
333a3455d5 Remove feature gate AnyVolumeDataSource
Signed-off-by: carlory <baofa.fan@daocloud.io>

Kubernetes-commit: 9a1b8cbe492cae9943160c5eaeba7b3caf1cf7c5
2025-11-18 17:26:20 +08:00
Natasha Sarkar
1ee3eb7041 remove Pod Generation feature gate from field descriptions
Kubernetes-commit: d5dabfcd658def79f6b1e1c3c680d5c1711e24f7
2025-11-11 16:44:33 +00:00
Kubernetes Publisher
8fcd3c218f Merge pull request #136826 from alvaroaleman/bumpv0.32
Bump structured merge diff to v6.3.2

Kubernetes-commit: 65f09e605cb206b2e5fcff4d69a4ae8acf62dbc3
2026-02-10 20:21:19 +00:00
Kubernetes Publisher
c6e2e47b31 Merge pull request #136455 from pohly/client-go-simpleclient-undeprecation
fake client-go: un-deprecate NewSimpleClientset

Kubernetes-commit: 09e1c9fe0ec3d3a61fa71c43610b42e1e3f53612
2026-02-10 00:00:21 +00:00
Alvaro Aleman
c02524f944 Bump structured merge diff to v6.3.2
Diff: https://github.com/kubernetes-sigs/structured-merge-diff/compare/v6.3.1...v6.3.2

It's just one change that prevents a NPD when an embedded pointer to a
struct is encountered.

Kubernetes-commit: f59cfe60ef2063e2383ebef416f9da05196903d6
2026-02-07 13:49:48 -05:00
Patrick Ohly
aac099e7c2 fake client-go: un-deprecate NewSimpleClientset
NewSimpleClientset was marked as deprecated when NewClientset was
introduced. This has caused some confusion:
- Not all packages have NewClientset (https://github.com/kubernetes/kubernetes/issues/135980).
- Tests that work with NewSimpleClientset fail when
  switched to NewClientset (https://github.com/kubernetes/kubernetes/issues/136327)
  because of missing CRD support (https://github.com/kubernetes/kubernetes/issues/126850).

It doesn't seem burdensome to keep NewSimpleClientset around forever. Some unit
tests may even prefer to use it when they don't need server-side apply (less
overhead). Therefore there is no need to deprecate it.

This avoids churn in the eco system because contributors no longer create PRs
"because the linter complains about the usage of a deprecated function".

Kubernetes-commit: e80da21868059f789c90105a00481fa8cef169e1
2026-01-23 11:20:40 +01:00
Kubernetes Publisher
67ce519612 Merge pull request #135782 from richabanker/fifo-identity-metric
Add identifier-based queue depth metrics for RealFIFO

Kubernetes-commit: 8972957668a174bbb589f167817130e0f2d352a9
2026-02-06 03:52:42 +00:00
Richa Banker
12b64ed22e Wire InformerName through SharedIndexInformer
Kubernetes-commit: 96386809339faee1169d163749cb4b7d354bec1e
2026-02-05 11:45:38 -08:00
Richa Banker
5fee0e4466 Generate informers with InformerName support
Kubernetes-commit: 1fec293a1d9fc53e0e3f1a6a3fe6f8970110c1a7
2026-02-05 11:42:54 -08:00
Richa Banker
117e93e87c Add FIFO queue depth metrics
Kubernetes-commit: 864357774f24ee17b2bc7bde84eb5b87cc7ab95b
2026-02-05 11:42:20 -08:00
Kubernetes Publisher
c148db9511 Merge pull request #136747 from dims/use-k8s-utils-btree
Use btree from k8s.io/utils instead of github.com/google/btree

Kubernetes-commit: dc1ec1211e4f54064ba6dafd8aac46ac3d4379b4
2026-02-05 11:42:33 +00:00
Kubernetes Publisher
aa31c74d1f Merge pull request #136694 from michaelasp/addEmulationToClientGo
Add the ability to update locked features in client-go testing

Kubernetes-commit: 365fd08d5898a099cdc40eaf2a53d5a40125b1f0
2026-02-05 02:04:32 +05:30
Davanum Srinivas
4ba33933bd Use btree from k8s.io/utils instead of github.com/google/btree
The google/btree package is deprecated, so switch to the maintained
fork in k8s.io/utils/third_party/forked/golang/btree.

API differences:
- NewG -> New
- BTreeG[T] -> BTree[T]

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a328ca88ad662119bbf129cd1107fabd8dd9f539
2026-02-04 09:19:58 -05:00
Michael Aspinwall
88493c6cb6 Lock InOrderInformers to true by default
Kubernetes-commit: 566a01682fe526812b5f12453908864827300b6f
2026-02-03 21:54:29 +00:00
Michael Aspinwall
c752307a85 Add SetForTesting for testing feature gates
Kubernetes-commit: 8099c570428806404b1a400143156c2ed0c67658
2026-02-03 21:49:09 +00:00
Kubernetes Publisher
65608ffa8e Merge pull request #136601 from michaelasp/realFifoGA
Set RealFIFO to GA in 1.36

Kubernetes-commit: 1861c1a07244e8e9430aaf588722dd22287c471e
2026-02-04 03:42:25 +00:00
Kubernetes Publisher
f651faf894 Merge pull request #136509 from pohly/client-go-informer-deadlock
client-go informers: fix potential deadlock

Kubernetes-commit: cc0fdc1fe2cfada52875a0c5fa115f69b4dd477a
2026-01-29 21:44:57 +00:00
Kubernetes Publisher
ada74e06af Merge pull request #136424 from JoelSpeed/podgroup-union
Mark PodGroupPolicy up with openapi union member tags

Kubernetes-commit: 8f4c197169bd4454bef3f7fc47ce02a324d51c76
2026-01-29 21:44:56 +00:00
Richa Banker
50ef81ad18 Add identity tracking for queue items
Kubernetes-commit: db27f4c1234a50e3157373c060ac8ba71c513500
2026-01-28 19:01:51 -08:00
Kubernetes Publisher
f3637bd93c Merge pull request #136583 from michaelasp/watchListRVEnforcement
Ensure resource version callbacks aren't called preemptively in reflector

Kubernetes-commit: ebc5660fa5c37e5e2f4bc85aff7f181d03955a9c
2026-01-29 01:49:03 +00:00
Michael Aspinwall
072a1958db Set RealFIFO to GA in 1.36
Kubernetes-commit: 7107e2f3500091155ac54a2d16a0eb0a9b557d1c
2026-01-28 22:37:37 +00:00
Kubernetes Publisher
2d68c1db51 Merge pull request #135106 from bkhadars/enable-commentstart1
enable commentstart check on admissionregistration API group

Kubernetes-commit: a41a5c35d38479df7bfa462ec24221a5198a0e5f
2026-01-28 17:44:36 +00:00
Kubernetes Publisher
a48da785a9 Merge pull request #129332 from pohly/log-client-go-clientcmd
client-go command: structured, contextual logging

Kubernetes-commit: 1c9da264ab83ac34efd0422711e1a222ffcb1b03
2026-01-28 13:44:55 +00:00
Kubernetes Publisher
67189d0e25 Merge pull request #136582 from yongruilin/master_kubeopenapi-format
Bump k8s.io/kube-openapi to latest and enable numeric format validation

Kubernetes-commit: b90909e4325d5375af7deb190585a5e9885c288d
2026-01-28 01:44:00 +00:00
Michael Aspinwall
ef73fc0205 Add enforcement for rv update in watchlist to preserve the rv ordering invariant
Kubernetes-commit: 35d29e4772261b283498e04148b89cef64fd6297
2026-01-27 23:09:17 +00:00
yongruilin
2d1d3a8458 Bump k8s.io/kube-openapi to latest
Kubernetes-commit: 65b579a036fa3b230f9c5e22d449fe9e4790078e
2026-01-27 21:39:39 +00:00
Kubernetes Publisher
146146cf95 Merge pull request #136574 from pohly/revert-129344-log-client-go-apimachinery-network-util
Revert "apimachinery: contextual logging in network util code"

Kubernetes-commit: 99a2c5c6346ad84976f9bda40034670a97950f24
2026-01-27 17:44:25 +00:00
Patrick Ohly
b0c7207279 Revert "apimachinery: contextual logging in network util code"
Kubernetes-commit: 9d65b9be20e5ee0a4ef34f0ba071d35987da4ab0
2026-01-27 17:21:02 +01:00
Kubernetes Publisher
5b20bd05fc Merge pull request #136441 from kannon92/remove-alpha-api-dra
remove alpha comments for GA or beta resource fields

Kubernetes-commit: be658b44f32ee69146505094ac3a03418832f9b6
2026-01-27 17:44:24 +00:00
Patrick Ohly
3590eb7f48 client-go informers: replace time.Sleep with callback
While time.Sleep is what the test needs, maybe an arbitrary hook invocation is
more acceptable in the production code because it is more general.

Kubernetes-commit: 2ec0305d728bf5ce8f8df314a18e71aa120a00cf
2026-01-27 14:47:37 +01:00
Patrick Ohly
889b95a769 client-go informers: fix potential deadlock
In the unlikely situation that sharedProcessor.distribute was triggered by a
resync before sharedProcessor.run had a chance to start the listeners, the
sharedProcessor deadlocked: sharedProcessor.distribute held a read/write lock
on listenersLock while being blocked on the write to the listener's
channel. The listeners who would have read from those weren't get started
because sharedProcessor.run was blocked trying to get a read lock for
listenersLock.

This gets fixed by releasing the read/write lock in sharedProcessor.distribute
while waiting for all listeners to be started. Because either all or no
listeners are started, the existing global listenersStarted boolean is
sufficient.

The TestListenerResyncPeriods tests now runs twice, with and without the
artificial delay. It gets converted to a synctest, so it executes quickly
despite the time.Sleep calls and timing is deterministic. The enhanced log
output confirms that with the delay, the initial sync completes later:

    === RUN   TestListenerResyncPeriods
        shared_informer_test.go:236: 0s: listener3: handle: pod1
        shared_informer_test.go:236: 0s: listener3: handle: pod2
        shared_informer_test.go:236: 0s: listener1: handle: pod1
        shared_informer_test.go:236: 0s: listener1: handle: pod2
        shared_informer_test.go:236: 0s: listener2: handle: pod1
        shared_informer_test.go:236: 0s: listener2: handle: pod2
        shared_informer_test.go:236: 2s: listener2: handle: pod1
        shared_informer_test.go:236: 2s: listener2: handle: pod2
        shared_informer_test.go:236: 3s: listener3: handle: pod1
        shared_informer_test.go:236: 3s: listener3: handle: pod2
    --- PASS: TestListenerResyncPeriods (0.00s)
    === RUN   TestListenerResyncPeriodsDelayed
        shared_informer_test.go:236: 1s: listener1: handle: pod1
        shared_informer_test.go:236: 1s: listener1: handle: pod2
        shared_informer_test.go:236: 1s: listener2: handle: pod1
        shared_informer_test.go:236: 1s: listener2: handle: pod2
        shared_informer_test.go:236: 1s: listener3: handle: pod1
        shared_informer_test.go:236: 1s: listener3: handle: pod2
        shared_informer_test.go:236: 2s: listener2: handle: pod1
        shared_informer_test.go:236: 2s: listener2: handle: pod2
        shared_informer_test.go:236: 3s: listener3: handle: pod1
        shared_informer_test.go:236: 3s: listener3: handle: pod2
    --- PASS: TestListenerResyncPeriodsDelayed (0.00s)

Kubernetes-commit: e6ef79b2f6bb05205652e4fe48ffa523d9e3a1ec
2026-01-23 19:38:52 +01:00
Kevin Hannon
0c949f1da7 remove alpha comments for GA or beta DRA fields
Kubernetes-commit: 159eb4cd7719a1c5de2c332e811a2b598ee1a4d2
2026-01-22 17:03:40 -05:00
Joel Speed
cb71398117 Mark PodGroupPolicy up with openapi union member tags
Kubernetes-commit: a984ba0bd9a5d0b25026d8d56c191faacc7b52ec
2026-01-22 11:28:50 +00:00
Kubernetes Publisher
c5e14be254 Merge pull request #136410 from michaelasp/addToReviewer
Add michaelasp to client-go/tools/cache reviewers

Kubernetes-commit: 290b358acda398439f0fb6ad027b59b45777d6fa
2026-01-22 05:49:06 +00:00
Michael Aspinwall
36db2c5c73 Add michaelasp to client-go cache reviewers
Kubernetes-commit: 8418cf16d7d918804db1b040338ffc3c164cff8d
2026-01-21 21:46:59 +00:00
Kubernetes Publisher
511abf454d Merge pull request #136362 from dims/update-opentelemetry-v1.39.0
Update OpenTelemetry dependencies to latest versions

Kubernetes-commit: 69eb15ee58c9cb20b90007e9b064dfb78b66a867
2026-01-21 21:43:59 +00:00
Kubernetes Publisher
98fd4cc5ca Merge pull request #136264 from michaelasp/unlockWhileProcess
Ensure that processing does not block queue writers in RealFIFO

Kubernetes-commit: dff962ddbb0f5928086029e45a2fa63c28341c57
2026-01-21 21:43:57 +00:00
Davanum Srinivas
51d0341059 Update OpenTelemetry dependencies to latest versions
Core packages (opentelemetry-go):
- go.opentelemetry.io/otel: v1.38.0 → v1.39.0
- go.opentelemetry.io/otel/metric: v1.38.0 → v1.39.0
- go.opentelemetry.io/otel/trace: v1.38.0 → v1.39.0
- go.opentelemetry.io/otel/sdk: v1.38.0 → v1.39.0

Exporters:
- go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.34.0 → v1.39.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.34.0 → v1.39.0

Contrib instrumentation (opentelemetry-go-contrib):
- go.opentelemetry.io/contrib/.../otelhttp: v0.61.0 → v0.64.0
- go.opentelemetry.io/contrib/.../otelrestful: v0.44.0 → v0.64.0

Protocol definitions (opentelemetry-proto-go):
- go.opentelemetry.io/proto/otlp: v1.5.0 → v1.9.0

Notable changes:
- Go 1.24 is now the minimum required version (Go 1.23 support dropped) for OTEL components
- Performance: ~4x improvement in histogram concurrent operations; xxhash
  replaces fnv for attribute hashing
- Fixed goroutine leak in span processors when context is canceled
- otelrestful migrated semantic conventions from v1.20.0 to v1.34.0
  (e.g., http.method → http.request.method)
- Partial OTLP export errors now surfaced instead of being silently dropped
- otelrestful no longer depends on json-iterator/go, modern-go/concurrent,
  or modern-go/reflect2; unwanted-dependencies.json updated accordingly

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: c40ea60b9f193fbead586f9fd6cc26f7b77312ff
2026-01-20 17:20:21 -05:00
Kubernetes Publisher
ff70f47ee2 Merge pull request #135322 from carlory/rm-portworx
[1.36] Remove intree volume plugin portworx

Kubernetes-commit: d047572e817aafc3af859c191d79d954cf1855d9
2026-01-19 17:43:40 +00:00
Michael Aspinwall
914300b800 Add benchmarks for adding objects with slow handlers
Kubernetes-commit: 082f38d97bb68e77347b48dd5b29023b1a357373
2026-01-16 00:47:09 +00:00
Michael Aspinwall
f5283a4822 Ensure that processing does not block queue writers
Kubernetes-commit: 40c01b99a7bac05f6de438d67dd20a60333a0ac4
2026-01-16 00:46:52 +00:00
carlory
9cbf88a315 run hack/update-vendor.sh
Signed-off-by: carlory <baofa.fan@daocloud.io>

Kubernetes-commit: 299ec97e6fa2295ccc14d22f501280164377914a
2025-11-13 10:54:21 +08:00
Kubernetes Publisher
1a68af1383 Merge pull request #136212 from dims/update-security-deps-jan2026-v2
Update security and stability dependencies

Kubernetes-commit: a94970c0c5de0fa56b0ed82823850db7e0257685
2026-01-16 13:31:47 +00:00
Davanum Srinivas
95129d1f2f Update security and stability dependencies
This PR updates several dependencies addressing security vulnerabilities,
stability fixes, and authentication improvements.

- golang.org/x/crypto: v0.46.0 -> v0.47.0
  - Includes latest X509 root certificate bundle updates
  - Security hardening for cryptographic operations
  - Foundation dependency for TLS and authentication

- github.com/golang-jwt/jwt/v5: v5.2.2 -> v5.3.0
  - IMPORTANT: v5.2.2 patched vulnerability GHSA-mh63-6h87-95cp (token
    validation security issue) - this update ensures we have the fix
  - Adds multiple audience validation support for JWT tokens
  - Go 1.21 minimum requirement (code modernization)
  - Replaced legacy interface{} with modern any keyword

- golang.org/x/net: v0.48.0 -> v0.49.0
  - HTTP/2 priority scheduler improvements (RFC 9218)
  - WebSocket security enhancements
  - Network layer stability fixes

- go.uber.org/zap: v1.27.0 -> v1.27.1
  - Fix: Prevent Object from panicking on nils (PR #1501)
  - Fix: Race condition in WithLazy (PR #1511)
  - Both fixes improve logging stability in concurrent scenarios

- github.com/godbus/dbus/v5: v5.2.0 -> v5.2.2
  - Security: Disabled SHA1 authentication by default on non-Windows
    platforms (v5.2.0 change now inherited)
  - Performance: Multiple optimizations reducing memory allocations
  - Fix: Alignment issues in decoder operations
  - Fix: Allow more than 32 containers/struct fields in a signature

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 5b478645cdb3be5ed92a21d2f7b417b6328cfa6e
2026-01-13 23:08:03 -05:00
Kubernetes Publisher
518241d079 Merge pull request #136008 from michaelasp/atomicResync
Add atomic resync operation for real fifo

Kubernetes-commit: b82b03b9240e13b72635a39304b352afdf6a1fde
2026-01-16 01:32:19 +00:00
Michael Aspinwall
2f59c18c8b Add atomic resync and remove usage of store in FIFO
Kubernetes-commit: 6fbaebc054fc61f4775bb3a803beba7e924e266b
2026-01-15 20:22:36 +00:00
Kubernetes Publisher
24e4401379 Merge pull request #136143 from pohly/client-go-fake-list-and-watch-fix
client-go testing: fix List+Watch support

Kubernetes-commit: 8392659d3c90fea03be805968b53ec7a05dea183
2026-01-15 17:32:16 +00:00
Kubernetes Publisher
14e71d2850 Merge pull request #135462 from michaelasp/atomicReplace
Add atomic replace in client-go

Kubernetes-commit: 8322d26d1f0384f98baf6b640af58a471eb66f19
2026-01-15 01:32:08 +00:00
Michael Aspinwall
aad3a6de89 Add support for ReplacedAll delta handling
Kubernetes-commit: 3d585f1c500be795dfaf24e2c6a7b024986481c1
2026-01-14 13:46:37 -05:00
Michael Aspinwall
0a8284b969 Plumb AtomicFIFO options into controller/store construction
Kubernetes-commit: 022fec7ba8b0e2c71e1f38634a31f296d0090b31
2026-01-14 13:23:12 -05:00
Michael Aspinwall
06f647297d Add AtomicFIFO feature gate
Kubernetes-commit: 9e25c19199ece559f91615cc70947da64e740fce
2026-01-14 12:39:28 -05:00
Michael Aspinwall
2cb222485f Guard against unexpected delta types in batch processing
Kubernetes-commit: 64f780c1ecd7e9ec0989cb3ebd584cd9249a4c8c
2026-01-14 12:41:04 -05:00
Michael Aspinwall
14f3889b62 Make PopBatch process a single-item batch identically to Pop
Kubernetes-commit: b8470beda4e4a17ad38e9a58ce86c96f420bb720
2026-01-14 13:18:37 -05:00
Michael Aspinwall
759b00eb22 Expand controller unit test coverage
Kubernetes-commit: 1c29ee7e7b5e039b8df1a5cb75798c0359ca73d9
2026-01-14 13:08:26 -05:00
Michael Aspinwall
4678a135e1 Plumb keyFunc to informer/controller/delta handling
Kubernetes-commit: 4171c8cff8e79d3624f7e3bc83513fbec1671a24
2026-01-14 13:04:31 -05:00
Michael Aspinwall
c38fc0fb1f Refactor RealFIFO#Replace delete/update handling to reconcileReplacement
Kubernetes-commit: b94e610244ea8e37bcade7eec7e77be0ff61e572
2026-01-14 12:56:32 -05:00
Michael Aspinwall
f3701130c2 Fix Replaced delta documentation
Kubernetes-commit: ebd6959b126bad49c305d8088103455ce13241b2
2026-01-14 12:45:13 -05:00
Michael Aspinwall
548663c679 Refactor delta addition/clearing
Kubernetes-commit: 2dad39751d993757b3f218fda93a380a450a2257
2026-01-14 12:44:38 -05:00
Patrick Ohly
bb190d443d client-go testing: start ResourceVersion at 1 for empty set
List should never return "0", that has a special meaning in queries.

Kubernetes-commit: 3783a720e7278466859fe140d2bfbbfb054f5313
2026-01-14 12:19:32 +01:00
Patrick Ohly
70ee41c382 client-go testing: include event handler in List+Watch unit test
The event handler must receive both object (the initial one from List, the
newer one from Watch) and it must be considered synced.

Kubernetes-commit: 359aff0552ed3b60d544158e5edf33d28492f01a
2026-01-14 11:57:24 +01:00
Kubernetes Publisher
d8ad3ab106 Merge pull request #136162 from dims/update-security-deps-jan2026
Update security-critical authentication and protobuf dependencies

Kubernetes-commit: c29a5d73a6fd04896033fe615c259f2949c5e94f
2026-01-14 01:31:55 +00:00
Davanum Srinivas
179e2aab49 Update security-critical authentication and protobuf dependencies
This PR updates security-critical dependencies addressing authentication
and data parsing vulnerabilities.

**Authentication Security:**
- github.com/coreos/go-oidc: v2.3.0 -> v2.5.0
  - Security fix: Now verifies token signature BEFORE validating payload
  - Prevents potential processing of tampered tokens before cryptographic
    verification

- github.com/cyphar/filepath-securejoin: v0.6.0 -> v0.6.1
  - Security fix: Fixed seccomp fallback logic - library now properly falls
    back to safer O_PATH resolver when openat2(2) is denied by seccomp-bpf
  - Fixed file descriptor leak in openat2 wrapper during RESOLVE_IN_ROOT

- cyphar.com/go-pathrs: v0.2.1 -> v0.2.2
  - Companion update to filepath-securejoin

**Protobuf Security:**
- google.golang.org/protobuf: v1.36.8 -> v1.36.11
  - Security fix: Added recursion limit check in lazy decoding validation
  - Prevents potential stack exhaustion attacks via maliciously crafted
    protobuf messages
  - Also adds support for URL chars in type URLs in text-format

These updates are critical for:
- OIDC authentication in kube-apiserver
- Container filesystem path resolution (used by container runtimes)
- Protobuf message parsing throughout the codebase

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: c825d80bbf2c82666192c329478a686fa3a1d5dc
2026-01-11 16:50:37 -05:00
Kubernetes Publisher
0b06cf5bf0 Merge pull request #129344 from pohly/log-client-go-apimachinery-network-util
apimachinery: contextual logging in network util code

Kubernetes-commit: c6be0527684a967c1b0dd14486ae2241832723f0
2026-01-13 21:32:02 +00:00
Kubernetes Publisher
934ba1dfa5 Merge pull request #136161 from dims/update-golang-x-deps-jan2026
Update golang.org/x dependencies to latest versions

Kubernetes-commit: 1c894014ebe25e0b042efa91698284f527493d90
2026-01-13 01:36:55 +00:00
Davanum Srinivas
07c57c562d Update golang.org/x dependencies to latest versions
updates the golang.org/x package family to newer releases:

- golang.org/x/crypto: v0.45.0 -> v0.46.0
- golang.org/x/net: v0.47.0 -> v0.48.0
- golang.org/x/sys: v0.38.0 -> v0.40.0
- golang.org/x/time: v0.9.0 -> v0.14.0
- golang.org/x/oauth2: v0.30.0 -> v0.34.0
- golang.org/x/text: v0.31.0 -> v0.33.0
- golang.org/x/term: v0.37.0 -> v0.39.0
- golang.org/x/sync: v0.18.0 -> v0.19.0
- golang.org/x/mod: v0.29.0 -> v0.32.0
- golang.org/x/tools: v0.38.0 -> v0.40.0
- golang.org/x/exp: 8a7402abbf56 -> 944ab1f22d93

Security & Stability:
- x/crypto: Updated X509 root certificate bundle
- x/net: HTTP/2 PING optimization to reduce DoS detection triggers,
  data race fix in trace RenderEvents
- x/sys: Fixed out-of-bounds memory access in sockaddrIUCVToAny
- x/time: Fixed rate limiter overflow when using very low rates that
  could cause the limiter to jam open

Performance:
- x/time: ~19% improvement in Sometimes.Do when no interval configured

Maintenance:
- Various vet diagnostic fixes for Go 1.26 compatibility
- Dependency updates across the golang.org/x ecosystem

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 0e67c56a8f26ace2889fd24e098b78e13f9bbffe
2026-01-11 16:25:45 -05:00
Patrick Ohly
42c6ae81ab client-go testing: fix List+Watch support
56448506075c3db1d added support for List+Watch to a fake client-go instance.
However, that support was not quite working yet as seen when analyzing a test
flake:

- List returned early when there were no objects, without adding the
  ResourceVersion. The ResourceVersion should have been "0" instead.
- When encountering "" as ResourceVersion, Watch didn't deliver
  any objects. That was meant to preserve compatibility with clients
  which don't expect objects from a Watch, but the right semantic of
  "" is "Start at most recent", which includes delivering existing
  objects.

Tests which meddle with the List implementation via a reactor (like
clustertrustbundlepublisher) have to be aware that Watch now may
return objects when given an empty ResourceVersion.

Kubernetes-commit: 6bfa727bee264f5d7e4471066c1b48a28d0c1929
2026-01-09 16:54:10 +01:00
Kubernetes Publisher
811a272277 Merge pull request #136108 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.27.4, gomega v1.39.0

Kubernetes-commit: 758ef0ffbce5cbca7a893d839dde892d79c2738f
2026-01-08 22:43:17 +00:00
Patrick Ohly
2e32132ba0 dependencies: ginkgo v2.27.4, gomega v1.39.0
Latest release of both. The CurrentTreeConstructionNodeReport fix
is needed before being able to use it in the E2E framework.

Kubernetes-commit: f8a0c80ed81711f6add7a765d22b56d2d41ac522
2026-01-08 16:53:03 +01:00
Kubernetes Publisher
52d9854c37 Merge pull request #136068 from aojea/leader_race_time
fix leader election data race reading observedtime

Kubernetes-commit: 0f4705e12e12439b37e81ea6df2318def4b4a2c5
2026-01-07 18:34:00 +00:00
Kubernetes Publisher
2f784525d5 Merge pull request #135959 from pohly/client-go-testing-list-and-watch-race
client-go testing: support List+Watch with ResourceVersion

Kubernetes-commit: fe36b79c2ab54cd7cc10733ca50e5642e2304f86
2026-01-07 14:33:55 +00:00
Kubernetes Publisher
736bd66226 Merge pull request #132145 from inkel/inkel/client-go/improve-bearerauthrt-roundtrip-perf
fix(client): Concatenate string instead of using `fmt.Sprintf`

Kubernetes-commit: ed17ca808f5db19c9309ffa32694885d2f30ca7a
2026-01-07 14:33:53 +00:00
Antonio Ojea
7761b3a081 leaderelection RWlock
We need to lock on observedTime reads to avoid races, before we were
only locking to read the observed record.

Use a RW lock since there are much more reads that writes.

Kubernetes-commit: d5ac0e408a0a1e50197e1b599b9b8b2e505bfe46
2026-01-07 13:16:25 +00:00
Kubernetes Publisher
65de5216f1 Merge pull request #134798 from aditigupta96/fix-runwithcontext-apimachinery
apimachinery: Use informer.RunWithContext in various components

Kubernetes-commit: 6af6361e3b6a5eafc8349b05227afff54e0594ed
2026-01-07 02:39:25 +00:00
Kubernetes Publisher
c9ded7e60b Merge pull request #136053 from tchap/kcm-leader-election-thread-mgmt
leasecandidate: Improve goroutine management

Kubernetes-commit: 3edae6c1c49958fd10a708d9cc8c4c9e7f5fb6e8
2026-01-06 20:59:08 +05:30
Ondra Kupka
0728b482e1 leasecandidate: Improve goroutine management
Make sure all goroutines are terminated when Run returns.

Kubernetes-commit: 498896ec4270b790e971a6fb01a292aa4c8cdfe0
2026-01-06 10:43:05 +01:00
Patrick Ohly
58e70dff3d client-go testing: support List+Watch with ResourceVersion
Quite a lot of unit tests set up informers with a fake client, do
informerFactory.WaitForCacheSync, then create or modify objects. Such tests
suffered from a race: because the fake client only delivered objects to the
watch after the watch has been created, creating an object too early caused
that object to not get delivered to the informer.

Usually the timing worked out okay because WaitForCacheSync typically slept a
bit while polling, giving the Watch call time to complete, but this race has
also gone wrong occasionally. Now with WaitForCacheSync returning more promptly
without polling (work in progress), the race goes wrong more often.

Instead of working around this in unit tests it's better to improve the fake
client such that List+Watch works reliably, regardless of the timing. The fake
client has traditionally not touched ResourceVersion in stored objects and
doing so now might break unit tests, so the added support for ResourceVersion
is intentionally limited to List+Watch.

The test simulates "real" usage of informers. It runs in a synctest bubble and
completes quickly:

    go  test -v .
    === RUN   TestListAndWatch
        listandwatch_test.go:67: I0101 01:00:00.000000] Listed configMaps="&ConfigMapList{ListMeta:{ 1  <nil>},Items:[]ConfigMap{ConfigMap{ObjectMeta:{cm1  default    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},Data:map[string]string{},BinaryData:map[string][]byte{},Immutable:nil,},},}" err=null
        listandwatch_test.go:79: I0101 01:00:00.000000] Delaying Watch...
        listandwatch_test.go:90: I0101 01:00:00.100000] Caches synced
        listandwatch_test.go:107: I0101 01:00:00.100000] Created second ConfigMap
        listandwatch_test.go:81: I0101 01:00:00.100000] Continuing Watch...
    --- PASS: TestListAndWatch (0.00s)
    PASS
    ok  	k8s.io/client-go/testing/internal	0.009s

Some users of the fake client need to be updated to avoid test failures:
- ListMeta comparisons have to be updated.
- Optional: pass ListOptions into tracker.Watch. It's optional because
  the implementation behaves as before when options are missing,
  but the List+Watch race fix only works when options are passed.

Kubernetes-commit: 56448506075c3db1d16b5bbf0c581b833a4646f1
2025-12-27 21:57:54 +01:00
Kubernetes Publisher
d9d16a9e17 Merge pull request #135391 from jpbetz/smd-6_3_1
Bump structured-merge-diff to pick up flake fix and bug fixes

Kubernetes-commit: 6f92c01979b7666f6631a556a8626e21b88d1f2a
2025-12-23 14:30:15 +00:00
Kubernetes Publisher
af9dcc3651 Merge pull request #135867 from dims/pin-versions-of-dbus-and-otelgrpc-to-avoid-breakage
Pin versions of dbus and otelgrpc to avoid breakage

Kubernetes-commit: dce2e8cef737ebce3a4d13d74654c50bcb244846
2025-12-21 02:29:37 +00:00
Davanum Srinivas
aa82641b9d updated to last known good dependencies for otelgrpc and dbus
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 60cce0abd05d31f74ece404e584f53c915a7f3d5
2025-12-20 15:27:53 -05:00
Kubernetes Publisher
687c6c1315 Merge pull request #135836 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.27.3 + gomega v1.38.3

Kubernetes-commit: 268bdbe214ac64b5a31a59cfae6b96f3a1585bd3
2025-12-19 18:29:40 +00:00
Kubernetes Publisher
1078d9cd6f Merge pull request #135845 from skitt/drop-armon-circbuf
Replace armon/circbuf with k8s.io/utils/buffer

Kubernetes-commit: 0ea38248603ce745956d779787874cfd91ca29ae
2025-12-19 18:29:38 +00:00
Stephen Kitt
85ab7843a2 Replace armon/circbuf with k8s.io/utils/buffer
This uses the new generic fixed ring implementation in k8s.io/utils.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 3653ae2b9a7768da89e47ef84d503ae9cf0b910b
2025-12-19 09:59:41 +01:00
Kubernetes Publisher
f36ae1f45e Merge pull request #135840 from michaelasp/makeDeterministic
Fix issue with TestReplaceEvents not sending history deterministically

Kubernetes-commit: 09ca6040f7a0d6f80cd74fbbd9691341190b092f
2025-12-19 06:29:13 +00:00
Michael Aspinwall
e07f72a3ec Fix issue with test not sending history deterministically
Kubernetes-commit: 2b330f0357cb825de0dc196b426c858b2bba7f2c
2025-12-19 00:45:43 +00:00
Kubernetes Publisher
66d2ca7fea Merge pull request #135832 from liggitt/test-replace-flake
Make TestReplaceEvents deterministic for delete event comparison

Kubernetes-commit: e07199dbc63e4aaa448f173045161ab209c71ec8
2025-12-18 18:29:04 +00:00
Kubernetes Publisher
ba82880ed7 Merge pull request #135539 from dims/move-httpcache-to-third_party/forked
move httpcache to third_party/forked

Kubernetes-commit: 04d866b37de3aefac063b2b6e12f11b30701c9ff
2025-12-18 18:29:02 +00:00
Jordan Liggitt
8e36d0d305 Make TestReplaceEvents deterministic for delete event comparison
Kubernetes-commit: fb288e3ce164e86f590768d8dce92152e9ea0bbe
2025-12-18 09:54:56 -05:00
Patrick Ohly
a01f268c3e dependencies: ginkgo v2.27.3 + gomega v1.38.3
This fixes some issues found in Kubernetes (data race in ginkgo CLI, gomega
formatting) and helps with diagnosing OOM killing in CI jobs (exit status of
processes).

The modified gomega formatting shows up in some of the output tests for the E2E
framework. They get updated accordingly.

Kubernetes-commit: db841afdbb193ea7d612472c7cc4c7b3f58eb676
2025-12-16 14:32:00 +01:00
Davanum Srinivas
f0e0dbdb4b move httpcache to third_party/forked
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: ab1ffaf12e243798df20a5c98192b8d108ba9a9b
2025-12-01 21:58:55 -05:00
Kubernetes Publisher
8f891d54a2 Merge pull request #135665 from michaelasp/replaceTest
Add test for replace events in client-go controller

Kubernetes-commit: 9d8404426fc33f6fbb2e5180b2e80f685b16bbd6
2025-12-18 14:29:09 +00:00
Kubernetes Publisher
d008946b23 Merge pull request #135615 from soltysh/drop_autoscaling_v2betaX
Drop autoscaling v2beta1 and v2beta2

Kubernetes-commit: 508074f023a82230a3af03a3827e7fa1aebbaa7a
2025-12-18 14:29:08 +00:00
Kubernetes Publisher
1aef261f0a Merge pull request #135371 from Nikateen/contextual-logging-leaderelection
Use contextual logging in leaderelection

Kubernetes-commit: 3558d1e9ce6829e91b6e81bcf96dda03b21f6258
2025-12-18 06:33:06 +00:00
Kubernetes Publisher
ca2dee6d05 Merge pull request #135324 from p0lyn0mial/upstream-watchlist-unsupported-wl-better-docs
client-go/reflector: Improve WatchListClient disabled log message for clarity

Kubernetes-commit: 13b10dc70fb018204a4175db96889e7811093c2c
2025-12-18 06:33:04 +00:00
Kubernetes Publisher
b960c92ed7 Merge pull request #135183 from enj/patch-11
Add enj to k8s.io/client-go approvers

Kubernetes-commit: d24c46b1d96d6299395dde872c392a9f54fdf716
2025-12-18 06:33:01 +00:00
Kubernetes Publisher
0d964cc386 Merge pull request #132807 from iholder101/feature/ImageVolumeWithDigest
[KEP-5365] Implement Image Volume with Digest

Kubernetes-commit: e14cdadc5a7b3c735782993d7899c9ea5df6e7b0
2025-12-18 02:29:38 +00:00
Michael Aspinwall
7d2828a105 Add test for replace events in controller
Kubernetes-commit: 6b977a28e90a1f369de91b07a13213ec05a5a426
2025-12-08 16:18:46 +00:00
Maciej Szulik
8dc82bbe31 Generated changes
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 583ddba56983d77a0a8c77c3bc7aaac9885c8690
2025-12-05 11:53:07 +01:00
Kubernetes Publisher
a296bd743c Merge pull request #135591 from p0lyn0mial/upstream-watchlist-reflector-log-fallback
downgrade reflector watchlist fallback log to V(4)

Kubernetes-commit: 9293f9326d41e1e4ad53096ef180dd6ab0f9c699
2025-12-05 02:33:54 +00:00
Kubernetes Publisher
6a962375ad Merge pull request #135580 from serathius/client-go-transformer
Embed proper interface in TransformingStore to ensure DeltaFIFO and RealFIFO are implementing it

Kubernetes-commit: 04e8064bccebd04981ee0094457550c9de4f92e3
2025-12-04 22:33:40 +00:00
Kubernetes Publisher
453ad29ccd Merge pull request #135536 from dims/bump-x/crypto-to-v0.45.0
Bump golang.org/x/crypto to v0.45.0

Kubernetes-commit: de61f598953ccd3e3950cdeda02740af2881048f
2025-12-04 22:33:40 +00:00
Lukasz Szaszkiewicz
4e4a2b723a downgrade reflector watchlist fallback log to V(4)
Kubernetes-commit: 3f42ca14011e972ee439a27d47415bc7574f2317
2025-12-04 16:14:19 +01:00
Davanum Srinivas
97256a6495 Bump golang.org/x/crypto to v0.45.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 5302b929ae55e86ad40b57d74c326529792d0439
2025-12-01 14:11:01 -05:00
Kubernetes Publisher
46360b527e Merge pull request #135131 from Dev1622/sig-storage/mock-expand-flake-fix
e2e/storage: deflake CSI Mock volume expansion quota validation

Kubernetes-commit: 4c04786f746e349a34042a0d59ec432a8a46ddcc
2025-11-26 20:44:31 +00:00
Jordan Liggitt
715440da15 Use transformer in consistency checker
Kubernetes-commit: 91368adbb556286942d996c60ab6cc39306415b7
2025-11-26 15:19:00 -05:00
Joe Betz
521671e60d hack/pin-dependency.sh sigs.k8s.io/structured-merge-diff/v6 v6.3.1
Kubernetes-commit: 5129fa152b3628ee65c060d3e2f59f69d271f7a6
2025-11-21 08:53:57 -05:00
Nikateen
a361bc1602 Use contextual logging in leaderelection
Update leaderelection package to use contextual logging variants:
- Replace wait.JitterUntil with wait.JitterUntilWithContext
- Replace wait.Until with wait.UntilWithContext

This enables proper contextual logging support as part of the
structured logging migration.

Ref #126379

Kubernetes-commit: c5b64ebf2ef8619fb96c35f3a613b1b945ebe0f2
2025-11-20 21:30:05 +05:30
Lukasz Szaszkiewicz
4fa8366691 client-go/reflector: Improve WatchListClient disabled log message for clarity
Kubernetes-commit: f4c24b5ef52272fe5e473e92fe5f98bee844f8aa
2025-11-17 09:25:33 +01:00
Dev1622
3878a6464b vendor: update vendor and license metadata after replacing BeTrue usage in csi tests
Kubernetes-commit: 216aaf76cba4b0cba05f0901d759dc017f833cd3
2025-11-13 05:11:59 +00:00
Surya Dev
9cee84c27c Resolve lint restriction on BeTrue by introducing Succeed() with contextual error messages
Kubernetes-commit: cee5b837da96f16536e048905bfe5be7103b21d2
2025-11-12 22:38:33 +05:30
Kubernetes Publisher
45e0decafa Merge pull request #132919 from ndixita/pod-level-in-place-pod-resize
Pod level in place pod resize - alpha

Kubernetes-commit: 9673a7fbf1045fa2c5786ddc5aeeb65b2f957d1c
2025-11-12 16:42:49 +00:00
Surya
990057bc99 Update vendored dependencies
Kubernetes-commit: c68b35c4c75cb5d4c016799a966808dff3d9a9a5
2025-11-12 16:17:46 +00:00
Carlos Eduardo Arango Gutierrez
7bb07cbe8e KEP-4680: Add message field support to DRA device health reporting
Author: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-Authored-By: Harshal Patil <12152047+harche@users.noreply.github.com>

Signed-off-by: Harshal Patil <12152047+harche@users.noreply.github.com>

Kubernetes-commit: ad6c155449e38d7cca22230fdb99ae02b65ccb59
2025-11-10 15:50:09 -05:00
Mo Khan
f6ec69ec64 Add enj to k8s.io/client-go approvers
Kubernetes-commit: f184f40979338c9180819da5b2b10f43275d1ae0
2025-11-06 09:16:21 -05:00
Itamar Holder
5223424e9f Add auto-generated code and boilerplate
Signed-off-by: Itamar Holder <iholder@redhat.com>

Kubernetes-commit: af66766bf5799661860235c04154f26f391a269a
2025-11-05 10:16:26 +02:00
Basheer
bd70455c5c update generated code
Kubernetes-commit: eb343a9049032fd0a9f39da30ba679c5882730e7
2025-11-04 22:07:21 +05:30
Joel Speed
d416af4df4 Update generated code
Kubernetes-commit: 0ebf47cb080a207a4829ce8e604e51bb494d63fb
2025-10-23 11:11:45 +01:00
Aditi Gupta
9e310140a3 apimachinery: Use informer.RunWithContext in various components
Kubernetes-commit: 915866f0e414d0afc4f1cc883d86a51a66d74e15
2025-10-22 14:48:54 -07:00
ndixita
3980f079a7 Generated files from API changes
Kubernetes-commit: b8777c32633ecfb214b02073369edadd23e8e9ec
2025-10-15 18:39:35 +00:00
Heba
5020b674f8 KEP-5471: Extend tolerations operators (#134665)
* Add numeric operations to tolerations

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* add default feature gate

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add integration tests

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add toleration value validation

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add validate options for new operators

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove log

Signed-off-by: helayoty <heelayot@microsoft.com>

* Update feature gate check

Signed-off-by: helayoty <heelayot@microsoft.com>

* emove IsValidNumericString func

Signed-off-by: helayoty <heelayot@microsoft.com>

* Implement IsDecimalInteger

Signed-off-by: helayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add logs to v1/toleration

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>

* Update integration tests and address code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add feature gate to the scheduler framework

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove extra test

Signed-off-by: helayoty <heelayot@microsoft.com>

* Fix integration test

Signed-off-by: helayoty <heelayot@microsoft.com>

* pass feature gate via TolerationsTolerateTaint

Signed-off-by: helayoty <heelayot@microsoft.com>

---------

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>

Kubernetes-commit: aceb89debc2632c5c9956c8b7ef591426a485447
2025-11-11 00:32:36 +00:00
Kubernetes Publisher
6ce2c0f8c3 Merge pull request #134870 from pmengelbert/pmengelbert/kuberc/4
Add client-go credential plugin to kuberc

Kubernetes-commit: 183892b2c96aa962118ccfc2ee1c971caf72b16b
2025-11-10 04:32:36 +00:00
Kubernetes Publisher
5c322d3acd Merge pull request #134189 from mortent/NewUpdatePartitionableDevices
Updates to DRA Partitionable Devices feature

Kubernetes-commit: 0cfbf89e709e2acbc0d4cfa46954e873236c5bb9
2025-11-07 00:33:11 +00:00
Kubernetes Publisher
aa76619c41 Merge pull request #133648 from richabanker/merged-discovery
[KEP:4020] Peer-aggregated discovery

Kubernetes-commit: b214dae15d588ba9dc0bbfe8e82c82df434d89cc
2025-11-07 00:33:08 +00:00
Morten Torkildsen
99c4257e63 Run make update
Kubernetes-commit: ef3f6a250754318d7d9d94a518acccd676a47fca
2025-11-06 16:04:19 +00:00
Richa Banker
cb5e00dc36 peerproxy: Refactor into separate files and add exclusion filter
Kubernetes-commit: d6907457723a8f9a6eb5a9789424c34286d99528
2025-11-05 21:14:26 -08:00
Richa Banker
09ccc185ed discovery: Add profile-based content negotiation
Add support for 'profile=nopeer' in Accept headers to allow clients
to opt out of peer-aggregated discovery and request local-only results.

Updates discovery client to set appropriate Accept headers based on
whether peer-aggregated discovery is desired.

Part of KEP-4020: Unknown Version Interoperability Proxy

Kubernetes-commit: 6a07342d37a762230209e362d383e1fbfc325b51
2025-11-05 21:14:25 -08:00
Kubernetes Publisher
0e6fc04326 Merge pull request #134564 from macsko/gang_scheduling
KEP-4671: Add Workload API

Kubernetes-commit: 0c2aa7fee2eff82dd5e44ae30c8bcfef7a2140db
2025-11-06 12:32:56 +00:00
Peter Engelbert
c529a209c2 Add client-go credential plugin to kuberc
Remove reference to internal types in kuberc types

* Remove unserialized types from public APIs

Also remove defaulting

* Don't do conversion gen for plugin policy types

Because the plugin policy types are explicitly allowed to be empty, they
should not affect conversion. The autogenerated conversion functions for
the `Preference` type will leave those fields empty.

* Remove defaulting tests

Comments and simplifications (h/t jordan liggitt)

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

Kubernetes-commit: fab280950dabfefabe6a8578b7a76372a9b21874
2025-10-24 16:06:33 -04:00
Maciej Skoczeń
9b2717cec1 api: Workload API and Pod WorkloadReference generated files
Kubernetes-commit: 078f462a955bb06cbf8de3e0d6fe2e190cf14e49
2025-10-10 09:44:19 +00:00
Kubernetes Publisher
6a14de8219 Merge pull request #134339 from huww98/mutable-pv-affinity
KEP-5381: mutable pv nodeAffinity

Kubernetes-commit: 326ce8b16d777edcfb3c19c2118ec2860945d4e1
2025-11-06 12:32:54 +00:00
Kubernetes Publisher
b36e6498c1 Merge pull request #134180 from p0lyn0mial/upstream-watchlist-dynamic-interface
Promote/Enable WatchListClient feature for release 1.35

Kubernetes-commit: 099ef07c9f90a7650b5a06f58fa7005d9c760761
2025-11-06 12:32:52 +00:00
Kubernetes Publisher
823f3a75f4 Merge pull request #133389 from pravk03/node-capabilities
Introduce node declared features framework

Kubernetes-commit: b869afe68d5ffb1f74ab584653451efc811698d7
2025-11-06 12:32:51 +00:00
Lukasz Szaszkiewicz
092b2fb360 client-go/features: enable WatchListClient for 1.35 release
Kubernetes-commit: ca8847149e3e19444ffec878f0002f5f9edef566
2025-11-03 20:33:48 +01:00
Praveen Krishna
d0f0666dd2 autogenerated files from "make update"
Kubernetes-commit: 3c22291a4b0bb2407630d4fa112256aae16398a6
2025-11-01 00:07:52 +00:00
Kubernetes Publisher
7d09f53b04 Merge pull request #135072 from Jefftree/graceful-queue
Gracefully shutdown typed queue

Kubernetes-commit: 26a2945d5de6c1dc0426aebe1ad36a32963aeb39
2025-11-05 16:33:11 +00:00
Kubernetes Publisher
5aa3ca7f2a Merge pull request #134152 from pohly/dra-device-taints-1.35
DRA: device taints: new ResourceSlice API, new features

Kubernetes-commit: c1a6a3ca71a88a3d43580b2ffce6966c58f8bd56
2025-11-05 00:32:30 +00:00
Kubernetes Publisher
afcd76c2c0 Merge pull request #135080 from dejanzele/feat/promote-job-managedby-to-ga
KEP-4368: Job Managed By; Promote to GA

Kubernetes-commit: 97cb47a91330db13d05e8674ce2a80ace19e4d99
2025-11-05 00:32:28 +00:00
Kubernetes Publisher
50efa83a3d Merge pull request #134624 from yt2985/podcertificates-beta
Promote Pod Certificates feature to beta

Kubernetes-commit: a058cf788a214b25c42173a6d7df8e77b26e2b1b
2025-11-05 00:32:26 +00:00
Kubernetes Publisher
205531f8d5 Merge pull request #132240 from yue9944882/delta-fifo-batch
Adding batch handling for popping items from RealFIFO

Kubernetes-commit: 645073f978ed0d7308ad3be453a36a8e99006b3c
2025-11-04 11:42:05 -08:00
Jefftree
773743c372 refactor updateUnfinishedWork into separate function to use defer unlock
Kubernetes-commit: f1bd4f509ebb2f9d02971c2dff85d5933eb074df
2025-11-04 15:27:53 +00:00
Dejan Zele Pejchev
15b762b95c KEP-4368: Job Managed By; Promote to GA
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>

Kubernetes-commit: 3dabd4417d941d28e63c96c80d03ae2db1895838
2025-11-03 23:28:13 +01:00
Jefftree
1463bcbba2 Fix queue to gracefully shutdown
Kubernetes-commit: bdb2e37781aec3bfec477a7beddd9fa5ac4eab1b
2025-11-03 19:04:11 +00:00
Patrick Ohly
c94930065a generated files
Kubernetes-commit: 75c9186792811a5b4bc38a5171283e2f58a718a0
2025-10-28 21:20:34 +01:00
Min Jin
d5cd2dd65f Adding batch handling for popping items from RealFIFO
Signed-off-by: Min Jin <minkimzz@amazon.com>

Update staging/src/k8s.io/client-go/tools/cache/the_real_fifo.go

optimizing fifo loop

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>
Signed-off-by: Min Jin <minkimzz@amazon.com>

refactoring PopBatch to accept []Delta

Signed-off-by: Min Jin <minkimzz@amazon.com>

Kubernetes-commit: 611b4c1408f529de4d4e94e6dd33be2ed1df9276
2025-10-24 18:07:32 -07:00
Kubernetes Publisher
6f5c1adc65 Merge pull request #134934 from siyuanfoundation/client-fg
change client go default features to versioned

Kubernetes-commit: ec0f275e90127d8dc3fafaf231ff882bd4ced0c8
2025-11-03 19:43:27 +00:00
Kubernetes Publisher
4f9edc15a7 Merge pull request #134881 from pohly/e2e-slow-priority
E2E: run slow tests first, using new Ginkgo

Kubernetes-commit: cd0ddec139502081c2edf73c0329bcc07b5048f4
2025-11-01 15:25:50 +00:00
Siyuan Zhang
504fb21b89 change client go default features to versioned
so that their enablement can be consistent with emulated version.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: d4c6e0bfd04a9efb1ddb33afdcaa49eb8695d8e5
2025-10-31 10:04:06 -05:00
Patrick Ohly
47df0318fc dependencies: ginkgo v2.27.2, gomega v1.38.2
Specifically the new AddTreeConstructionNodeArgsTransformer and SpecPriority in
Ginkgo will be useful.

Gomega gets updated to keep up-to-date.

Kubernetes-commit: 6034321603be95409028f0173e0c372515008dbb
2025-10-24 20:53:04 +02:00
Kubernetes Publisher
efdec3e7ce Merge pull request #135004 from pohly/dependencies-x-repos
dependencies: various minor updates

Kubernetes-commit: 02398258b15ff894a7c73acdeb9270b32f6d02a9
2025-10-31 15:25:58 +00:00
Kubernetes Publisher
083e82ae0c Merge pull request #134811 from p0lyn0mial/upstream-watchlist-unsupported-wl-cache-testing
client-go/tools/cache/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics

Kubernetes-commit: ad13a96a1fa97c5516ab198df738e6ca13ee4290
2025-10-31 15:25:54 +00:00
Kubernetes Publisher
a90a9150bc Merge pull request #135002 from p0lyn0mial/upstream-watchlist-unsupported-wl-client-tools-watch-test
client-go/tools/watch/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics

Kubernetes-commit: f1989437f8b4c7725e8c603d6c29693b89298f37
2025-10-31 15:25:53 +00:00
Kubernetes Publisher
7198405576 Merge pull request #135000 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-trackers
k8s.io/client-go/testing/fixture: does not support WatchList semantics

Kubernetes-commit: e23dbe1f6ed042e30c166d1106b1baab3cc50d60
2025-10-31 11:26:00 +00:00
Patrick Ohly
47c3af08fa dependencies: various minor updates
This is a collection of updating several unversioned modules. Those updates are
eventually going to reach Kubernetes, doing them together now makes PRs for
future major updates smaller.

Kubernetes-commit: 5993782d6537bab9edf95590c123f96ea39ca185
2025-10-31 11:30:26 +01:00
Lukasz Szaszkiewicz
928c08fb07 k8s.io/client-go/testing/fixture: does not support WatchList semantics
Kubernetes-commit: 1055d8541e62322dab37858fb8798a1881acdd2f
2025-10-30 15:05:45 +01:00
Kubernetes Publisher
63b5f59425 Merge pull request #134919 from p0lyn0mial/upstream-watchlist-unsupported-wl-wrapp-remaining-lws
watchlist: wrap remaining LW with ToListWatcherWithWatchListSemantics

Kubernetes-commit: 6eee830d4fa0cdb7d75dac4b3b4d22d639dce54b
2025-10-30 15:26:24 +00:00
Kubernetes Publisher
c207d22130 Merge pull request #134854 from serathius/informer-benchmark
Benchmark SharedIndexInformer

Kubernetes-commit: ab39c8be5543ec83a2aedcab64a259bb1bd6f120
2025-10-30 15:26:23 +00:00
Kubernetes Publisher
d9e3e97bc8 Merge pull request #134784 from michaelasp/svm_beta2
SVM: bump the API to beta, remove unused fields

Kubernetes-commit: 3ec2d82da57f2018fc76ae13da7a23a3f9a364f5
2025-10-29 23:24:40 +00:00
Michael Aspinwall
7aa71710ca Update SVM to Beta
Co-authored-by: Stanislav Láznička <stlaz.devel@proton.me>

Kubernetes-commit: 3b72759d1bcfe0820b27909110f6ab6a6cc99034
2025-10-29 19:34:32 +00:00
Kubernetes Publisher
cd96252d84 Merge pull request #133087 from atiratree/terminating-replicas-beta
promote DeploymentReplicaSetTerminatingReplicas to Beta

Kubernetes-commit: f051670a473d8583af3397795938d37ca4ebf637
2025-10-27 15:24:46 +00:00
Kubernetes Publisher
342dcaf481 Merge pull request #134748 from p0lyn0mial/upstream-watchlist-unsupported-wl-clients-improve-units
client-go/clients: improve TestWatchListSemanticsSimple

Kubernetes-commit: a7b67429400f08a7f43892d303273be06b70b17f
2025-10-27 11:24:28 +00:00
Kubernetes Publisher
91dcaf4e5c Merge pull request #134826 from aramase/aramase/f/kep_5538_beta_impl
CSI driver opt-in for service account tokens via secrets field

Kubernetes-commit: 1135d04f1d7746b553a675a558efc58e651eabae
2025-10-24 23:24:40 +00:00
Marek Siarkowicz
5ac9ec00af Benchmark SharedIndexInformer
Kubernetes-commit: 7a9d718cdf5e26f83ce45cd5b24f06ef7e678bea
2025-10-22 16:22:40 +02:00
Lukasz Szaszkiewicz
42503cca34 client-go/clients: improve TestWatchListSemanticsSimple
Kubernetes-commit: 6b82a823b1a91e727d510b2eeab8765f942ad449
2025-10-21 16:25:07 +02:00
胡玮文
f8b7fe98c4 mention MutablePVNodeAffinity in the API doc
Kubernetes-commit: 78a8c2e6a35b5621a7afa9066770a819d417f707
2025-10-20 21:22:02 +08:00
Anish Ramasekar
75128a8d3d Add CSI driver opt-in for service account tokens via secrets field
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 30a6d4b389a6c6b10c5bd136216b47e55da3f18a
2025-10-13 14:16:44 -05:00
Kubernetes Publisher
4953849642 Merge pull request #134457 from danwinship/prefersamenode
KEP-3015: update PreferSameTrafficDistribution to GA

Kubernetes-commit: 6652c9fadf4fa2febdca4a856a0340086236f9e5
2025-10-23 23:24:37 +00:00
Kubernetes Publisher
715199a180 Merge pull request #134780 from joshjms/bump-etcd-sdk-v3.6.5
etcd: Bump etcd sdk to v3.6.5

Kubernetes-commit: 4415f00294cff245a9594055aed29abcd4e4a0c1
2025-10-22 23:25:04 +00:00
joshjms
dc0763eaa2 etcd: bump etcd sdk to v3.6.5
Signed-off-by: joshjms <joshjms1607@gmail.com>

Kubernetes-commit: 7f99d6672f75d9f757953745bdabf598139b4c30
2025-10-22 21:36:06 +08:00
Kubernetes Publisher
a5b1b112d9 Merge pull request #134463 from cvan20191/fix-resizepolicy-ephemeral-container-docs
Fix resizepolicy ephemeral container docs

Kubernetes-commit: 2db2d7b1b54df27e591b5b50b3707d907d8afd9b
2025-10-21 23:24:29 +00:00
Kubernetes Publisher
ff1ce9e245 Merge pull request #132243 from xigang/real_fifo
Add RealFIFOOptions struct to provide structured configuration for RealFIFO

Kubernetes-commit: a4f14e57f4850541937659dc1cbfc1a5e5efaebf
2025-10-21 19:24:23 +00:00
Kubernetes Publisher
f49b36f94e Merge pull request #134731 from tisonkun/patch-1
Fix comments and reformat import statements

Kubernetes-commit: 0eb5db7dbe49c077fb8f7e4448adfb829062a778
2025-10-21 19:24:22 +00:00
Kubernetes Publisher
659efe6ca2 Merge pull request #134714 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-typed-inf
client-go/typed/informers: wrap the LW with WatchList semantics

Kubernetes-commit: 350481c4747da5c2ad4f24e71e7edaabbd4cfe2e
2025-10-21 15:25:16 +00:00
Kubernetes Publisher
002cac449e Merge pull request #134674 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-meta-inf
client-go/metadata/metadatainformer: wrap the LW with WatchList semantics

Kubernetes-commit: 183e01c6f2098710540bcc9cfa40bc8055eb31a6
2025-10-20 16:51:37 +00:00
Kubernetes Publisher
716ba150d1 Merge pull request #134670 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-dynamic-inf
client-go/dynamic/dynamicinformer: wrap the LW with WatchList semantics

Kubernetes-commit: 0d685e659293b9d242916d631c5b6e72011d5355
2025-10-20 16:51:36 +00:00
tison
d707fb729f Fix comments and reformat import statements
Kubernetes-commit: f3d1fd23c576f4691a336444496ab7e6c619624c
2025-10-20 21:55:12 +08:00
Lukasz Szaszkiewicz
e7ebdf6180 client-go/kubernetes_test/clientset_test: intro TestUnSupportWatchListSemantics
Kubernetes-commit: f8868e9cace5903b425425605e4946817dd11770
2025-10-17 14:43:53 +02:00
Lukasz Szaszkiewicz
e8a837163e ./hack/update-codegen.sh
Kubernetes-commit: 5594d94e6716599981948d21599700d6dfe43b11
2025-10-17 14:35:36 +02:00
Lukasz Szaszkiewicz
fed267b819 client-go/metadata/metadatainformer: wrap the LW with WatchList semantics
Kubernetes-commit: 78fcb4475f4f1ff2d31830c057e8dcb45a1de128
2025-10-17 14:06:47 +02:00
Lukasz Szaszkiewicz
c1675fba6d client-go/dynamic/dynamicinformer: wrap the LW with WatchList semantics
Kubernetes-commit: 8f2d7581eb1457f78c6b0b83bda532b902d5f018
2025-10-17 10:56:26 +02:00
Kubernetes Publisher
8316c2dd5b Merge pull request #134641 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-reflector
client-go/tools/cache/reflector: supports watchlist.DoesClientNotSupportWatchListSemantics

Kubernetes-commit: e64ed3d8ba86d0d6dc27c80710fc1570a9478f67
2025-10-17 12:54:07 +00:00
Kubernetes Publisher
884e76ff50 Merge pull request #134663 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-typed
client-go/typed/fake: expose IsWatchListSemanticsUnSupported

Kubernetes-commit: f794aa12d78f5b1f9579ce8a991a116a99a2c43c
2025-10-17 08:49:31 +00:00
Christian Van
909047f6b3 docs: EphemeralContainerCommon.ResizePolicy: This field cannot be set on ephemeral containers
Kubernetes-commit: b95439f6d1a6a16e9dcda9c71db10596b3c0c0ea
2025-10-16 22:23:26 -04:00
Kubernetes Publisher
6661e485ec Merge pull request #134646 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-meta
client-go/metadata/fake: expose IsWatchListSemanticsUnSupported

Kubernetes-commit: c699725502689f177b3ba166107550891b110c31
2025-10-17 00:45:18 +00:00
Kubernetes Publisher
c655edb878 Merge pull request #133153 from helayoty/helayoty/enable-beta-maxUnavailable
Update MaxUnavailableStatefulSet feature gate to beta

Kubernetes-commit: 7af016ec317ef4b55b73cfb372ed8021495c5988
2025-10-16 20:51:54 +00:00
Kubernetes Publisher
5a42d726bf Merge pull request #133128 from jm-franc/set-gate-to-beta
Promote HPAConfigurableTolerance gate to beta

Kubernetes-commit: 50e3cb3f583c6eb5d84e7f4f752a628839045657
2025-10-16 20:51:52 +00:00
Lukasz Szaszkiewicz
943d406efe ./hack/update-codegen.sh
Kubernetes-commit: d15b2893341854ce69e58c18f0899e9c0cf61f33
2025-10-16 22:40:29 +02:00
Lukasz Szaszkiewicz
92bae31190 client-go/kubernetes_test/fake_client_test: TestDoesClientSupportWatchListSemantics
Kubernetes-commit: 4d9fcfeeca86f274ad1885774ea4370e33d5ac77
2025-10-16 22:34:32 +02:00
Kubernetes Publisher
fcb9549cdf Merge pull request #134642 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-dynamic
client-go/dynamic/fake: does not support WatchList semantics

Kubernetes-commit: f6c629ecd26f67c0166f6f5a685f01ca4dda1271
2025-10-16 06:38:05 -07:00
Lukasz Szaszkiewicz
55359a6c61 client-go/dynamic/fake: expose IsWatchListSemanticsUnSupported
Kubernetes-commit: 82e516200a4afaa33e87aa2efedaa07430f2dd7f
2025-10-16 12:10:10 +02:00
Kubernetes Publisher
3a250ce40f Merge pull request #134505 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics-reflector-listwatch
client-go/tools/cache/listwatch: intro ToListWatcherWithWatchListSemantics

Kubernetes-commit: 3828756d90cf28e0ab5e0ccd550041b70c642b91
2025-10-16 12:44:03 +00:00
Kubernetes Publisher
f217e7096a Merge pull request #134588 from liggitt/fixes-only-no-go-bump
go 1.25.2/1.24.8 related fixes

Kubernetes-commit: f7fb7cd86b6db5531087b4ae3b1e8198af3c927e
2025-10-14 16:10:20 +00:00
Lukasz Szaszkiewicz
6777feb020 client-go/tools/cache/listwatch: intro ToListWatcherWithWatchListSemantics
returns a ListerWatcher that knows whether the provided client explicitly
does NOT support the WatchList semantics. This allows Reflectors
to adapt their behavior based on client capabilities.

Kubernetes-commit: 3b93755c0c07ce898f1c2a3924adef6c3143f247
2025-10-12 00:29:31 +02:00
Lukasz Szaszkiewicz
9c67f4c479 watchlist: wrap remaining LW with ToListWatcherWithWatchListSemantics
Kubernetes-commit: 4fd41778b87a7a02066566cc12e3eb4a87a071ee
2025-10-10 22:44:45 +02:00
Jordan Liggitt
69ba058bc8 Remove invalid SAN certificate construction
Kubernetes-commit: 39d37a1e92672bcbba8bfbd4166b409bdea9a099
2025-10-09 16:27:05 -04:00
Kubernetes Publisher
8de342516c Merge pull request #134396 from p0lyn0mial/upstream-watchlist-unsupported-wl-semantics
client-go/util/watchlist/watch_list: intro DoesClientNotSupportWatchListSemantics

Kubernetes-commit: b6d7517d2a27a5cf4ca85c19fde88a3a3efc3e6e
2025-10-09 13:28:34 +00:00
Kubernetes Publisher
efcdcf7828 Merge pull request #134256 from liggitt/protoc-gogo-poc
KEP-5589 - drop gogo runtime dependencies

Kubernetes-commit: 6bc4914b841f5bf032490cf105f57dc5bfe475ba
2025-10-08 21:28:35 +00:00
Dan Winship
0ca6027179 Belatedly remove references to PreferSameTrafficDistribution being Alpha
Kubernetes-commit: b13564a63c36c9d5f0a8ef7ab6467dc3a9fa0017
2025-10-04 08:31:57 -04:00
Heba Elayoty
1ec59ffa19 update comments
Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

Kubernetes-commit: fe681cfd8f61ef318c1c1b2c10e1daf16f806e8d
2025-09-29 14:10:26 -07:00
Lukasz Szaszkiewicz
83eab51fe2 client-go/tools/watch/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics
Kubernetes-commit: 9e462123d6495f6f7ed6e0a7c40c2ddf04ba10fc
2025-09-29 13:59:40 +02:00
Lukasz Szaszkiewicz
cc2ef1778d client-go/metadata/fake: expose IsWatchListSemanticsUnSupported
Kubernetes-commit: 8324fc3e0343e1c6134f3e83be2d77d9556a496c
2025-09-25 23:28:07 +02:00
Lukasz Szaszkiewicz
03859f4bad client-go/util/watchlist/watch_list: intro DoesClientNotSupportWatchListSemantics
Kubernetes-commit: 4b3e562dc8c19f7005cc0d50cbf54101e5b8f796
2025-09-25 20:39:12 +02:00
Lukasz Szaszkiewicz
3502696346 client-go/tools/cache/reflector: supports watchlist.DoesClientNotSupportWatchListSemantics
Kubernetes-commit: 4bb2bd05322e127658e55a06995c021b3c5fbc41
2025-09-25 15:36:17 +02:00
Jordan Liggitt
d21f567e5b Regenerate vendor
Kubernetes-commit: 7f58bb9abdf23c37e5e201054db5adab6eee60cd
2025-09-24 23:37:55 -04:00
Kubernetes Publisher
3c3a19fb56 Merge pull request #134208 from n2h9/126379-replace-non-WithContext-functions-to-use-WithContext-functions-instead-of-duplicates
[126379] [client-go] chore: use WithContext functions inside old functions to remove code duplication

Kubernetes-commit: 81059575f6c97e5e73729c8df5a7172190a10950
2025-10-01 03:27:22 +00:00
Kubernetes Publisher
5eac01c2bb Merge pull request #134185 from DanBokete/deprecate-caseless-validation
Feat: Adds warnings when ResourceSlice driver names contain uppercase characters

Kubernetes-commit: 8ebc216c595158389fa20c4fff75a8c84cbe3fff
2025-09-29 19:27:26 +00:00
Nikita B
ce58c49b34 [126379] [go-client] chore: use WithContext functions: do not use SleepWithContext inside Sleep, use CalculateBackoff inside CalculateBackoffWithContext
Signed-off-by: Nikita B <n2h9z4@gmail.com>

Kubernetes-commit: 56eb9a1a960cd6f841d709cb3f8c06bb4ff62504
2025-09-24 18:02:14 +02:00
Jean-Marc François
0d522470d7 Promote HPAConfigurableTolerance gate to beta
Kubernetes-commit: c1e74a1a9822da88e2e77b7726b6e80db54a5fcb
2025-09-23 17:51:30 -04:00
Nikita B
81c615acd6 [126379] [go-client] chore: use WithContext functions
Signed-off-by: Nikita B <n2h9z4@gmail.com>

Kubernetes-commit: 51c525a14028af98c1faaa2437542cfe489fb22d
2025-09-22 19:36:45 +02:00
Dan Bokete
1d528010ef Deprecate caseless driver name validation and enforce lowercase warnings
- Deprecate IsDNS1123SubdomainCaseless to avoid caseless validation issues.
- Warn when ResourceSlice driver names contain uppercase characters.
- Clarify driver names must be DNS subdomains and use only lowercase letters.
- Update tests, staging code, and OpenAPI spec to reflect the changes.

Kubernetes-commit: b40b67b9cfff1fdd6a1177372bdb545c5d2b6bbb
2025-09-21 15:35:37 +01:00
Kubernetes Publisher
2a2f191a6d Merge pull request #134271 from Jefftree/scheme-nil
Add nil scheme check in GetReference

Kubernetes-commit: 9a3dce00ae32c81346883fb5a689a8240d48c218
2025-09-25 23:27:03 +00:00
Jefftree
38c61c9925 Add nil scheme check in GetReference
Kubernetes-commit: 051b29bde3817ceb22b157dabf32615ce383f319
2025-09-25 14:28:17 +00:00
Kubernetes Publisher
6cf045f1f4 Merge pull request #134228 from liggitt/proto-gogo-poc
gogo protobuf dependency cleanup

Kubernetes-commit: 1a04a958fb4ba3ddb6c7383e0ff7876d56fa714c
2025-09-24 03:28:30 +00:00
Jordan Liggitt
472a7d329a Clean up gogo dependency tracking
Kubernetes-commit: a87068c685d353bc6e3d25828d55ec1ef8d3cda6
2025-09-23 13:59:37 -04:00
Jordan Liggitt
b8c855877f Drop unnecessary gogo dependencies
Kubernetes-commit: 840aa4722e982cfaac5d76735909035d06312c06
2025-09-23 11:34:58 -04:00
Lukasz Szaszkiewicz
562096cc40 k8s.io/client-go/tools/cache/test: wrap the LW with toListWatcherWithUnSupportedWatchListSemantics
Kubernetes-commit: ae201951a8a39316d4154a07592f464293764a83
2025-09-20 22:57:14 +02:00
Kubernetes Publisher
7b6fbf8e60 Merge pull request #134145 from dims/update-to-latest-sigs.k8s.io/json
update to latest sigs.k8s.io/json

Kubernetes-commit: 6070f5a92918020b8c792ca1219a5fbbfa53a556
2025-09-19 03:27:28 +00:00
Davanum Srinivas
0e786b9839 update to latest sigs.k8s.io/json
Kubernetes-commit: 736f7b9a1b514237c78e28885198f6c2e6a0a0b0
2025-09-18 20:55:31 -04:00
Patrick Ohly
1244da43b1 DRA API: device taints 1.35
This raises the number of allowed taints per device to 16 by lowering
the number of allowed devices to 64 per ResourceSlice if (and only if!)
taints are used.

"effect: None" and DeviceTaintRule status with conditions get added
to support giving feedback to admins.

Instead of merely adding the new effect value, this also changes validation of
the enum so that unknown values are valid if they were already stored. This
will simplify adding new effects in the future because validation won't fail
for them after a downgrade. Consumers must treat them like this new None
effect, i.e. ignore them.

Kubernetes-commit: fee14ffca2099b2d7a0bfc5761691b363eac4de1
2025-09-18 19:44:06 +02:00
Heba Elayoty
b6a9154664 update comments on beta apis
Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

Kubernetes-commit: 83163d0b4a9ff49c50d84634a529d2dc3e7b143d
2025-09-18 04:47:05 -07:00
Kubernetes Publisher
329b0909fd Merge pull request #134120 from BenTheElder/golang-language-125
Upgrade go language version to 1.25

Kubernetes-commit: 0ca861d5ed67d944285ee5ea80cf520d11e8b755
2025-09-18 00:26:25 +00:00
Benjamin Elder
f251672a86 bump go language version to 1.25
Kubernetes-commit: 563d4d651ca2905e3ed4d643021295fb19f871fb
2025-09-17 13:32:42 -07:00
tinatingyu
15ed51a4ca Promote PodCertificateRequests to v1beta1
Kubernetes-commit: 59e075e8d35dbc16c5db7c302f3836f3f9a144f8
2025-09-16 20:24:07 +00:00
Kubernetes Publisher
8decd4f5c0 Merge pull request #133917 from n2h9/133916-fix-cert-key-files-data-validation-error
[client-go] [cli-runtime] [133916]: fix config override logic when override provides ClientKey, ClientCertificate

Kubernetes-commit: f2ef1c4d08492144419010f17568c2fe41b3f547
2025-09-12 11:52:31 +00:00
Kubernetes Publisher
14aa03798d Merge pull request #133923 from maxcelant/store-index-set
Replace deprecated sets.String with sets.Set in client-go/tools/*

Kubernetes-commit: f51cca25275300750bb316095d60dc8ad53d71ea
2025-09-12 07:52:27 +00:00
Kubernetes Publisher
f8bdeaf0f3 Merge pull request #131755 from jpbetz/openapi-type-name-gen
Allow OpenAPI model package names to be declared by APIs

Kubernetes-commit: 69e637f24c23764973e30491afab202c0d083399
2025-09-11 19:52:47 +00:00
Kubernetes Publisher
778883995e Merge pull request #133191 from Jefftree/rev
Add jefftree to OWNERS

Kubernetes-commit: 26b246ae667f5f9b0f90e1a2abd9fc2a50f4d0d3
2025-09-11 15:52:36 +00:00
Kubernetes Publisher
fb0bc3ec65 Merge pull request #133777 from yshngg/patch/tautological-condition
refactor(event): simplify conditional logic in event handling

Kubernetes-commit: 98df6dde86a0e6f17607c825050dbee02af43d8b
2025-09-11 03:53:10 +00:00
Kubernetes Publisher
81eaeec477 Merge pull request #132663 from mrIncompetent/copy-source-comments
applyconfiguration-gen: preserve struct and field comments in generated code

Kubernetes-commit: 3e48146c5d3343f00d44b5177b32aa7c2993d36f
2025-09-10 15:56:04 -07:00
Henrik Schmidt
422ded29ea ./hack/update-codegen.sh
Kubernetes-commit: 5e66bb69720189d83099e850e21cbedc667cdec7
2025-09-10 21:57:45 +02:00
Joe Betz
645ba6cdcf generate
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: 5647c07179df7df9ae6775f3f7692462db93d68b
2025-09-10 15:52:58 -04:00
Joe Betz
185d1573e2 Add model name generator tags
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: e910c181cb9a91cd01a73869921ee285377aea61
2025-09-10 15:52:58 -04:00
Joe Betz
5c5da7754f Bump kube-openapi
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: 8b63ace66c5b21a886aa7d3803c0f70bd2a51c8e
2025-09-10 15:52:57 -04:00
Kubernetes Publisher
bf9c276af9 Merge pull request #133921 from dims/update-prometheus-client-golang-and-common-packages
update prometheus' client_golang and common packages

Kubernetes-commit: bbd859808d0cef566fbfc89639926b7cc50d9bd5
2025-09-10 15:52:45 +00:00
Kubernetes Publisher
a8c6321eee Merge pull request #133632 from jpbetz/client-go-docs
Add doc.go, ARCHITECTURE.md, and example_test.go to client-go

Kubernetes-commit: f6dd9d975176b01123d019c2bfe25d37fbfc10ac
2025-09-10 15:52:43 +00:00
Kubernetes Publisher
1e409efaee Merge pull request #133898 from HadrienPatte/client-go/compatibility-matrix
Update client-go compatibility matrix to include releases up to 1.34

Kubernetes-commit: 447ca5ff024a0ba7511577f1afe16130d997a9b2
2025-09-08 20:29:26 +00:00
Nikita B
2ab8e3619f [client-go] [cli-runtime] [133916]: handle properly config override logic when override provides ClientKey, ClientCertificate: use values from overrides when one of the field (file or data) is present in inverrides
Signed-off-by: Nikita B <n2h9z4@gmail.com>

Kubernetes-commit: 6b908c192cc828abef39c35dcc4921281f950958
2025-09-08 07:01:44 +02:00
Max Celant
c28edcd52c Replace deprecated sets.String with sets.Set for Index type
updating to include initialization in func

Update store to use sets.Set

updating tests to use sets.New instead of sets.NewString

update store_test

update index_test

update controller_test file

update delta_fifo file

update expiration_cache_fakes file

update index_test file

update thread_safe_store file

update events_cache file

update thread_safe_store_test

update expiration_cache_test

small refactor of for loop

unexport the Index type -> index

Kubernetes-commit: c08b9ab3b5c78023e46ce03fde894b24533c68ef
2025-09-07 21:37:30 -05:00
Davanum Srinivas
65b3c70fc5 update prometheus' client_golang and common packages
Kubernetes-commit: bdfca587f48e816a667b1b1e5766200746b90e3a
2025-09-07 17:20:43 -04:00
Nikita B
e703bc019f [client-go] [cli-runtime] [133916]: handle properly config override logic when override provides ClientKey, ClientCertificate
Signed-off-by: Nikita B <n2h9z4@gmail.com>

Kubernetes-commit: fc8907da38dc1a6af7d7b2c18d87c1dd35ca8c68
2025-09-06 14:05:59 +02:00
Kubernetes Publisher
dccc3e53f7 Merge pull request #133690 from pohly/log-client-go-leaderelection
client-go leaderelection: structured, contextual logging

Kubernetes-commit: b9c467483e1db90b7aca125c98827f8553cc635b
2025-09-06 00:34:19 +00:00
Joe Betz
fad66b0287 Apply feedback
Kubernetes-commit: bf851e8bcfa6213218c6352636dcc5114d83399c
2025-09-05 15:43:48 -04:00
Hadrien Patte
44f45dd0ae Update client-go compatibility matrix to include releases up to 1.34
Kubernetes-commit: cee1ea7225aad1f04405056d23e94dc4fb35e2e1
2025-09-04 23:45:51 +02:00
Kubernetes Publisher
d327527793 Merge pull request #133851 from andremarianiello/respect-dynamic-fake-options
client-go/dynamic/fake: Stop ignoring options

Kubernetes-commit: 39b160f10cf0a71954b58dcc60a013ff7faa34fa
2025-09-03 16:29:42 +00:00
Andre Marianiello
5b49a4ae9f client-go/dynamic/fake: Stop ignoring options
Kubernetes-commit: c7ddceb8cb4fbe300c1552d5d8a234c1da338c59
2025-09-02 13:47:26 -04:00
Kubernetes Publisher
b0a827f5d5 Merge pull request #133823 from dims/update-to-spf13/pflag-to-prevent-CI-break
Update to spf13/pflag to prevent CI break

Kubernetes-commit: 80b8c7b40657efbf68c1687bc7c749d4fafd827d
2025-09-01 20:41:27 +00:00
Davanum Srinivas
1bd1139ac4 Update to spf13/pflag to prevent CI break
Kubernetes-commit: 6ddf6261d445564dd287b2e95019910cb9c4a662
2025-09-01 08:21:12 -04:00
Kubernetes Publisher
2a8d855d0d Merge pull request #133430 from liggitt/json-patch-v4-errors
bump gopkg.in/evanphx/json-patch.v4

Kubernetes-commit: d5065bdf192b2ebb723657b3432c66ce3ea15b23
2025-08-30 16:41:07 +00:00
Kubernetes Publisher
7b14b96bf8 Merge pull request #132665 from mrIncompetent/applyconfiguration-gen/extract-subresources
applyconfiguration-gen: add ExtractFrom with subresource support

Kubernetes-commit: 5a720a58beade6fb96e897d95ddd94aeadf21b6b
2025-08-29 09:57:10 -07:00
Henrik Schmidt
ffe150e4a6 ./hack/update-codegen.sh
Kubernetes-commit: 1ba96db35b5baca16adc6d8ee08361190a7d997f
2025-08-29 16:44:49 +02:00
Kubernetes Publisher
0a6101f00e Merge pull request #132407 from skitt/mockery-v3
Bump to mockery v3

Kubernetes-commit: d70f058f9fd0b764d214d58b76b1026d35763bfb
2025-08-29 16:41:25 +00:00
yshngg
dc29e94395 refactor(event): simplify conditional logic in event handling for both v1 and eventsv1 APIs
Signed-off-by: yshngg <yshngg@outlook.com>

Kubernetes-commit: 7685612b9c24c3129e0e17a6f6874b5902de02a1
2025-08-29 17:02:56 +08:00
Patrick Ohly
b65019457b client-go leader-election: structured, contextual logging
Kubernetes-commit: 63f304708a0fab5078739415f589eff9f2e9dfc7
2025-08-25 16:28:53 +02:00
Joe Betz
799b7635a9 Apply feedback
Kubernetes-commit: 7debab65049c1551b5ea5b7f8ad82518ae4cb1f0
2025-08-22 08:57:28 -04:00
Joe Betz
08bef91dc4 update gofmt
Kubernetes-commit: 2fc66ddaf254d37a9c655d23923786c9723972e6
2025-08-21 16:23:43 -04:00
Joe Betz
481bad6fea Add doc.go and ARCHITECTURE.md to client-go
Kubernetes-commit: accdd9e27e74706f63e06ff5cb0476098b377b1e
2025-08-20 12:39:29 -04:00
Jordan Liggitt
d98ecdc0fd bump gopkg.in/evanphx/json-patch.v4
Kubernetes-commit: 9f8d9432e2067bc8b0e0ea5362b00559846ca54b
2025-08-07 16:02:03 -04:00
Valerian Roche
fdc4054b9d Add unit tests for Data Consistency Detector
Kubernetes-commit: 76da8d6de027a4bf62601d45b8d72f8fa627ab5c
2025-07-28 13:53:34 -04:00
Valerian Roche
59300dbe2a [client-go #1415] Embed proper interface in TransformingStore to ensure DeltaFIFO and RealFIFO are implementing it
Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>

Kubernetes-commit: 88c20d46a4e5ca8db7519c81856a358c919ae262
2025-07-28 13:53:34 -04:00
Jefftree
a74cb720e1 Add jefftree to OWNERS
Kubernetes-commit: 7242ddd93702fc7b0c5a3f01304be901e5942155
2025-07-24 21:26:52 +00:00
Heba Elayoty
638e636503 Update MaxUnavailableStatefulSet feature gate to beta
Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

Kubernetes-commit: b656027b9363c4c6dbf4fa634a71d355abd99345
2025-07-23 10:52:55 -07:00
Filip Křepinský
400c0a2602 make update
Kubernetes-commit: 2bf467170e737faa33ba739ee05e6359768a807e
2025-07-20 23:22:21 +02:00
Stephen Kitt
ed8c3f42cd Bump to mockery v3
mockery has introduced breaking changes and switched to a v3 branch,
this migrates to that, mostly using the built-in migration tool. Mocks
are now generated in single files per package, except in packages
containing mocks for multiple interface packages (in
pkg/kubelet/container/testing).

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 81cec6df1d0b6393ff25195aa3be65e79d341197
2025-06-19 17:53:15 +02:00
Kubernetes Publisher
29207cde88 Merge pull request #132128 from skitt/cadvisor-0.53
Bump cadvisor to 0.53

Kubernetes-commit: aead71c1c2e1846f554d21a257ff577b65f8493a
2025-08-28 16:40:49 +00:00
xigang
00a491e0ce Add RealFIFOOptions struct to provide structured configuration for RealFIFO
Signed-off-by: xigang <wangxigang2014@gmail.com>

Kubernetes-commit: 26bbea8c07131080f763c4ccc1eda5daa66803a6
2025-06-12 08:19:21 +08:00
Leandro López (inkel)
b821346005 Concatenate string instead of using fmt.Sprintf
The call to `fmt.Sprintf` does virtually the same as concatenating the
strings, but incurs in minor overhead from having to call a function,
and performs an additional allocation.

I've made a small benchmark for this and when run against current
`master` and this branch, the results are significant for this
function:

    goos: darwin
    goarch: arm64
    pkg: k8s.io/client-go/transport
    cpu: Apple M1 Pro
                              │ bart.base.log │           bart.concat.log            │
                              │    sec/op     │    sec/op     vs base                │
    BearerAuthRoundTripper-10    361.3n ± 31%   295.5n ± 11%  -18.21% (p=0.000 n=20)

                              │ bart.base.log │          bart.concat.log          │
                              │     B/op      │    B/op     vs base               │
    BearerAuthRoundTripper-10      768.0 ± 0%   752.0 ± 0%  -2.08% (p=0.000 n=20)

                              │ bart.base.log │          bart.concat.log           │
                              │   allocs/op   │ allocs/op   vs base                │
    BearerAuthRoundTripper-10      6.000 ± 0%   5.000 ± 0%  -16.67% (p=0.000 n=20)

Considering this method is likely used in many installations, the
gains, while small, adds up to bigger savings

Kubernetes-commit: 92a0e422df2d0d36c25f0b5c829c571b93250600
2025-06-06 08:27:49 -03:00
Stephen Kitt
058b4972f4 Bump cadvisor to 0.53
This brings a few fixes, drops github.com/pkg/errors (as a direct
dependency), and bumps many transitive dependencies. The
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp bump to
v0.61.0 breaks "k8s.io/kubernetes/test/integration/apiserver: tracing"
consistently, so it's held back for now.

github.com/containerd/containerd/api pulls in gopkg.in/yaml.v3 so that
needs to be added to the exceptions in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 684473af6232a5d68a5585837837d1a96f009414
2025-06-05 17:17:56 +02:00
Kubernetes Publisher
9d1c3580ed Merge pull request #133572 from HadrienPatte/ctx
Update `sharedInformerFactoryInterface` context initialization example

Kubernetes-commit: 9700dcde33f745cad8d53a583d1705bf9b1c7df1
2025-08-28 07:51:43 +00:00
Kubernetes Publisher
17baf3d705 Merge pull request #133573 from DerekFrank/lease-metadata-fix
fix: Update unit test to catch actual nil Labels case and fix functionality to handle nil Labels

Kubernetes-commit: 7c7fd78793c8974f22fcc6d7d58f263d987b238e
2025-08-28 03:53:18 +00:00
Kubernetes Publisher
bccbbb3816 Merge pull request #133571 from BenTheElder/deprecated-missing-oh-no
fix many incorrect deprecation warnings in godoc, enable deprecatedComment linter

Kubernetes-commit: 22a567ac31df68929f4cfb6e87a18d2399e37efe
2025-08-28 03:53:17 +00:00
David Bimmler
6294eedf76 cache: do not allocate chan for nothing (#133500)
* cache: do not allocate chan for nothing

The explicit purpose of this channel is to never be closed and nothing
to be sent down on it. Hence, there's no need to allocate a channel - a
nil channel has exactly the desired behaviour.

Additionally, this is more relevant now that testing/synctest gets
unhappy when goroutines are blocked on reading on channels which are
created outside of the synctest bubble. Since this is a package var, that's
hard to avoid when using this package. Synctest is fine with nil
channels though.

Reported-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

* handlers: do not allocate chan for nothing

Nil chan has the desired semantics already, and this breaks
testing/synctest because the channel is allocated outside of the bubble.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

---------

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

Kubernetes-commit: 52b7d035f9655d0c6ebeaaafd60add99700bb468
2025-08-28 03:53:15 +00:00
Kubernetes Publisher
d07f455e65 Merge pull request #133367 from ash2k/decouple-term-from-client
Decouple `term` and `remotecommand` packages

Kubernetes-commit: e2af824293a02edcc0797ac53382797a502d5668
2025-08-28 03:53:11 +00:00
Kubernetes Publisher
c40e1110fa Merge pull request #132686 from qiujian16/typo-fix
Fix a typo in fake clientset generator

Kubernetes-commit: e48518837fd6a17255fd81443c6b26b7adf24ef8
2025-08-27 23:52:43 +00:00
Kubernetes Publisher
01d95ed558 Merge pull request #131301 from epini-dw/master
Fix kubectl writing current-context to the wrong kubeconfig file when using multiple kubeconfig files.

Kubernetes-commit: 1df4ac52719da02bbd625e77ac69b81663bbc4d8
2025-08-27 23:52:41 +00:00
DerekFrank
048fbed845 gofmt and review feedback
Kubernetes-commit: 2180b441dd748bcaf9c1c8a28d20f6565e14f189
2025-08-18 09:52:15 -07:00
Kubernetes Publisher
0341f077c9 Merge pull request #133570 from BenTheElder/pr131351
Clarify staging repository READMEs

Kubernetes-commit: 8082e9ab157b280c740a623ae9d73679b9ee95a4
2025-08-16 06:27:19 +00:00
Benjamin Elder
9c1e36eae8 clarify that staging repos are automatically published
Kubernetes-commit: e49f6116f9eec5d48f2c8913e598fef496644d01
2025-08-15 14:33:07 -07:00
DerekFrank
706156ceaf fix: Update unit test to catch actual nil Labels case and fix functionality to handle nil Labels
Kubernetes-commit: 8d4108bf9355b086e7f8996e84723ca389db887a
2025-08-15 14:28:18 -07:00
Benjamin Elder
2052dfa644 update-codegen
Kubernetes-commit: 668b3fe4afc17c8726e9520e1392a32eb09c70d9
2025-08-15 11:18:52 -07:00
Hadrien Patte
302eac9149 Update sharedInformerFactoryInterface context initialization example
Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>

Kubernetes-commit: ef1878c6013f44a4b5a8800033c73551ea77c91f
2025-08-15 20:15:36 +02:00
Benjamin Elder
5f4046518f update-codegen
Kubernetes-commit: 30f4fc9ca3852d8dcaa2a1c85a09b10ede3be96e
2025-08-15 10:42:51 -07:00
Benjamin Elder
7d3990fa47 add pointer to CONTRIBUTING.md for more details on contributing, clarify read-only
Kubernetes-commit: ada2ed8487708056ff11bd2413da1073558e6d7c
2025-08-15 10:13:18 -07:00
Benjamin Elder
6c323c2a61 link to what a staging repository is
Kubernetes-commit: 011d50019758a7405c6ff37f0fdbd44dacb607b5
2025-08-15 10:10:26 -07:00
Mikhail Mazurskiy
d21662ddfc Decouple term and remotecommand packages
This allows consumers of term to not pull in dependencies on
github.com/gorilla/websocket and github.com/moby/spdystream.

Kubernetes-commit: 640dabd58b04b72f646ed85947cb8b407b36dc08
2025-08-03 20:35:40 +10:00
Jian Qiu
12d87ef94c Fix a typo in fake clientset generator
Signed-off-by: Jian Qiu <jqiu@redhat.com>

Kubernetes-commit: ad47298caa65fd20386aeb453cf74964963c47c8
2025-07-02 23:50:04 +08:00
sAchin-680
aea42c1991 docs: clarify that this is a staging repository and not for direct contributions
Signed-off-by: sAchin-680 <mrmister680@gmail.com>

Kubernetes-commit: 7c43e6d2fdbf88f8d92559dac3cabb23da2a2957
2025-04-17 17:51:45 +05:30
Kubernetes Publisher
d99dd130a2 Merge pull request #132522 from sunya-ch/KEP-5075-PR
DRA: Implementation of Consumable Capacity (KEP-5075)

Kubernetes-commit: a59ad8113513b2cd927097354924eafe4187c140
2025-07-30 11:38:44 +00:00
Sunyanan Choochotkaew
81902fe0fc KEP-5075: generated codes from make update
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>

Kubernetes-commit: 59bba927178174041c5e72f60432e70c5db210bf
2025-07-30 09:26:52 +09:00
Ethan Pini
af0e2a11af kubectl: Fix current-context being written to wrong file
This is what happens when writing back a OIDC refresh token:

 - plugin/pkg/client/auth/oidc/oidc.go:282
   Calls `Persist` to save the new refresh token.

 - tools/clientcmd/config.go:372
   Calls `ModifyConfig` to save the config.

 - tools/clientcmd/config.go:167
   Calls `configAccess.GetLoadingPrecedence()` to get the files
   listed from the `KUBECONFIG` environment variable.

 - tools/clientcmd/loader.go:334
   If the `ConfigAccess` was a `ClientConfigLoadingRules`, it
   directly returns the `Precedence` slice from its `rules`
   field.

   THE PROBLEM:
     The slice can be modified by the caller, unintentionally
     changing the value of the `ClientConfigLoadingRules`'
     `Precedence` field.

 - tools/clientcmd/config.go:170
   Then proceeds to in-place sort the slice returned by the
   `ConfigAccess`. This is the same slice (by identity)
   as the `ClientConfigLoadingRules`' `Precedence` field,
   destroying its intended order.

 - tools/clientcmd/config.go:179
   Calls `configAccess.GetStartingConfig` to read the original
   config so it can be compared with the new config.

 - tools/clientcmd/loader.go:339
   Calls `NewNonInteractiveDeferredLoadingClientConfig` with
   itself as a parameter.

   CONSEQUENCE:
     At this point, its the `Precedence` has been
     unintentionally sorted. When it loads the
     config again, it gives precedence to whichever
     file comes first in ascending alphabetical order.

 - tools/clientcmd/config.go:192
   If the file returned by `GetStartingConfig` has a
   different `current-context` than the new config,
   it calls `writeCurrentContext` to update the first
   kubeconfig file in the `KUBECONFIG` environment
   variable.

 - tools/clientcmd/config.go:403
   Calls `configAccess.GetDefaultFilename` to find the
   destination kubeconfig file.

 - tools/clientcmd/loader.go:358
   Iterates through the kubeconfig files returned by
   `GetLoadingPreferences` to find the first file
   that exists.

   CONSEQUENCE:
     With the slice being sorted earlier, the files
     returned by this call of `GetLoadingPreferences`
     will be sorted alphabetically, rather than by
     their intended order.

Kubernetes-commit: ffa084f81129ea685b176a282921c4d54906c539
2025-04-14 15:19:04 -07:00
Patrick Ohly
d55310b9f9 client-go remotecommand: structured, contextual logging
The API for the package already had a context, so all that was missing was to
extract and use the logger from that.

Kubernetes-commit: 1620b2707623036f5133cf8045da89411d2c4345
2024-12-20 13:50:01 +01:00
Patrick Ohly
3db82856dc client-go features: ignore contextual logging
The client-go feature gates implementation logs information about feature
states at V(1). Changing that would imply changing the Enabled method, which is
very intrusive because there are many callers which are not expected to log and
thus don't have access to a contextual logger.

The code is not active in Kubernetes components, those use the clientAdapter to
make client-go use the normal feature gate implementation, which doesn't log
anything. Therefore the code doesn't get changed and only annotated so that
logcheck won't complain.

Kubernetes-commit: ee9d998d6e0c89bcf2b39fc011bfbc916060d451
2024-12-09 13:00:47 +01:00
Patrick Ohly
5da30e54b3 client-go features: ignore contextual logging
The client-go feature gates implementation logs information about feature
states at V(1). Changing that would imply changing the Enabled method, which is
very intrusive because there are many callers which are not expected to log and
thus don't have access to a contextual logger.

The code is not active in Kubernetes components, those use the clientAdapter to
make client-go use the normal feature gate implementation, which doesn't log
anything. Therefore the code doesn't get changed and only annotated so that
logcheck won't complain.

Kubernetes-commit: e47b186e6ba3cbc9c732409ef9037e883ea80da1
2024-12-09 13:00:47 +01:00
Patrick Ohly
09da9b25fa client-go auth: contextual logging
No API changes are needed. In one case, a context is passed in via the
http.Request. In others there is simply no need to change the calls.

Kubernetes-commit: 4f241c04af7a86970aeab0a3e0198df807a04b86
2024-12-09 12:56:03 +01:00
Patrick Ohly
ecaf85d034 client-go remotecommand: structured, contextual logging
The API for the package already had a context, so all that was missing was to
extract and use the logger from that.

Kubernetes-commit: 0690af4710a5b322163564d82b95b90417ae3644
2024-12-20 13:50:01 +01:00
Patrick Ohly
24500c1c50 client-go clientcmd: exclude from structured, contextual logging
The only log output is for error messages which should normally not occur. It's
also likely that users expect to see exactly those messages, so it's better to
not touch them.

Kubernetes-commit: 8701f481ff6e24257021f07afcec67df2aef27dc
2024-12-04 15:39:14 +01:00
Patrick Ohly
e01401eb86 client-go clientcmd: exclude from structured, contextual logging
The only log output is for error messages which should normally not occur. It's
also likely that users expect to see exactly those messages, so it's better to
not touch them.

Kubernetes-commit: 1ec1248a6555be7ca7a0827061cdd3ef162f6c45
2024-12-04 15:39:14 +01:00
Patrick Ohly
e3793792ba client-go portforward + apiserver proxy: structured, contextual logging
When debugging, it helps to keep output from different connections
separate. This can be done with contextual logging and using different loggers
for each connection.

Cancellation is handled separately for requests. Therefore the new APIs only
add support for passing a logger instance.

Kubernetes-commit: dfdf07bb531aa8a397f3c74e5eec851130325971
2024-12-04 15:21:11 +01:00
Patrick Ohly
8101e94f49 restmapper + discovery: add context-aware APIs
The main purpose is to replace context.TODO with a context provided by the
caller. A secondary purpose is to enable contextual logging.

Modifying the existing interfaces and APIs would have a big impact on the
ecosystem. This is a no-go. Instead, the following approach was taken:

- All interfaces get duplicated in a *WithContext variant where the methods
  also have a *WithContext suffix and the ctx parameter. All methods are
  treated this way except for obvious local get methods (like RESTClient)
  because it cannot be ruled out entirely that some implementation may
  need a context.

- Implementations of these interfaces implement both method variants
  which is possible because the method names are different.
  The old methods are implemented as thin wrappers around the updated
  code which is now the body of the new methods or shared helpers.
  In some cases there is additional overhead (type checks, potentially
  additional allocations) when using the old methods.

- To*WithContext helpers bridge from the old to the new interfaces. They
  try a type cast first. Because the in-tree implementations implement
  both, they can be used directly. For other implementations wrappers
  are used.

- All old APIs and interfaces are marked as deprecated. There is no
  intent to ever remove them, but consumers should be made aware
  that there are now better alternatives. Implementations also
  get marked this way even if nothing ever calls them directly
  because it shows which code, at least theoretically, could get
  removed.

- Existing unit tests do not get updated to the new APIs. This gives
  us unit test coverage of the old and new API because the old
  APIs call the new ones.

- In-tree consumers will be updated in follow-up PRs. This is likely
  to be a longer process. Because of the deprecation comment,
  `hack/golangci-lint.sh -n` can be used to find code which needs
  to be updated.

Kubernetes-commit: 025b844bcabe0212c4dd56395ee18481602d7c65
2024-12-06 17:38:06 +01:00
Patrick Ohly
d7581d0654 client-go watch: implement interface with pointer
I wasn't entirely sure whether this should return a value or a pointer to
satisfy the interface. Both works, so I benchmarked it elsewhere (REST
mapper). Mem allocs are the same (one alloc/call), but returning a value is 10%
slower when calling one method.

What I then benchmarked is whether pointer vs value receiver in the wrapper
makes a difference. Converting from value receiver (what I had before) to
pointer receiver reduced call overhead by 6%. That's because with a value
receiver, Go has to auto-generate a variant with pointer receiver and calls the
value receiver through that.

That can be seen in a debugger (call stack) and when setting breakpoints:

    (dlv) b restMapperWrapper.KindForWithContext
    Command failed: Location "restMapperWrapper.KindForWithContext" ambiguous: k8s.io/apimachinery/pkg/api/meta.restMapperWrapper.KindForWithContext, k8s.io/apimachinery/pkg/api/meta.(*restMapperWrapper).KindForWithContext…

Conventional wisdom is to define types with value receiver because those can be
called also on unmutable instances, making them more flexible.

But for types which will only ever be used via a pointer, I think pointer
receiver is better for the reasons above (small performance difference, easier
to debug).

Kubernetes-commit: b21dcbcaa1ccf4995bf486afc37dc0321c5bdf0b
2025-02-13 11:53:16 +01:00
1326 changed files with 46358 additions and 16844 deletions

162
ARCHITECTURE.md Normal file
View File

@@ -0,0 +1,162 @@
# `client-go` Architecture
This document explains the internal architecture of `client-go` for contributors. It describes the
major components, how they interact, and the key design decisions that shape the library.
## Client Configuration
There is an architectural separation between loading client configuration and using it. The
`rest.Config` object is the in-memory representation of this configuration. The
`tools/clientcmd` package is the standard factory for producing it. `clientcmd` handles the
complex logic of parsing `kubeconfig` files, merging contexts, and handling external
authentication providers (e.g., OIDC).
## REST Client
The `rest.Client` is the foundational HTTP client that underpins all other clients. It separates
the low-level concerns of HTTP transport, serialization, and error handling from higher-level,
Kubernetes-specific object logic.
The `rest.Config` object is used to build the underlying HTTP transport, which is typically a
chain of `http.RoundTripper` objects. Each element in the chain is responsible for a specific
task, such as adding an `Authorization` header. This is the mechanism by which all authentication
is injected into requests.
The client uses a builder pattern for requests (e.g., `.Verb()`, `.Resource()`), deferring
response processing until a method like `.Into(&pod)` is called. This separation is key to
supporting different client models from a common base.
### Endpoint Interactions
* **Content Negotiation:** The client uses HTTP `Accept` headers to negotiate the wire format
(JSON or Protobuf). A key performance optimization using this mechanism is the ability to
request metadata-only objects via the `as=PartialObjectMetadata;g=meta.k8s.io;v=v1` Accept custom parameter.
Also the `as=Table;g=meta.k8s.io;v=v1` Accept custom parameters may be used to request lists as tables.
* **Subresources:** The client can target standard subresources like `/status` or `/scale` for
object mutations, and it can also handle action-oriented subresources like `/logs` or
`/exec`, which often involve streaming data.
* **List Pagination:** For `LIST` requests, the client can specify a `limit`. The server will
return up to that many items and, if more exist, a `continue` token. The client is
responsible for passing this token in a subsequent request to retrieve the next page.
Higher-level tools like the `Reflector`'s `ListerWatcher` handle this logic automatically.
* **Streaming Watches:** A `WATCH` request returns a `watch.Interface` (from
`k8s.io/apimachinery/pkg/watch`), which provides a channel of structured `watch.Event`
objects (`ADDED`, `MODIFIED`, `DELETED`, `BOOKMARK`). This decouples the watch consumer from
the underlying streaming protocol.
### Errors, Warnings, and Rate Limiting
* **Structured Errors:** The client deserializes non-2xx responses into a structured
`errors.StatusError`, enabling programmatic error handling (e.g., `errors.IsNotFound(err)`).
* **Warnings:** It processes non-fatal `Warning` headers from the API server via a
`WarningHandler`.
* **Client-Side Rate Limiting:** The `QPS` and `Burst` settings in `rest.Config` are the
client's half of the contract with the server's API Priority and Fairness system.
* **Server-Side Throttling:** The client's default transport automatically handles HTTP `429`
responses by reading the `Retry-After` header, waiting, and retrying the request.
## Typed and Dynamic Clients
To handle the extensible nature of the Kubernetes API, `client-go` provides two primary client
models.
The **`kubernetes.Clientset`** provides compile-time, type-safe access to core, built-in APIs.
The **`dynamic.DynamicClient`** represents all objects as `unstructured.Unstructured`, allowing it
to interact with any API resource, including CRDs. It relies on two discovery mechanisms:
1. The **`discovery.DiscoveryClient`** determines *what* resources exist. The
**`CachedDiscoveryClient`** is an optimization that caches this data on disk to solve.
2. The **OpenAPI schema** (fetched from `/openapi/v3`) describes the *structure* of those
resources, providing the schema awareness needed by the dynamic client.
## Code Generation
A core architectural principle of `client-go` is the use of code generation to provide a
strongly-typed, compile-time-safe interface for specific API GroupVersions. This makes
controller code more robust and easier to maintain. The tools in `k8s.io/code-generator` produce
several key components:
* **Typed Clientsets:** The primary interface for interacting with a specific GroupVersion.
* **Typed Listers:** The read-only, cached accessors used by controllers.
* **Typed Informers:** The machinery for populating the cache for a specific type.
* **Apply Configurations:** The type-safe builders for Server-Side Apply.
A contributor modifying a built-in API type **must** run the code generation scripts to update all
of these dependent components. For the Kubernetes project, `hack/update-codegen.sh` runs code generation.
`sample-controller` shows how code generate can be configured to build custom controllers.
## Controller Infrastructure
The `tools/cache` package provides the core infrastructure for controllers, replacing a high-load,
request-based pattern with a low-load, event-driven, cached model.
The data flow is as follows:
```mermaid
graph TD
subgraph "Kubernetes API"
API_Server[API Server]
end
subgraph "client-go: Informer Mechanism"
Reflector("1. Reflector")
DeltaFIFO("2. DeltaFIFO")
Indexer["3. Indexer (Cache)"]
EventHandlers("4. Event Handlers")
end
subgraph "User Code"
WorkQueue["5. Work Queue"]
Controller("6. Controller")
end
API_Server -- LIST/WATCH --> Reflector
Reflector -- Puts changes into --> DeltaFIFO
DeltaFIFO -- Is popped by internal loop, which updates --> Indexer
Indexer -- Update triggers --> EventHandlers
EventHandlers -- Adds key to --> WorkQueue
WorkQueue -- Is processed by --> Controller
Controller -- Reads from cache via Lister --> Indexer
```
A **`Reflector`** performs a `LIST` to get a consistent snapshot of a resource, identified by a
`resourceVersion`. It then starts a `WATCH` from that `resourceVersion` to receive a continuous
stream of subsequent changes. The `Reflector`'s relist/rewatch loop is designed to solve the
**"too old" `resourceVersion` error** by re-listing. To make this recovery more efficient, the
`Reflector` consumes **watch bookmarks** from the server, which provide a more recent
`resourceVersion` to restart from.
The **`Lister`** is the primary, read-only, thread-safe interface for a controller's business
logic to access the `Indexer`'s cache.
## Controller Patterns
The controller infrastructure is architecturally decoupled from the controller's business logic to
ensure resiliency.
The **`util/workqueue`** creates a critical boundary between event detection (the informer's job)
and reconciliation (the controller's job). Informer event handlers only add an object's key to the
work queue. This allows the controller to retry failed operations with exponential backoff without
blocking the informer's watch stream.
For high availability, the **`tools/leaderelection`** package provides the standard architectural
solution to ensure single-writer semantics by having replicas compete to acquire a lock on a
shared `Lease` object.
## Server-Side Apply
`client-go` provides a distinct architectural pattern for object mutation that aligns with the
server's declarative model. This is a separate workflow from the traditional `get-modify-update`
model that allows multiple controllers to safely co-manage the same object. The
**`applyconfigurations`** package provides the generated, type-safe builder API used to
construct the declarative patch.
## Versioning and Compatibility
`client-go` has a strict versioning relationship with the main Kubernetes repository. A `client-go`
version `v0.X.Y` corresponds to the Kubernetes version `v1.X.Y`.
The Kubernetes API has strong backward compatibility guarantees: a client built with an older
version of `client-go` will work with a newer API server. However, the reverse is not guaranteed.
A contributor must not break compatibility with supported versions of the Kubernetes API server.

3
OWNERS
View File

@@ -9,6 +9,7 @@ approvers:
- sttts
- yliaog
- jpbetz
- enj
reviewers:
- aojea
- apelisse
@@ -21,6 +22,8 @@ reviewers:
- sttts
- yliaog
- jpbetz
- jefftree
- enj
labels:
- sig/api-machinery
emeritus_approvers:

View File

@@ -1,3 +1,8 @@
> ⚠️ **This is an automatically published [staged repository](https://git.k8s.io/kubernetes/staging#external-repository-staging-area) for Kubernetes**.
> Contributions, including issues and pull requests, should be made to the main Kubernetes repository: [https://github.com/kubernetes/kubernetes](https://github.com/kubernetes/kubernetes).
> This repository is read-only for importing, and not used for direct contributions.
> See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
# client-go
Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster.
@@ -75,14 +80,14 @@ We will backport bugfixes--but not new features--into older versions of
#### Compatibility matrix
| | Kubernetes 1.27 | Kubernetes 1.28 | Kubernetes 1.29 | Kubernetes 1.30 | Kubernetes 1.31 | Kubernetes 1.32 |
| | Kubernetes 1.29 | Kubernetes 1.30 | Kubernetes 1.31 | Kubernetes 1.32 | Kubernetes 1.33 | Kubernetes 1.34 |
| ----------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
| `kubernetes-1.27.0`/`v0.27.0` | ✓ | +- | +- | +- | +- | +- |
| `kubernetes-1.28.0`/`v0.28.0` | +- | ✓ | +- | +- | +- | +- |
| `kubernetes-1.29.0`/`v0.29.0` | +- | +- | ✓ | +- | +- | +- |
| `kubernetes-1.30.0`/`v0.30.0` | +- | +- | +- | ✓ | +- | +- |
| `kubernetes-1.31.0`/`v0.31.0` | +- | +- | +- | +- | ✓ | +- |
| `kubernetes-1.32.0`/`v0.32.0` | +- | +- | +- | +- | +- | ✓ |
| `kubernetes-1.29.0`/`v0.29.0` | ✓ | +- | +- | +- | +- | +- |
| `kubernetes-1.30.0`/`v0.30.0` | +- | ✓ | +- | +- | +- | +- |
| `kubernetes-1.31.0`/`v0.31.0` | +- | +- | ✓ | +- | +- | +- |
| `kubernetes-1.32.0`/`v0.32.0` | +- | +- | +- | ✓ | +- | +- |
| `kubernetes-1.33.0`/`v0.33.0` | +- | +- | +- | +- | ✓ | +- |
| `kubernetes-1.34.0`/`v0.34.0` | +- | +- | +- | +- | +- | ✓ |
| `HEAD` | +- | +- | +- | +- | +- | +- |
Key:
@@ -104,16 +109,16 @@ between client-go versions.
| Branch | Canonical source code location | Maintenance status |
| -------------- | ----------------------------------- | ------------------ |
| `release-1.23` | Kubernetes main repo, 1.23 branch | =- |
| `release-1.24` | Kubernetes main repo, 1.24 branch | =- |
| `release-1.25` | Kubernetes main repo, 1.25 branch | =- |
| `release-1.26` | Kubernetes main repo, 1.26 branch | =- |
| `release-1.27` | Kubernetes main repo, 1.27 branch | =- |
| `release-1.28` | Kubernetes main repo, 1.28 branch | =- |
| `release-1.29` | Kubernetes main repo, 1.29 branch | |
| `release-1.30` | Kubernetes main repo, 1.30 branch | |
| `release-1.31` | Kubernetes main repo, 1.31 branch | |
| `release-1.29` | Kubernetes main repo, 1.29 branch | =- |
| `release-1.30` | Kubernetes main repo, 1.30 branch | =- |
| `release-1.31` | Kubernetes main repo, 1.31 branch | = |
| `release-1.32` | Kubernetes main repo, 1.32 branch | ✓ |
| `release-1.33` | Kubernetes main repo, 1.33 branch | ✓ |
| `release-1.34` | Kubernetes main repo, 1.34 branch | ✓ |
| client-go HEAD | Kubernetes main repo, master branch | ✓ |
Key:

View File

@@ -0,0 +1,81 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// ApplyConfigurationApplyConfiguration represents a declarative configuration of the ApplyConfiguration type for use
// with apply.
//
// ApplyConfiguration defines the desired configuration values of an object.
type ApplyConfigurationApplyConfiguration struct {
// expression will be evaluated by CEL to create an apply configuration.
// ref: https://github.com/google/cel-spec
//
// Apply configurations are declared in CEL using object initialization. For example, this CEL expression
// returns an apply configuration to set a single field:
//
// Object{
// spec: Object.spec{
// serviceAccountName: "example"
// }
// }
//
// Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of
// values not included in the apply configuration.
//
// CEL expressions have access to the object types needed to create apply configurations:
//
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}
// ApplyConfigurationApplyConfiguration constructs a declarative configuration of the ApplyConfiguration type for use with
// apply.
func ApplyConfiguration() *ApplyConfigurationApplyConfiguration {
return &ApplyConfigurationApplyConfiguration{}
}
// WithExpression sets the Expression field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Expression field is set to the value of the last call.
func (b *ApplyConfigurationApplyConfiguration) WithExpression(value string) *ApplyConfigurationApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -20,8 +20,40 @@ package v1
// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use
// with apply.
//
// AuditAnnotation describes how to produce an audit annotation for an API request.
type AuditAnnotationApplyConfiguration struct {
Key *string `json:"key,omitempty"`
// key specifies the audit annotation key. The audit annotation keys of
// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
// name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
//
// The key is combined with the resource name of the
// ValidatingAdmissionPolicy to construct an audit annotation key:
// "{ValidatingAdmissionPolicy name}/{key}".
//
// If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
// and the same audit annotation key, the annotation key will be identical.
// In this case, the first annotation written with the key will be included
// in the audit event and all subsequent annotations with the same key
// will be discarded.
//
// Required.
Key *string `json:"key,omitempty"`
// valueExpression represents the expression which is evaluated by CEL to
// produce an audit annotation value. The expression must evaluate to either
// a string or null value. If the expression evaluates to a string, the
// audit annotation is included with the string value. If the expression
// evaluates to null or empty string the audit annotation will be omitted.
// The valueExpression may be no longer than 5kb in length.
// If the result of the valueExpression is more than 10kb in length, it
// will be truncated to 10kb.
//
// If multiple ValidatingAdmissionPolicyBinding resources match an
// API request, then the valueExpression will be evaluated for
// each binding. All unique values produced by the valueExpressions
// will be joined together in a comma-separated list.
//
// Required.
ValueExpression *string `json:"valueExpression,omitempty"`
}

View File

@@ -20,9 +20,17 @@ package v1
// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use
// with apply.
//
// ExpressionWarning is a warning information that targets a specific expression.
type ExpressionWarningApplyConfiguration struct {
// fieldRef is the path to the field that refers to the expression.
// For example, the reference to the expression of the first item of
// validations is "spec.validations[0].expression"
FieldRef *string `json:"fieldRef,omitempty"`
Warning *string `json:"warning,omitempty"`
// warning contains the content of type checking information in a human-readable form.
// Each line of the warning contains the type that the expression is checked
// against, followed by the type check error from the compiler.
Warning *string `json:"warning,omitempty"`
}
// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with

View File

@@ -0,0 +1,105 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// JSONPatchApplyConfiguration represents a declarative configuration of the JSONPatch type for use
// with apply.
//
// JSONPatch defines a JSON Patch.
type JSONPatchApplyConfiguration struct {
// expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/).
// ref: https://github.com/google/cel-spec
//
// expression must return an array of JSONPatch values.
//
// For example, this CEL expression returns a JSON patch to conditionally modify a value:
//
// [
// JSONPatch{op: "test", path: "/spec/example", value: "Red"},
// JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
// ]
//
// To define an object for the patch value, use Object types. For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/spec/selector",
// value: Object.spec.selector{matchLabels: {"environment": "test"}}
// }
// ]
//
// To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
// value: "test"
// },
// ]
//
// CEL expressions have access to the types needed to create JSON patches and objects:
//
// - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
// See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
// integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
// [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
// function may be used to escape path keys containing '/' and '~'.
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries)
// as well as:
//
// - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}
// JSONPatchApplyConfiguration constructs a declarative configuration of the JSONPatch type for use with
// apply.
func JSONPatch() *JSONPatchApplyConfiguration {
return &JSONPatchApplyConfiguration{}
}
// WithExpression sets the Expression field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Expression field is set to the value of the last call.
func (b *JSONPatchApplyConfiguration) WithExpression(value string) *JSONPatchApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -20,8 +20,32 @@ package v1
// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use
// with apply.
//
// MatchCondition represents a condition which must by fulfilled for a request to be sent to a webhook.
type MatchConditionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is an identifier for this match condition, used for strategic merging of MatchConditions,
// as well as providing an identifier for logging purposes. A good name should be descriptive of
// the associated expression.
// Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
// must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
// '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
// optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
//
// Required.
Name *string `json:"name,omitempty"`
// expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
// CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
//
// 'object' - The object from the incoming request. The value is null for DELETE requests.
// 'oldObject' - The existing object. The value is null for CREATE requests.
// 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
// 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -25,12 +25,88 @@ import (
// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use
// with apply.
//
// MatchResources decides whether to run the admission control policy on an object based
// on whether it meets the match criteria.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
type MatchResourcesApplyConfiguration struct {
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
// namespaceSelector decides whether to run the admission control policy on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the policy.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the policy on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the validation based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the cel validation, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// resourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
// The policy cares about an operation if it matches _any_ Rule.
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
// excludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
// matchPolicy defines how the "MatchResources" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
//
// Defaults to "Equivalent"
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
}
// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with

View File

@@ -0,0 +1,274 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
internal "k8s.io/client-go/applyconfigurations/internal"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// MutatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicy type for use
// with apply.
//
// MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
type MutatingAdmissionPolicyApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicy.
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicy constructs a declarative configuration of the MutatingAdmissionPolicy type for use with
// apply.
func MutatingAdmissionPolicy(name string) *MutatingAdmissionPolicyApplyConfiguration {
b := &MutatingAdmissionPolicyApplyConfiguration{}
b.WithName(name)
b.WithKind("MutatingAdmissionPolicy")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// ExtractMutatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy *admissionregistrationv1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
b := &MutatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
return nil, err
}
b.WithName(mutatingAdmissionPolicy.Name)
b.WithKind("MutatingAdmissionPolicy")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
// MutatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy, fieldManager, "")
}
func (b MutatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithKind(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithName(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *MutatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *MutatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *MutatingAdmissionPolicyApplyConfiguration) WithSpec(value *MutatingAdmissionPolicySpecApplyConfiguration) *MutatingAdmissionPolicyApplyConfiguration {
b.Spec = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *MutatingAdmissionPolicyApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *MutatingAdmissionPolicyApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *MutatingAdmissionPolicyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *MutatingAdmissionPolicyApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,284 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
internal "k8s.io/client-go/applyconfigurations/internal"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// MutatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBinding type for use
// with apply.
//
// MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources.
// MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators
// configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
// Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
//
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type MutatingAdmissionPolicyBindingApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicyBinding.
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicyBinding constructs a declarative configuration of the MutatingAdmissionPolicyBinding type for use with
// apply.
func MutatingAdmissionPolicyBinding(name string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
b.WithName(name)
b.WithKind("MutatingAdmissionPolicyBinding")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// ExtractMutatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding *admissionregistrationv1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
return nil, err
}
b.WithName(mutatingAdmissionPolicyBinding.Name)
b.WithKind("MutatingAdmissionPolicyBinding")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
// MutatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding, fieldManager, "")
}
func (b MutatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *MutatingAdmissionPolicyBindingSpecApplyConfiguration) *MutatingAdmissionPolicyBindingApplyConfiguration {
b.Spec = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,75 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// MutatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// MutatingAdmissionPolicyBindingSpec defines the specification of the MutatingAdmissionPolicyBinding.
type MutatingAdmissionPolicyBindingSpecApplyConfiguration struct {
// policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources limits what resources match this binding and may be mutated by it.
// Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and
// matchConditions before the resource may be mutated.
// When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints
// and matchConditions must match for the resource to be mutated.
// Additionally, matchResources.resourceRules are optional and do not constraint matching when unset.
// Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
}
// MutatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use with
// apply.
func MutatingAdmissionPolicyBindingSpec() *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
return &MutatingAdmissionPolicyBindingSpecApplyConfiguration{}
}
// WithPolicyName sets the PolicyName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PolicyName field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
b.PolicyName = &value
return b
}
// WithParamRef sets the ParamRef field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ParamRef field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
b.ParamRef = value
return b
}
// WithMatchResources sets the MatchResources field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MatchResources field is set to the value of the last call.
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
b.MatchResources = value
return b
}

View File

@@ -0,0 +1,172 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
)
// MutatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicySpec type for use
// with apply.
//
// MutatingAdmissionPolicySpec defines the desired behavior of the admission policy.
type MutatingAdmissionPolicySpecApplyConfiguration struct {
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except matchConditions because matchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// mutations contain operations to perform on matching objects.
// mutations may not be empty; a minimum of one mutation is required.
// mutations are evaluated in order, and are reinvoked according to
// the reinvocationPolicy.
// The mutations of a policy are invoked for each binding of this policy
// and reinvocation of mutations occurs on a per binding basis.
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if paramKind refers to a non-existent Kind.
// A binding is invalid if paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the matchConstraints.
// An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding
// as part of a single admission evaluation.
// Allowed values are "Never" and "IfNeeded".
//
// Never: These mutations will not be called more than once per binding in a single admission evaluation.
//
// IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of
// order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only
// reinvoked when mutations change the object after this mutation is invoked.
// Required.
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
}
// MutatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicySpec type for use with
// apply.
func MutatingAdmissionPolicySpec() *MutatingAdmissionPolicySpecApplyConfiguration {
return &MutatingAdmissionPolicySpecApplyConfiguration{}
}
// WithParamKind sets the ParamKind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ParamKind field is set to the value of the last call.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
b.ParamKind = value
return b
}
// WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MatchConstraints field is set to the value of the last call.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
b.MatchConstraints = value
return b
}
// WithVariables adds the given value to the Variables field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Variables field.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithVariables")
}
b.Variables = append(b.Variables, *values[i])
}
return b
}
// WithMutations adds the given value to the Mutations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Mutations field.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMutations(values ...*MutationApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMutations")
}
b.Mutations = append(b.Mutations, *values[i])
}
return b
}
// WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the FailurePolicy field is set to the value of the last call.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the MatchConditions field.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
return b
}
// WithReinvocationPolicy sets the ReinvocationPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ReinvocationPolicy field is set to the value of the last call.
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1.ReinvocationPolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
b.ReinvocationPolicy = &value
return b
}

View File

@@ -25,19 +25,148 @@ import (
// MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use
// with apply.
//
// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
type MutatingWebhookApplyConfiguration struct {
Name *string `json:"name,omitempty"`
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// name is the name of the admission webhook.
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
// of the organization.
// Required.
Name *string `json:"name,omitempty"`
// clientConfig defines how to communicate with the hook.
// Required
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
// rules describes what operations on what resources/subresources the webhook cares about.
// The webhook cares about an operation if it matches _any_ Rule.
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
// from putting the cluster in a state which cannot be recovered from without completely
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
// failurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchPolicy defines how the "rules" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
//
// Defaults to "Equivalent"
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the webhook on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the webhook.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the webhook on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the webhook, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// sideEffects states whether this webhook has side effects.
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
// sideEffects == Unknown or Some.
SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"`
// timeoutSeconds specifies the timeout for this webhook. After the timeout passes,
// the webhook call will be ignored or the API call will fail based on the
// failure policy.
// The timeout value must be between 1 and 30 seconds.
// Default to 10 seconds.
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// admissionReviewVersions is an ordered list of preferred `AdmissionReview`
// versions the Webhook expects. API server will try to use first version in
// the list which it supports. If none of the versions specified in this list
// supported by API server, validation will fail for this object.
// If a persisted webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail
// and be subject to the failure policy.
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
// Allowed values are "Never" and "IfNeeded".
//
// Never: the webhook will not be called more than once in a single admission evaluation.
//
// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
// if the object being admitted is modified by other admission plugins after the initial webhook call.
// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
// Note:
// * the number of additional invocations is not guaranteed to be exactly one.
// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
// * webhooks that use this option may be reordered to minimize the number of additional invocations.
// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
//
// Defaults to "Never".
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be sent to this
// webhook. Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
}
// MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with

View File

@@ -29,10 +29,14 @@ import (
// MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use
// with apply.
//
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
type MutatingWebhookConfigurationApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
// webhooks is a list of webhooks and the affected resources and operations.
Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
}
// MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with
@@ -45,29 +49,14 @@ func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationAppl
return b
}
// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a
// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingWebhookConfigurationFrom extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingWebhookConfigurationFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "")
}
// ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status")
}
func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
func ExtractMutatingWebhookConfigurationFrom(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
b := &MutatingWebhookConfigurationApplyConfiguration{}
err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingWebhookConfiguration"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +68,21 @@ func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admission
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a
// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return ExtractMutatingWebhookConfigurationFrom(mutatingWebhookConfiguration, fieldManager, "")
}
func (b MutatingWebhookConfigurationApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -0,0 +1,72 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
)
// MutationApplyConfiguration represents a declarative configuration of the Mutation type for use
// with apply.
//
// Mutation specifies the CEL expression which is used to apply the Mutation.
type MutationApplyConfiguration struct {
// patchType indicates the patch strategy used.
// Allowed values are "ApplyConfiguration" and "JSONPatch".
// Required.
PatchType *admissionregistrationv1.PatchType `json:"patchType,omitempty"`
// applyConfiguration defines the desired configuration values of an object.
// The configuration is applied to the admission object using
// [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff).
// A CEL expression is used to create apply configuration.
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
// jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object.
// A CEL expression is used to create the JSON patch.
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
}
// MutationApplyConfiguration constructs a declarative configuration of the Mutation type for use with
// apply.
func Mutation() *MutationApplyConfiguration {
return &MutationApplyConfiguration{}
}
// WithPatchType sets the PatchType field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PatchType field is set to the value of the last call.
func (b *MutationApplyConfiguration) WithPatchType(value admissionregistrationv1.PatchType) *MutationApplyConfiguration {
b.PatchType = &value
return b
}
// WithApplyConfiguration sets the ApplyConfiguration field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ApplyConfiguration field is set to the value of the last call.
func (b *MutationApplyConfiguration) WithApplyConfiguration(value *ApplyConfigurationApplyConfiguration) *MutationApplyConfiguration {
b.ApplyConfiguration = value
return b
}
// WithJSONPatch sets the JSONPatch field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the JSONPatch field is set to the value of the last call.
func (b *MutationApplyConfiguration) WithJSONPatch(value *JSONPatchApplyConfiguration) *MutationApplyConfiguration {
b.JSONPatch = value
return b
}

View File

@@ -24,9 +24,13 @@ import (
// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use
// with apply.
//
// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
type NamedRuleWithOperationsApplyConfiguration struct {
ResourceNames []string `json:"resourceNames,omitempty"`
RuleWithOperationsApplyConfiguration `json:",inline"`
// resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
ResourceNames []string `json:"resourceNames,omitempty"`
// RuleWithOperations is a tuple of Operations and Resources.
RuleWithOperationsApplyConfiguration `json:""`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with

View File

@@ -20,9 +20,16 @@ package v1
// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use
// with apply.
//
// ParamKind is a tuple of Group Kind and Version.
type ParamKindApplyConfiguration struct {
// apiVersion is the API group version the resources belong to.
// In format of "group/version".
// Required.
APIVersion *string `json:"apiVersion,omitempty"`
Kind *string `json:"kind,omitempty"`
// kind is the API kind the resources belong to.
// Required.
Kind *string `json:"kind,omitempty"`
}
// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with

View File

@@ -25,10 +25,53 @@ import (
// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use
// with apply.
//
// ParamRef describes how to locate the params to be used as input to
// expressions of rules applied by a policy binding.
type ParamRefApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// name is the name of the resource being referenced.
//
// One of `name` or `selector` must be set, but `name` and `selector` are
// mutually exclusive properties. If one is set, the other must be unset.
//
// A single parameter used for all admission requests can be configured
// by setting the `name` field, leaving `selector` blank, and setting namespace
// if `paramKind` is namespace-scoped.
Name *string `json:"name,omitempty"`
// namespace is the namespace of the referenced resource. Allows limiting
// the search for params to a specific namespace. Applies to both `name` and
// `selector` fields.
//
// A per-namespace parameter may be used by specifying a namespace-scoped
// `paramKind` in the policy and leaving this field empty.
//
// - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
// field results in a configuration error.
//
// - If `paramKind` is namespace-scoped, the namespace of the object being
// evaluated for admission will be used when this field is left unset. Take
// care that if this is left empty the binding must not match any cluster-scoped
// resources, which will result in an error.
Namespace *string `json:"namespace,omitempty"`
// selector can be used to match multiple param objects based on their labels.
// Supply selector: {} to match all resources of the ParamKind.
//
// If multiple params are found, they are all evaluated with the policy expressions
// and the results are ANDed together.
//
// One of `name` or `selector` must be set, but `name` and `selector` are
// mutually exclusive properties. If one is set, the other must be unset.
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// parameterNotFoundAction controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
// matched by the binding. If the value is set to `Allow`, then no
// matched parameters will be treated as successful validation by the binding.
// If set to `Deny`, then no matched parameters will be subject to the
// `failurePolicy` of the policy.
//
// Allowed values are `Allow` or `Deny`
//
// Required
ParameterNotFoundAction *admissionregistrationv1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"`
}

View File

@@ -24,11 +24,43 @@ import (
// RuleApplyConfiguration represents a declarative configuration of the Rule type for use
// with apply.
//
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
// to make sure that all the tuple expansions are valid.
type RuleApplyConfiguration struct {
APIGroups []string `json:"apiGroups,omitempty"`
APIVersions []string `json:"apiVersions,omitempty"`
Resources []string `json:"resources,omitempty"`
Scope *admissionregistrationv1.ScopeType `json:"scope,omitempty"`
// apiGroups is the API groups the resources belong to. '*' is all groups.
// If '*' is present, the length of the slice must be one.
// Required.
APIGroups []string `json:"apiGroups,omitempty"`
// apiVersions is the API versions the resources belong to. '*' is all versions.
// If '*' is present, the length of the slice must be one.
// Required.
APIVersions []string `json:"apiVersions,omitempty"`
// resources is a list of resources this rule applies to.
//
// For example:
// 'pods' means pods.
// 'pods/log' means the log subresource of pods.
// '*' means all resources, but not subresources.
// 'pods/*' means all subresources of pods.
// '*/scale' means all scale subresources.
// '*/*' means all resources and their subresources.
//
// If wildcard is present, the validation rule will ensure resources do not
// overlap with each other.
//
// Depending on the enclosing object, subresources might not be allowed.
// Required.
Resources []string `json:"resources,omitempty"`
// scope specifies the scope of this rule.
// Valid values are "Cluster", "Namespaced", and "*"
// "Cluster" means that only cluster-scoped resources will match this rule.
// Namespace API objects are cluster-scoped.
// "Namespaced" means that only namespaced resources will match this rule.
// "*" means that there are no scope restrictions.
// Subresources match the scope of their parent resource.
// Default is "*".
Scope *admissionregistrationv1.ScopeType `json:"scope,omitempty"`
}
// RuleApplyConfiguration constructs a declarative configuration of the Rule type for use with

View File

@@ -24,9 +24,18 @@ import (
// RuleWithOperationsApplyConfiguration represents a declarative configuration of the RuleWithOperations type for use
// with apply.
//
// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
// sure that all the tuple expansions are valid.
type RuleWithOperationsApplyConfiguration struct {
Operations []admissionregistrationv1.OperationType `json:"operations,omitempty"`
RuleApplyConfiguration `json:",inline"`
// operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or *
// for all of those operations and any future admission operations that are added.
// If '*' is present, the length of the slice must be one.
// Required.
Operations []admissionregistrationv1.OperationType `json:"operations,omitempty"`
// Rule is embedded, it describes other criteria of the rule, like
// APIGroups, APIVersions, Resources, etc.
RuleApplyConfiguration `json:""`
}
// RuleWithOperationsApplyConfiguration constructs a declarative configuration of the RuleWithOperations type for use with

View File

@@ -20,11 +20,22 @@ package v1
// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use
// with apply.
//
// ServiceReference holds a reference to Service.legacy.k8s.io
type ServiceReferenceApplyConfiguration struct {
// namespace is the namespace of the service.
// Required
Namespace *string `json:"namespace,omitempty"`
Name *string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
Port *int32 `json:"port,omitempty"`
// name is the name of the service.
// Required
Name *string `json:"name,omitempty"`
// path is an optional URL path which will be sent in any request to
// this service.
Path *string `json:"path,omitempty"`
// port is the port on the service that hosts the webhook.
// Default to 443 for backward compatibility.
// `port` should be a valid port number (1-65535, inclusive).
Port *int32 `json:"port,omitempty"`
}
// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with

View File

@@ -20,7 +20,11 @@ package v1
// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use
// with apply.
//
// TypeChecking contains results of type checking the expressions in the
// ValidatingAdmissionPolicy
type TypeCheckingApplyConfiguration struct {
// expressionWarnings contains the type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}

View File

@@ -29,11 +29,19 @@ import (
// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use
// with apply.
//
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
type ValidatingAdmissionPolicyApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// status represents the current status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy
// behaves in the expected way.
// Populated by the system.
// Read-only.
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
}
// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with
@@ -46,29 +54,14 @@ func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfi
return b
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status")
}
func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
@@ -80,6 +73,27 @@ func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregist
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the status subresource.
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "status")
}
func (b ValidatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,10 +29,24 @@ import (
// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use
// with apply.
//
// ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources.
// ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
//
// The CEL expressions of a policy must have a computed CEL cost below the maximum
// CEL budget. Each evaluation of the policy is given an independent CEL cost budget.
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type ValidatingAdmissionPolicyBindingApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
@@ -45,29 +59,14 @@ func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBin
return b
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status")
}
func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +78,21 @@ func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *a
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding, fieldManager, "")
}
func (b ValidatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,10 +24,63 @@ import (
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// policyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources declares what resources match this binding and will be validated by it.
// Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this.
// If this is unset, all resources matched by the policy are validated by this binding
// When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated.
// Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced.
// If a validation evaluates to false it is always enforced according to these actions.
//
// Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according
// to these actions only if the FailurePolicy is set to Fail, otherwise the failures are
// ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.
//
// validationActions is declared as a set of action values. Order does
// not matter. validationActions may not contain duplicates of the same action.
//
// The supported actions values are:
//
// "Deny" specifies that a validation failure results in a denied request.
//
// "Warn" specifies that a validation failure is reported to the request client
// in HTTP Warning headers, with a warning code of 299. Warnings can be sent
// both for allowed or denied admission responses.
//
// "Audit" specifies that a validation failure is included in the published
// audit event for the request. The audit event will contain a
// `validation.policy.admission.k8s.io/validation_failure` audit annotation
// with a value containing the details of the validation failures, formatted as
// a JSON list of objects, each with the following fields:
// - message: The validation failure message string
// - policy: The resource name of the ValidatingAdmissionPolicy
// - binding: The resource name of the ValidatingAdmissionPolicyBinding
// - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy
// - validationActions: The enforcement actions enacted for the validation failure
// Example audit annotation:
// `"validation.policy.admission.k8s.io/validation_failure": "[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]"`
//
// Clients should expect to handle additional values by ignoring
// any values not recognized.
//
// "Deny" and "Warn" may not be used together since this combination
// needlessly duplicates the validation failure both in the
// API response body and the HTTP warning headers.
//
// Required.
ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions,omitempty"`
}

View File

@@ -24,14 +24,66 @@ import (
// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use
// with apply.
//
// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
type ValidatingAdmissionPolicySpecApplyConfiguration struct {
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The AdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// validations contain CEL expressions which is used to apply the validation.
// Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is
// required.
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if spec.paramKind refers to a non-existent Kind.
// A binding is invalid if spec.paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions
// define how failures are enforced.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
// auditAnnotations contains CEL expressions which are used to produce audit
// annotations for the audit event of the API request.
// validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is
// required.
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except MatchConditions because MatchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, Variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
}
// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with

View File

@@ -24,10 +24,16 @@ import (
// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use
// with apply.
//
// ValidatingAdmissionPolicyStatus represents the status of an admission validation policy.
type ValidatingAdmissionPolicyStatusApplyConfiguration struct {
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
// observedGeneration is the generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// typeChecking contains the results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// conditions represent the latest available observations of a policy's current state.
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with

View File

@@ -25,18 +25,132 @@ import (
// ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use
// with apply.
//
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
type ValidatingWebhookApplyConfiguration struct {
Name *string `json:"name,omitempty"`
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// name is the name of the admission webhook.
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
// of the organization.
// Required.
Name *string `json:"name,omitempty"`
// clientConfig defines how to communicate with the hook.
// Required
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
// rules describes what operations on what resources/subresources the webhook cares about.
// The webhook cares about an operation if it matches _any_ Rule.
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
// from putting the cluster in a state which cannot be recovered from without completely
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
// failurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchPolicy defines how the "rules" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
//
// Defaults to "Equivalent"
MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the webhook on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the webhook.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the webhook on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the webhook, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// sideEffects states whether this webhook has side effects.
// Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
// sideEffects == Unknown or Some.
SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects,omitempty"`
// timeoutSeconds specifies the timeout for this webhook. After the timeout passes,
// the webhook call will be ignored or the API call will fail based on the
// failure policy.
// The timeout value must be between 1 and 30 seconds.
// Default to 10 seconds.
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// admissionReviewVersions is an ordered list of preferred `AdmissionReview`
// versions the Webhook expects. API server will try to use first version in
// the list which it supports. If none of the versions specified in this list
// supported by API server, validation will fail for this object.
// If a persisted webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail
// and be subject to the failure policy.
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be sent to this
// webhook. Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
}
// ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with

View File

@@ -29,10 +29,14 @@ import (
// ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use
// with apply.
//
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
type ValidatingWebhookConfigurationApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
// webhooks is a list of webhooks and the affected resources and operations.
Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
}
// ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with
@@ -45,29 +49,14 @@ func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfiguration
return b
}
// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a
// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingWebhookConfigurationFrom extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingWebhookConfigurationFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "")
}
// ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status")
}
func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
func ExtractValidatingWebhookConfigurationFrom(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
b := &ValidatingWebhookConfigurationApplyConfiguration{}
err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingWebhookConfiguration"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +68,21 @@ func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admis
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b, nil
}
// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a
// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return ExtractValidatingWebhookConfigurationFrom(validatingWebhookConfiguration, fieldManager, "")
}
func (b ValidatingWebhookConfigurationApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,11 +24,77 @@ import (
// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use
// with apply.
//
// Validation specifies the CEL expression which is used to apply the validation.
type ValidationApplyConfiguration struct {
Expression *string `json:"expression,omitempty"`
Message *string `json:"message,omitempty"`
Reason *metav1.StatusReason `json:"reason,omitempty"`
MessageExpression *string `json:"messageExpression,omitempty"`
// expression represents the expression which will be evaluated by CEL.
// ref: https://github.com/google/cel-spec
// CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Accessible property names are escaped according to the following rules when accessed in the expression:
// - '__' escapes to '__underscores__'
// - '.' escapes to '__dot__'
// - '-' escapes to '__dash__'
// - '/' escapes to '__slash__'
// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
// "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
// "import", "let", "loop", "package", "namespace", "return".
// Examples:
// - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
// - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
// - Expression accessing a property named "redact__d": {"Expression": "object.redact__underscores__d > 0"}
//
// Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
// Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
// - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and
// non-intersecting elements in `Y` are appended, retaining their partial order.
// - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values
// are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
// non-intersecting keys are appended, retaining their partial order.
// Required.
Expression *string `json:"expression,omitempty"`
// message represents the message displayed when validation fails. The message is required if the Expression contains
// line breaks. The message must not contain line breaks.
// If unset, the message is "failed rule: {Rule}".
// e.g. "must be a URL with the host matching spec.host"
// If the Expression contains line breaks. Message is required.
// The message must not contain line breaks.
// If unset, the message is "failed Expression: {Expression}".
Message *string `json:"message,omitempty"`
// reason represents a machine-readable description of why this validation failed.
// If this is the first validation in the list to fail, this reason, as well as the
// corresponding HTTP response code, are used in the
// HTTP response to the client.
// The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid", "RequestEntityTooLarge".
// If not set, StatusReasonInvalid is used in the response to the client.
Reason *metav1.StatusReason `json:"reason,omitempty"`
// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
// Since messageExpression is used as a failure message, it must evaluate to a string.
// If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails.
// If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced
// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and
// the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged.
// messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'.
// Example:
// "object.x must be less than max ("+string(params.max)+")"
MessageExpression *string `json:"messageExpression,omitempty"`
}
// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with

View File

@@ -20,8 +20,15 @@ package v1
// VariableApplyConfiguration represents a declarative configuration of the Variable type for use
// with apply.
//
// Variable is the definition of a variable that is used for composition. A variable is defined as a named expression.
type VariableApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
// The variable can be accessed in other expressions through `variables`
// For example, if name is "foo", the variable will be available as `variables.foo`
Name *string `json:"name,omitempty"`
// expression is the expression that will be evaluated as the value of the variable.
// The CEL expression has access to the same identifiers as the CEL expressions in Validation.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,10 +20,44 @@ package v1
// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use
// with apply.
//
// WebhookClientConfig contains the information to make a TLS
// connection with the webhook
type WebhookClientConfigApplyConfiguration struct {
URL *string `json:"url,omitempty"`
Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"`
CABundle []byte `json:"caBundle,omitempty"`
// url gives the location of the webhook, in standard URL form
// (`scheme://host:port/path`). Exactly one of `url` or `service`
// must be specified.
//
// The `host` should not refer to a service running in the cluster; use
// the `service` field instead. The host might be resolved via external
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
// in-cluster DNS as that would be a layering violation). `host` may
// also be an IP address.
//
// Please note that using `localhost` or `127.0.0.1` as a `host` is
// risky unless you take great care to run this webhook on all hosts
// which run an apiserver which might need to make calls to this
// webhook. Such installs are likely to be non-portable, i.e., not easy
// to turn up in a new cluster.
//
// The scheme must be "https"; the URL must begin with "https://".
//
// A path is optional, and if present may be any string permissible in
// a URL. You may use the path to pass an arbitrary string to the
// webhook, for example, a cluster identifier.
//
// Attempting to use a user or basic auth e.g. "user:password@" is not
// allowed. Fragments ("#...") and query parameters ("?...") are not
// allowed, either.
URL *string `json:"url,omitempty"`
// service is a reference to the service for this webhook. Either
// `service` or `url` must be specified.
//
// If the webhook is running within the cluster, then you should use `service`.
Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"`
// caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
// If unspecified, system trust roots on the apiserver are used.
CABundle []byte `json:"caBundle,omitempty"`
}
// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with

View File

@@ -20,7 +20,49 @@ package v1alpha1
// ApplyConfigurationApplyConfiguration represents a declarative configuration of the ApplyConfiguration type for use
// with apply.
//
// ApplyConfiguration defines the desired configuration values of an object.
type ApplyConfigurationApplyConfiguration struct {
// expression will be evaluated by CEL to create an apply configuration.
// ref: https://github.com/google/cel-spec
//
// Apply configurations are declared in CEL using object initialization. For example, this CEL expression
// returns an apply configuration to set a single field:
//
// Object{
// spec: Object.spec{
// serviceAccountName: "example"
// }
// }
//
// Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of
// values not included in the apply configuration.
//
// CEL expressions have access to the object types needed to create apply configurations:
//
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,8 +20,40 @@ package v1alpha1
// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use
// with apply.
//
// AuditAnnotation describes how to produce an audit annotation for an API request.
type AuditAnnotationApplyConfiguration struct {
Key *string `json:"key,omitempty"`
// key specifies the audit annotation key. The audit annotation keys of
// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
// name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
//
// The key is combined with the resource name of the
// ValidatingAdmissionPolicy to construct an audit annotation key:
// "{ValidatingAdmissionPolicy name}/{key}".
//
// If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
// and the same audit annotation key, the annotation key will be identical.
// In this case, the first annotation written with the key will be included
// in the audit event and all subsequent annotations with the same key
// will be discarded.
//
// Required.
Key *string `json:"key,omitempty"`
// valueExpression represents the expression which is evaluated by CEL to
// produce an audit annotation value. The expression must evaluate to either
// a string or null value. If the expression evaluates to a string, the
// audit annotation is included with the string value. If the expression
// evaluates to null or empty string the audit annotation will be omitted.
// The valueExpression may be no longer than 5kb in length.
// If the result of the valueExpression is more than 10kb in length, it
// will be truncated to 10kb.
//
// If multiple ValidatingAdmissionPolicyBinding resources match an
// API request, then the valueExpression will be evaluated for
// each binding. All unique values produced by the valueExpressions
// will be joined together in a comma-separated list.
//
// Required.
ValueExpression *string `json:"valueExpression,omitempty"`
}

View File

@@ -20,9 +20,17 @@ package v1alpha1
// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use
// with apply.
//
// ExpressionWarning is a warning information that targets a specific expression.
type ExpressionWarningApplyConfiguration struct {
// fieldRef is the path to the field that refers to the expression.
// For example, the reference to the expression of the first item of
// validations is "spec.validations[0].expression"
FieldRef *string `json:"fieldRef,omitempty"`
Warning *string `json:"warning,omitempty"`
// warning contains the content of type checking information in a human-readable form.
// Each line of the warning contains the type that the expression is checked
// against, followed by the type check error from the compiler.
Warning *string `json:"warning,omitempty"`
}
// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with

View File

@@ -20,7 +20,73 @@ package v1alpha1
// JSONPatchApplyConfiguration represents a declarative configuration of the JSONPatch type for use
// with apply.
//
// JSONPatch defines a JSON Patch.
type JSONPatchApplyConfiguration struct {
// expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/).
// ref: https://github.com/google/cel-spec
//
// expression must return an array of JSONPatch values.
//
// For example, this CEL expression returns a JSON patch to conditionally modify a value:
//
// [
// JSONPatch{op: "test", path: "/spec/example", value: "Red"},
// JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
// ]
//
// To define an object for the patch value, use Object types. For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/spec/selector",
// value: Object.spec.selector{matchLabels: {"environment": "test"}}
// }
// ]
//
// To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
// value: "test"
// },
// ]
//
// CEL expressions have access to the types needed to create JSON patches and objects:
//
// - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
// See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
// integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
// [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
// function may be used to escape path keys containing '/' and '~'.
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries)
// as well as:
//
// - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -21,7 +21,29 @@ package v1alpha1
// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use
// with apply.
type MatchConditionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is an identifier for this match condition, used for strategic merging of MatchConditions,
// as well as providing an identifier for logging purposes. A good name should be descriptive of
// the associated expression.
// Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
// must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
// '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
// optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
//
// Required.
Name *string `json:"name,omitempty"`
// expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
// CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
//
// 'object' - The object from the incoming request. The value is null for DELETE requests.
// 'oldObject' - The existing object. The value is null for CREATE requests.
// 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
// 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -25,12 +25,89 @@ import (
// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use
// with apply.
//
// MatchResources decides whether to run the admission control policy on an object based
// on whether it meets the match criteria.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
type MatchResourcesApplyConfiguration struct {
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
MatchPolicy *admissionregistrationv1alpha1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the admission control policy on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the policy.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the policy on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the policy based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the policy's expression (CEL), and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// resourceRules describes what operations on what resources/subresources the admission policy matches.
// The policy cares about an operation if it matches _any_ Rule.
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
// excludeResourceRules describes what operations on what resources/subresources the policy should not care about.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
// matchPolicy defines how the "MatchResources" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1
// API groups. The API server translates the request to a matched resource API if necessary.
//
// Defaults to "Equivalent"
MatchPolicy *admissionregistrationv1alpha1.MatchPolicyType `json:"matchPolicy,omitempty"`
}
// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with

View File

@@ -29,10 +29,14 @@ import (
// MutatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicy type for use
// with apply.
//
// MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
type MutatingAdmissionPolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicy.
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicy constructs a declarative configuration of the MutatingAdmissionPolicy type for use with
@@ -45,29 +49,14 @@ func MutatingAdmissionPolicy(name string) *MutatingAdmissionPolicyApplyConfigura
return b
}
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
// MutatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return extractMutatingAdmissionPolicy(mutatingAdmissionPolicy, fieldManager, "")
}
// ExtractMutatingAdmissionPolicyStatus is the same as ExtractMutatingAdmissionPolicy except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingAdmissionPolicyStatus(mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return extractMutatingAdmissionPolicy(mutatingAdmissionPolicy, fieldManager, "status")
}
func extractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
func ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
b := &MutatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.MutatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +68,21 @@ func extractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrati
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b, nil
}
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
// MutatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy, fieldManager, "")
}
func (b MutatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,10 +29,24 @@ import (
// MutatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBinding type for use
// with apply.
//
// MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources.
// MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators
// configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
// Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
//
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type MutatingAdmissionPolicyBindingApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicyBinding.
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicyBinding constructs a declarative configuration of the MutatingAdmissionPolicyBinding type for use with
@@ -45,29 +59,14 @@ func MutatingAdmissionPolicyBinding(name string) *MutatingAdmissionPolicyBinding
return b
}
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
// MutatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding, fieldManager, "")
}
// ExtractMutatingAdmissionPolicyBindingStatus is the same as ExtractMutatingAdmissionPolicyBinding except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingAdmissionPolicyBindingStatus(mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding, fieldManager, "status")
}
func extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
func ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.MutatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +78,21 @@ func extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admis
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b, nil
}
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
// MutatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding, fieldManager, "")
}
func (b MutatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -20,9 +20,27 @@ package v1alpha1
// MutatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
type MutatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources limits what resources match this binding and may be mutated by it.
// Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and
// matchConditions before the resource may be mutated.
// When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints
// and matchConditions must match for the resource to be mutated.
// Additionally, matchResources.resourceRules are optional and do not constraint matching when unset.
// Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
}

View File

@@ -25,14 +25,74 @@ import (
// MutatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicySpec type for use
// with apply.
//
// MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
type MutatingAdmissionPolicySpecApplyConfiguration struct {
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
ReinvocationPolicy *v1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except matchConditions because matchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// mutations contain operations to perform on matching objects.
// mutations may not be empty; a minimum of one mutation is required.
// mutations are evaluated in order, and are reinvoked according to
// the reinvocationPolicy.
// The mutations of a policy are invoked for each binding of this policy
// and reinvocation of mutations occurs on a per binding basis.
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if paramKind refers to a non-existent Kind.
// A binding is invalid if paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the matchConstraints.
// An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding
// as part of a single admission evaluation.
// Allowed values are "Never" and "IfNeeded".
//
// Never: These mutations will not be called more than once per binding in a single admission evaluation.
//
// IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of
// order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only
// reinvoked when mutations change the object after this mutation is invoked.
// Required.
ReinvocationPolicy *v1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
}
// MutatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicySpec type for use with

View File

@@ -24,10 +24,21 @@ import (
// MutationApplyConfiguration represents a declarative configuration of the Mutation type for use
// with apply.
//
// Mutation specifies the CEL expression which is used to apply the Mutation.
type MutationApplyConfiguration struct {
PatchType *admissionregistrationv1alpha1.PatchType `json:"patchType,omitempty"`
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
// patchType indicates the patch strategy used.
// Allowed values are "ApplyConfiguration" and "JSONPatch".
// Required.
PatchType *admissionregistrationv1alpha1.PatchType `json:"patchType,omitempty"`
// applyConfiguration defines the desired configuration values of an object.
// The configuration is applied to the admission object using
// [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff).
// A CEL expression is used to create apply configuration.
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
// jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object.
// A CEL expression is used to create the JSON patch.
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
}
// MutationApplyConfiguration constructs a declarative configuration of the Mutation type for use with

View File

@@ -25,9 +25,13 @@ import (
// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use
// with apply.
//
// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
type NamedRuleWithOperationsApplyConfiguration struct {
ResourceNames []string `json:"resourceNames,omitempty"`
v1.RuleWithOperationsApplyConfiguration `json:",inline"`
// resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
ResourceNames []string `json:"resourceNames,omitempty"`
// RuleWithOperations is a tuple of Operations and Resources.
v1.RuleWithOperationsApplyConfiguration `json:""`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with

View File

@@ -20,9 +20,16 @@ package v1alpha1
// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use
// with apply.
//
// ParamKind is a tuple of Group Kind and Version.
type ParamKindApplyConfiguration struct {
// apiVersion is the API group version the resources belong to.
// In format of "group/version".
// Required.
APIVersion *string `json:"apiVersion,omitempty"`
Kind *string `json:"kind,omitempty"`
// kind is the API kind the resources belong to.
// Required.
Kind *string `json:"kind,omitempty"`
}
// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with

View File

@@ -25,10 +25,48 @@ import (
// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use
// with apply.
//
// ParamRef describes how to locate the params to be used as input to
// expressions of rules applied by a policy binding.
type ParamRefApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// name is the name of the resource being referenced.
//
// `name` and `selector` are mutually exclusive properties. If one is set,
// the other must be unset.
Name *string `json:"name,omitempty"`
// namespace is the namespace of the referenced resource. Allows limiting
// the search for params to a specific namespace. Applies to both `name` and
// `selector` fields.
//
// A per-namespace parameter may be used by specifying a namespace-scoped
// `paramKind` in the policy and leaving this field empty.
//
// - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
// field results in a configuration error.
//
// - If `paramKind` is namespace-scoped, the namespace of the object being
// evaluated for admission will be used when this field is left unset. Take
// care that if this is left empty the binding must not match any cluster-scoped
// resources, which will result in an error.
Namespace *string `json:"namespace,omitempty"`
// selector can be used to match multiple param objects based on their labels.
// Supply selector: {} to match all resources of the ParamKind.
//
// If multiple params are found, they are all evaluated with the policy expressions
// and the results are ANDed together.
//
// One of `name` or `selector` must be set, but `name` and `selector` are
// mutually exclusive properties. If one is set, the other must be unset.
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// parameterNotFoundAction controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
// matched by the binding. If the value is set to `Allow`, then no
// matched parameters will be treated as successful validation by the binding.
// If set to `Deny`, then no matched parameters will be subject to the
// `failurePolicy` of the policy.
//
// Allowed values are `Allow` or `Deny`
// Default to `Deny`
ParameterNotFoundAction *admissionregistrationv1alpha1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"`
}

View File

@@ -20,7 +20,11 @@ package v1alpha1
// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use
// with apply.
//
// TypeChecking contains results of type checking the expressions in the
// ValidatingAdmissionPolicy
type TypeCheckingApplyConfiguration struct {
// expressionWarnings contains the type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}

View File

@@ -29,11 +29,19 @@ import (
// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use
// with apply.
//
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
type ValidatingAdmissionPolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// status represents the current status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy
// behaves in the expected way.
// Populated by the system.
// Read-only.
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
}
// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with
@@ -46,29 +54,14 @@ func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfi
return b
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status")
}
func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
@@ -80,6 +73,27 @@ func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregist
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b, nil
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the status subresource.
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "status")
}
func (b ValidatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,10 +29,24 @@ import (
// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use
// with apply.
//
// ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources.
// ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
//
// The CEL expressions of a policy must have a computed CEL cost below the maximum
// CEL budget. Each evaluation of the policy is given an independent CEL cost budget.
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type ValidatingAdmissionPolicyBindingApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
@@ -45,29 +59,14 @@ func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBin
return b
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status")
}
func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +78,21 @@ func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *a
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b, nil
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding, fieldManager, "")
}
func (b ValidatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,10 +24,63 @@ import (
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// policyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources declares what resources match this binding and will be validated by it.
// Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this.
// If this is unset, all resources matched by the policy are validated by this binding
// When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated.
// Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced.
// If a validation evaluates to false it is always enforced according to these actions.
//
// Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according
// to these actions only if the FailurePolicy is set to Fail, otherwise the failures are
// ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.
//
// validationActions is declared as a set of action values. Order does
// not matter. validationActions may not contain duplicates of the same action.
//
// The supported actions values are:
//
// "Deny" specifies that a validation failure results in a denied request.
//
// "Warn" specifies that a validation failure is reported to the request client
// in HTTP Warning headers, with a warning code of 299. Warnings can be sent
// both for allowed or denied admission responses.
//
// "Audit" specifies that a validation failure is included in the published
// audit event for the request. The audit event will contain a
// `validation.policy.admission.k8s.io/validation_failure` audit annotation
// with a value containing the details of the validation failures, formatted as
// a JSON list of objects, each with the following fields:
// - message: The validation failure message string
// - policy: The resource name of the ValidatingAdmissionPolicy
// - binding: The resource name of the ValidatingAdmissionPolicyBinding
// - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy
// - validationActions: The enforcement actions enacted for the validation failure
// Example audit annotation:
// `"validation.policy.admission.k8s.io/validation_failure": "[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]"`
//
// Clients should expect to handle additional values by ignoring
// any values not recognized.
//
// "Deny" and "Warn" may not be used together since this combination
// needlessly duplicates the validation failure both in the
// API response body and the HTTP warning headers.
//
// Required.
ValidationActions []admissionregistrationv1alpha1.ValidationAction `json:"validationActions,omitempty"`
}

View File

@@ -24,14 +24,66 @@ import (
// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use
// with apply.
//
// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
type ValidatingAdmissionPolicySpecApplyConfiguration struct {
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The AdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// validations contain CEL expressions which is used to apply the validation.
// Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is
// required.
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if spec.paramKind refers to a non-existent Kind.
// A binding is invalid if spec.paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions
// define how failures are enforced.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
// auditAnnotations contains CEL expressions which are used to produce audit
// annotations for the audit event of the API request.
// validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is
// required.
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except MatchConditions because MatchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, Variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
}
// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with

View File

@@ -24,10 +24,16 @@ import (
// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use
// with apply.
//
// ValidatingAdmissionPolicyStatus represents the status of a ValidatingAdmissionPolicy.
type ValidatingAdmissionPolicyStatusApplyConfiguration struct {
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
// observedGeneration is the generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// typeChecking contains the results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// conditions represent the latest available observations of a policy's current state.
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with

View File

@@ -24,11 +24,77 @@ import (
// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use
// with apply.
//
// Validation specifies the CEL expression which is used to apply the validation.
type ValidationApplyConfiguration struct {
Expression *string `json:"expression,omitempty"`
Message *string `json:"message,omitempty"`
Reason *v1.StatusReason `json:"reason,omitempty"`
MessageExpression *string `json:"messageExpression,omitempty"`
// expression represents the expression which will be evaluated by CEL.
// ref: https://github.com/google/cel-spec
// CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Accessible property names are escaped according to the following rules when accessed in the expression:
// - '__' escapes to '__underscores__'
// - '.' escapes to '__dot__'
// - '-' escapes to '__dash__'
// - '/' escapes to '__slash__'
// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
// "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
// "import", "let", "loop", "package", "namespace", "return".
// Examples:
// - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
// - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
// - Expression accessing a property named "redact__d": {"Expression": "object.redact__underscores__d > 0"}
//
// Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
// Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
// - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and
// non-intersecting elements in `Y` are appended, retaining their partial order.
// - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values
// are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
// non-intersecting keys are appended, retaining their partial order.
// Required.
Expression *string `json:"expression,omitempty"`
// message represents the message displayed when validation fails. The message is required if the Expression contains
// line breaks. The message must not contain line breaks.
// If unset, the message is "failed rule: {Rule}".
// e.g. "must be a URL with the host matching spec.host"
// If the Expression contains line breaks. Message is required.
// The message must not contain line breaks.
// If unset, the message is "failed Expression: {Expression}".
Message *string `json:"message,omitempty"`
// reason represents a machine-readable description of why this validation failed.
// If this is the first validation in the list to fail, this reason, as well as the
// corresponding HTTP response code, are used in the
// HTTP response to the client.
// The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid", "RequestEntityTooLarge".
// If not set, StatusReasonInvalid is used in the response to the client.
Reason *v1.StatusReason `json:"reason,omitempty"`
// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
// Since messageExpression is used as a failure message, it must evaluate to a string.
// If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails.
// If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced
// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and
// the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged.
// messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'.
// Example:
// "object.x must be less than max ("+string(params.max)+")"
MessageExpression *string `json:"messageExpression,omitempty"`
}
// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with

View File

@@ -20,8 +20,15 @@ package v1alpha1
// VariableApplyConfiguration represents a declarative configuration of the Variable type for use
// with apply.
//
// Variable is the definition of a variable that is used for composition.
type VariableApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
// The variable can be accessed in other expressions through `variables`
// For example, if name is "foo", the variable will be available as `variables.foo`
Name *string `json:"name,omitempty"`
// expression is the expression that will be evaluated as the value of the variable.
// The CEL expression has access to the same identifiers as the CEL expressions in Validation.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,7 +20,49 @@ package v1beta1
// ApplyConfigurationApplyConfiguration represents a declarative configuration of the ApplyConfiguration type for use
// with apply.
//
// ApplyConfiguration defines the desired configuration values of an object.
type ApplyConfigurationApplyConfiguration struct {
// expression will be evaluated by CEL to create an apply configuration.
// ref: https://github.com/google/cel-spec
//
// Apply configurations are declared in CEL using object initialization. For example, this CEL expression
// returns an apply configuration to set a single field:
//
// Object{
// spec: Object.spec{
// serviceAccountName: "example"
// }
// }
//
// Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of
// values not included in the apply configuration.
//
// CEL expressions have access to the object types needed to create apply configurations:
//
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,8 +20,40 @@ package v1beta1
// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use
// with apply.
//
// AuditAnnotation describes how to produce an audit annotation for an API request.
type AuditAnnotationApplyConfiguration struct {
Key *string `json:"key,omitempty"`
// key specifies the audit annotation key. The audit annotation keys of
// a ValidatingAdmissionPolicy must be unique. The key must be a qualified
// name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length.
//
// The key is combined with the resource name of the
// ValidatingAdmissionPolicy to construct an audit annotation key:
// "{ValidatingAdmissionPolicy name}/{key}".
//
// If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy
// and the same audit annotation key, the annotation key will be identical.
// In this case, the first annotation written with the key will be included
// in the audit event and all subsequent annotations with the same key
// will be discarded.
//
// Required.
Key *string `json:"key,omitempty"`
// valueExpression represents the expression which is evaluated by CEL to
// produce an audit annotation value. The expression must evaluate to either
// a string or null value. If the expression evaluates to a string, the
// audit annotation is included with the string value. If the expression
// evaluates to null or empty string the audit annotation will be omitted.
// The valueExpression may be no longer than 5kb in length.
// If the result of the valueExpression is more than 10kb in length, it
// will be truncated to 10kb.
//
// If multiple ValidatingAdmissionPolicyBinding resources match an
// API request, then the valueExpression will be evaluated for
// each binding. All unique values produced by the valueExpressions
// will be joined together in a comma-separated list.
//
// Required.
ValueExpression *string `json:"valueExpression,omitempty"`
}

View File

@@ -20,9 +20,17 @@ package v1beta1
// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use
// with apply.
//
// ExpressionWarning is a warning information that targets a specific expression.
type ExpressionWarningApplyConfiguration struct {
// fieldRef is the path to the field that refers to the expression.
// For example, the reference to the expression of the first item of
// validations is "spec.validations[0].expression"
FieldRef *string `json:"fieldRef,omitempty"`
Warning *string `json:"warning,omitempty"`
// warning contains the content of type checking information in a human-readable form.
// Each line of the warning contains the type that the expression is checked
// against, followed by the type check error from the compiler.
Warning *string `json:"warning,omitempty"`
}
// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with

View File

@@ -20,7 +20,73 @@ package v1beta1
// JSONPatchApplyConfiguration represents a declarative configuration of the JSONPatch type for use
// with apply.
//
// JSONPatch defines a JSON Patch.
type JSONPatchApplyConfiguration struct {
// expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/).
// ref: https://github.com/google/cel-spec
//
// expression must return an array of JSONPatch values.
//
// For example, this CEL expression returns a JSON patch to conditionally modify a value:
//
// [
// JSONPatch{op: "test", path: "/spec/example", value: "Red"},
// JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
// ]
//
// To define an object for the patch value, use Object types. For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/spec/selector",
// value: Object.spec.selector{matchLabels: {"environment": "test"}}
// }
// ]
//
// To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
//
// [
// JSONPatch{
// op: "add",
// path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
// value: "test"
// },
// ]
//
// CEL expressions have access to the types needed to create JSON patches and objects:
//
// - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
// See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
// integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
// [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
// function may be used to escape path keys containing '/' and '~'.
// - 'Object' - CEL type of the resource object.
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
//
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries)
// as well as:
//
// - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,8 +20,32 @@ package v1beta1
// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use
// with apply.
//
// MatchCondition represents a condition which must be fulfilled for a request to be sent to a webhook.
type MatchConditionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is an identifier for this match condition, used for strategic merging of MatchConditions,
// as well as providing an identifier for logging purposes. A good name should be descriptive of
// the associated expression.
// Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and
// must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or
// '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an
// optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')
//
// Required.
Name *string `json:"name,omitempty"`
// expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
// CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:
//
// 'object' - The object from the incoming request. The value is null for DELETE requests.
// 'oldObject' - The existing object. The value is null for CREATE requests.
// 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest).
// 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
// Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/
//
// Required.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -25,12 +25,88 @@ import (
// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use
// with apply.
//
// MatchResources decides whether to run the admission control policy on an object based
// on whether it meets the match criteria.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
type MatchResourcesApplyConfiguration struct {
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the admission control policy on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the policy.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the policy on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the validation based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the cel validation, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// resourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
// The policy cares about an operation if it matches _any_ Rule.
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
// excludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
// matchPolicy defines how the "MatchResources" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
//
// Defaults to "Equivalent"
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
}
// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with

View File

@@ -29,10 +29,14 @@ import (
// MutatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicy type for use
// with apply.
//
// MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
type MutatingAdmissionPolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicy.
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicy constructs a declarative configuration of the MutatingAdmissionPolicy type for use with
@@ -45,29 +49,14 @@ func MutatingAdmissionPolicy(name string) *MutatingAdmissionPolicyApplyConfigura
return b
}
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
// MutatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1beta1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return extractMutatingAdmissionPolicy(mutatingAdmissionPolicy, fieldManager, "")
}
// ExtractMutatingAdmissionPolicyStatus is the same as ExtractMutatingAdmissionPolicy except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingAdmissionPolicyStatus(mutatingAdmissionPolicy *admissionregistrationv1beta1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return extractMutatingAdmissionPolicy(mutatingAdmissionPolicy, fieldManager, "status")
}
func extractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1beta1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
func ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy *admissionregistrationv1beta1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
b := &MutatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.MutatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +68,21 @@ func extractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrati
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
// MutatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1beta1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy, fieldManager, "")
}
func (b MutatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,10 +29,24 @@ import (
// MutatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBinding type for use
// with apply.
//
// MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources.
// MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators
// configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
// Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
//
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type MutatingAdmissionPolicyBindingApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the MutatingAdmissionPolicyBinding.
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// MutatingAdmissionPolicyBinding constructs a declarative configuration of the MutatingAdmissionPolicyBinding type for use with
@@ -45,29 +59,14 @@ func MutatingAdmissionPolicyBinding(name string) *MutatingAdmissionPolicyBinding
return b
}
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
// MutatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1beta1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding, fieldManager, "")
}
// ExtractMutatingAdmissionPolicyBindingStatus is the same as ExtractMutatingAdmissionPolicyBinding except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingAdmissionPolicyBindingStatus(mutatingAdmissionPolicyBinding *admissionregistrationv1beta1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding, fieldManager, "status")
}
func extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1beta1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
func ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding *admissionregistrationv1beta1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(mutatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.MutatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +78,21 @@ func extractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admis
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
// MutatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractMutatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1beta1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding, fieldManager, "")
}
func (b MutatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -20,9 +20,27 @@ package v1beta1
// MutatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// MutatingAdmissionPolicyBindingSpec is the specification of the MutatingAdmissionPolicyBinding.
type MutatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources limits what resources match this binding and may be mutated by it.
// Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and
// matchConditions before the resource may be mutated.
// When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints
// and matchConditions must match for the resource to be mutated.
// Additionally, matchResources.resourceRules are optional and do not constraint matching when unset.
// Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
}

View File

@@ -25,14 +25,74 @@ import (
// MutatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicySpec type for use
// with apply.
//
// MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
type MutatingAdmissionPolicySpecApplyConfiguration struct {
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
ReinvocationPolicy *v1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding.
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
// '*' matches CREATE, UPDATE and CONNECT.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except matchConditions because matchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// mutations contain operations to perform on matching objects.
// mutations may not be empty; a minimum of one mutation is required.
// mutations are evaluated in order, and are reinvoked according to
// the reinvocationPolicy.
// The mutations of a policy are invoked for each binding of this policy
// and reinvocation of mutations occurs on a per binding basis.
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if paramKind refers to a non-existent Kind.
// A binding is invalid if paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the matchConstraints.
// An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding
// as part of a single admission evaluation.
// Allowed values are "Never" and "IfNeeded".
//
// Never: These mutations will not be called more than once per binding in a single admission evaluation.
//
// IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of
// order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only
// reinvoked when mutations change the object after this mutation is invoked.
// Required.
ReinvocationPolicy *v1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
}
// MutatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicySpec type for use with

View File

@@ -27,19 +27,149 @@ import (
// MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use
// with apply.
//
// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
type MutatingWebhookApplyConfiguration struct {
Name *string `json:"name,omitempty"`
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// name is the name of the admission webhook.
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
// of the organization.
// Required.
Name *string `json:"name,omitempty"`
// clientConfig defines how to communicate with the hook.
// Required
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
// rules describes what operations on what resources/subresources the webhook cares about.
// The webhook cares about an operation if it matches _any_ Rule.
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
// from putting the cluster in a state which cannot be recovered from without completely
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
// failurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Ignore.
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchPolicy defines how the "rules" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
//
// Defaults to "Exact"
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the webhook on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the webhook.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the webhook on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the webhook, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// sideEffects states whether this webhook has side effects.
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
// sideEffects == Unknown or Some. Defaults to Unknown.
SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"`
// timeoutSeconds specifies the timeout for this webhook. After the timeout passes,
// the webhook call will be ignored or the API call will fail based on the
// failure policy.
// The timeout value must be between 1 and 30 seconds.
// Default to 30 seconds.
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// admissionReviewVersions is an ordered list of preferred `AdmissionReview`
// versions the Webhook expects. API server will try to use first version in
// the list which it supports. If none of the versions specified in this list
// supported by API server, validation will fail for this object.
// If a persisted webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail
// and be subject to the failure policy.
// Default to `['v1beta1']`.
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
// Allowed values are "Never" and "IfNeeded".
//
// Never: the webhook will not be called more than once in a single admission evaluation.
//
// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
// if the object being admitted is modified by other admission plugins after the initial webhook call.
// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
// Note:
// * the number of additional invocations is not guaranteed to be exactly one.
// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
// * webhooks that use this option may be reordered to minimize the number of additional invocations.
// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
//
// Defaults to "Never".
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be sent to this
// webhook. Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
}
// MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with

View File

@@ -29,10 +29,15 @@ import (
// MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use
// with apply.
//
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead.
type MutatingWebhookConfigurationApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
// webhooks is a list of webhooks and the affected resources and operations.
Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
}
// MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with
@@ -45,29 +50,14 @@ func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationAppl
return b
}
// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a
// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractMutatingWebhookConfigurationFrom extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractMutatingWebhookConfigurationFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "")
}
// ExtractMutatingWebhookConfigurationStatus is the same as ExtractMutatingWebhookConfiguration except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractMutatingWebhookConfigurationStatus(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return extractMutatingWebhookConfiguration(mutatingWebhookConfiguration, fieldManager, "status")
}
func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
func ExtractMutatingWebhookConfigurationFrom(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string, subresource string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
b := &MutatingWebhookConfigurationApplyConfiguration{}
err := managedfields.ExtractInto(mutatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.MutatingWebhookConfiguration"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +69,21 @@ func extractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admission
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractMutatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// mutatingWebhookConfiguration. If no managedFields are found in mutatingWebhookConfiguration for fieldManager, a
// MutatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// mutatingWebhookConfiguration must be a unmodified MutatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractMutatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractMutatingWebhookConfiguration(mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, fieldManager string) (*MutatingWebhookConfigurationApplyConfiguration, error) {
return ExtractMutatingWebhookConfigurationFrom(mutatingWebhookConfiguration, fieldManager, "")
}
func (b MutatingWebhookConfigurationApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,10 +24,21 @@ import (
// MutationApplyConfiguration represents a declarative configuration of the Mutation type for use
// with apply.
//
// Mutation specifies the CEL expression which is used to apply the Mutation.
type MutationApplyConfiguration struct {
PatchType *admissionregistrationv1beta1.PatchType `json:"patchType,omitempty"`
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
// patchType indicates the patch strategy used.
// Allowed values are "ApplyConfiguration" and "JSONPatch".
// Required.
PatchType *admissionregistrationv1beta1.PatchType `json:"patchType,omitempty"`
// applyConfiguration defines the desired configuration values of an object.
// The configuration is applied to the admission object using
// [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff).
// A CEL expression is used to create apply configuration.
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
// jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object.
// A CEL expression is used to create the JSON patch.
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
}
// MutationApplyConfiguration constructs a declarative configuration of the Mutation type for use with

View File

@@ -25,9 +25,13 @@ import (
// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use
// with apply.
//
// NamedRuleWithOperations is a tuple of Operations and Resources with ResourceNames.
type NamedRuleWithOperationsApplyConfiguration struct {
ResourceNames []string `json:"resourceNames,omitempty"`
v1.RuleWithOperationsApplyConfiguration `json:",inline"`
// resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
ResourceNames []string `json:"resourceNames,omitempty"`
// RuleWithOperations is a tuple of Operations and Resources.
v1.RuleWithOperationsApplyConfiguration `json:""`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with

View File

@@ -20,9 +20,16 @@ package v1beta1
// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use
// with apply.
//
// ParamKind is a tuple of Group Kind and Version.
type ParamKindApplyConfiguration struct {
// apiVersion is the API group version the resources belong to.
// In format of "group/version".
// Required.
APIVersion *string `json:"apiVersion,omitempty"`
Kind *string `json:"kind,omitempty"`
// kind is the API kind the resources belong to.
// Required.
Kind *string `json:"kind,omitempty"`
}
// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with

View File

@@ -25,10 +25,53 @@ import (
// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use
// with apply.
//
// ParamRef describes how to locate the params to be used as input to
// expressions of rules applied by a policy binding.
type ParamRefApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// name is the name of the resource being referenced.
//
// One of `name` or `selector` must be set, but `name` and `selector` are
// mutually exclusive properties. If one is set, the other must be unset.
//
// A single parameter used for all admission requests can be configured
// by setting the `name` field, leaving `selector` blank, and setting namespace
// if `paramKind` is namespace-scoped.
Name *string `json:"name,omitempty"`
// namespace is the namespace of the referenced resource. Allows limiting
// the search for params to a specific namespace. Applies to both `name` and
// `selector` fields.
//
// A per-namespace parameter may be used by specifying a namespace-scoped
// `paramKind` in the policy and leaving this field empty.
//
// - If `paramKind` is cluster-scoped, this field MUST be unset. Setting this
// field results in a configuration error.
//
// - If `paramKind` is namespace-scoped, the namespace of the object being
// evaluated for admission will be used when this field is left unset. Take
// care that if this is left empty the binding must not match any cluster-scoped
// resources, which will result in an error.
Namespace *string `json:"namespace,omitempty"`
// selector can be used to match multiple param objects based on their labels.
// Supply selector: {} to match all resources of the ParamKind.
//
// If multiple params are found, they are all evaluated with the policy expressions
// and the results are ANDed together.
//
// One of `name` or `selector` must be set, but `name` and `selector` are
// mutually exclusive properties. If one is set, the other must be unset.
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// parameterNotFoundAction controls the behavior of the binding when the resource
// exists, and name or selector is valid, but there are no parameters
// matched by the binding. If the value is set to `Allow`, then no
// matched parameters will be treated as successful validation by the binding.
// If set to `Deny`, then no matched parameters will be subject to the
// `failurePolicy` of the policy.
//
// Allowed values are `Allow` or `Deny`
//
// Required
ParameterNotFoundAction *admissionregistrationv1beta1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"`
}

View File

@@ -20,11 +20,22 @@ package v1beta1
// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use
// with apply.
//
// ServiceReference holds a reference to Service.legacy.k8s.io
type ServiceReferenceApplyConfiguration struct {
// namespace is the namespace of the service.
// Required
Namespace *string `json:"namespace,omitempty"`
Name *string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
Port *int32 `json:"port,omitempty"`
// name is the name of the service.
// Required
Name *string `json:"name,omitempty"`
// path is an optional URL path which will be sent in any request to
// this service.
Path *string `json:"path,omitempty"`
// port is the port on the service that hosts the webhook.
// Default to 443 for backward compatibility.
// port should be a valid port number (1-65535, inclusive).
Port *int32 `json:"port,omitempty"`
}
// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with

View File

@@ -20,7 +20,11 @@ package v1beta1
// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use
// with apply.
//
// TypeChecking contains results of type checking the expressions in the
// ValidatingAdmissionPolicy
type TypeCheckingApplyConfiguration struct {
// expressionWarnings contains the type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}

View File

@@ -29,11 +29,19 @@ import (
// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use
// with apply.
//
// ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it.
type ValidatingAdmissionPolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// status represents the current status of the ValidatingAdmissionPolicy, including warnings that are useful to determine if the policy
// behaves in the expected way.
// Populated by the system.
// Read-only.
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
}
// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with
@@ -46,29 +54,14 @@ func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfi
return b
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status")
}
func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicy"), fieldManager, b, subresource)
if err != nil {
@@ -80,6 +73,27 @@ func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregist
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyStatus extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicy for the status subresource.
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyFrom(validatingAdmissionPolicy, fieldManager, "status")
}
func (b ValidatingAdmissionPolicyApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,10 +29,24 @@ import (
// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use
// with apply.
//
// ValidatingAdmissionPolicyBinding binds the ValidatingAdmissionPolicy with paramerized resources.
// ValidatingAdmissionPolicyBinding and parameter CRDs together define how cluster administrators configure policies for clusters.
//
// For a given admission request, each binding will cause its policy to be
// evaluated N times, where N is 1 for policies/bindings that don't use
// params, otherwise N is the number of parameters selected by the binding.
//
// The CEL expressions of a policy must have a computed CEL cost below the maximum
// CEL budget. Each evaluation of the policy is given an independent CEL cost budget.
// Adding/removing policies, bindings, or params can not affect whether a
// given (policy, binding, param) combination is within its own CEL budget.
type ValidatingAdmissionPolicyBindingApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
// spec defines the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
@@ -45,29 +59,14 @@ func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBin
return b
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingAdmissionPolicyBindingFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "")
}
// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status")
}
func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
func ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +78,21 @@ func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *a
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
return ExtractValidatingAdmissionPolicyBindingFrom(validatingAdmissionPolicyBinding, fieldManager, "")
}
func (b ValidatingAdmissionPolicyBindingApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,10 +24,63 @@ import (
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
PolicyName *string `json:"policyName,omitempty"`
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// policyName references a ValidatingAdmissionPolicy name which the ValidatingAdmissionPolicyBinding binds to.
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
// Required.
PolicyName *string `json:"policyName,omitempty"`
// paramRef specifies the parameter resource used to configure the admission control policy.
// It should point to a resource of the type specified in ParamKind of the bound ValidatingAdmissionPolicy.
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the ValidatingAdmissionPolicy applied.
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
// matchResources declares what resources match this binding and will be validated by it.
// Note that this is intersected with the policy's matchConstraints, so only requests that are matched by the policy can be selected by this.
// If this is unset, all resources matched by the policy are validated by this binding
// When resourceRules is unset, it does not constrain resource matching. If a resource is matched by the other fields of this object, it will be validated.
// Note that this is differs from ValidatingAdmissionPolicy matchConstraints, where resourceRules are required.
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
// validationActions declares how Validations of the referenced ValidatingAdmissionPolicy are enforced.
// If a validation evaluates to false it is always enforced according to these actions.
//
// Failures defined by the ValidatingAdmissionPolicy's FailurePolicy are enforced according
// to these actions only if the FailurePolicy is set to Fail, otherwise the failures are
// ignored. This includes compilation errors, runtime errors and misconfigurations of the policy.
//
// validationActions is declared as a set of action values. Order does
// not matter. validationActions may not contain duplicates of the same action.
//
// The supported actions values are:
//
// "Deny" specifies that a validation failure results in a denied request.
//
// "Warn" specifies that a validation failure is reported to the request client
// in HTTP Warning headers, with a warning code of 299. Warnings can be sent
// both for allowed or denied admission responses.
//
// "Audit" specifies that a validation failure is included in the published
// audit event for the request. The audit event will contain a
// `validation.policy.admission.k8s.io/validation_failure` audit annotation
// with a value containing the details of the validation failures, formatted as
// a JSON list of objects, each with the following fields:
// - message: The validation failure message string
// - policy: The resource name of the ValidatingAdmissionPolicy
// - binding: The resource name of the ValidatingAdmissionPolicyBinding
// - expressionIndex: The index of the failed validations in the ValidatingAdmissionPolicy
// - validationActions: The enforcement actions enacted for the validation failure
// Example audit annotation:
// `"validation.policy.admission.k8s.io/validation_failure": "[{\"message\": \"Invalid value\", {\"policy\": \"policy.example.com\", {\"binding\": \"policybinding.example.com\", {\"expressionIndex\": \"1\", {\"validationActions\": [\"Audit\"]}]"`
//
// Clients should expect to handle additional values by ignoring
// any values not recognized.
//
// "Deny" and "Warn" may not be used together since this combination
// needlessly duplicates the validation failure both in the
// API response body and the HTTP warning headers.
//
// Required.
ValidationActions []admissionregistrationv1beta1.ValidationAction `json:"validationActions,omitempty"`
}

View File

@@ -24,14 +24,66 @@ import (
// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use
// with apply.
//
// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
type ValidatingAdmissionPolicySpecApplyConfiguration struct {
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
// paramKind specifies the kind of resources used to parameterize this policy.
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
// If ParamKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
// If paramKind is specified but paramRef is unset in ValidatingAdmissionPolicyBinding, the params variable will be null.
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
// matchConstraints specifies what resources this policy is designed to validate.
// The AdmissionPolicy cares about a request if it matches _all_ Constraints.
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
// ValidatingAdmissionPolicy cannot match ValidatingAdmissionPolicy and ValidatingAdmissionPolicyBinding.
// Required.
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
// validations contain CEL expressions which is used to apply the validation.
// Validations and AuditAnnotations may not both be empty; a minimum of one Validations or AuditAnnotations is
// required.
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
// failurePolicy defines how to handle failures for the admission policy. Failures can
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
// or mis-configured policy definitions or bindings.
//
// A policy is invalid if spec.paramKind refers to a non-existent Kind.
// A binding is invalid if spec.paramRef.name refers to a non-existent resource.
//
// failurePolicy does not define how validations that evaluate to false are handled.
//
// When failurePolicy is set to Fail, ValidatingAdmissionPolicyBinding validationActions
// define how failures are enforced.
//
// Allowed values are Ignore or Fail. Defaults to Fail.
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
// auditAnnotations contains CEL expressions which are used to produce audit
// annotations for the audit event of the API request.
// validations and auditAnnotations may not both be empty; a least one of validations or auditAnnotations is
// required.
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be validated.
// Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// If a parameter object is provided, it can be accessed via the `params` handle in the same
// manner as validation expressions.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the policy is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// variables contain definitions of variables that can be used in composition of other expressions.
// Each variable is defined as a named CEL expression.
// The variables defined here will be available under `variables` in other expressions of the policy
// except MatchConditions because MatchConditions are evaluated before the rest of the policy.
//
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
// Thus, Variables must be sorted by the order of first appearance and acyclic.
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
}
// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with

View File

@@ -24,10 +24,16 @@ import (
// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use
// with apply.
//
// ValidatingAdmissionPolicyStatus represents the status of an admission validation policy.
type ValidatingAdmissionPolicyStatusApplyConfiguration struct {
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
// observedGeneration is the generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// typeChecking contains the results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// conditions represent the latest available observations of a policy's current state.
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with

View File

@@ -26,18 +26,133 @@ import (
// ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use
// with apply.
//
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
type ValidatingWebhookApplyConfiguration struct {
Name *string `json:"name,omitempty"`
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
// name is the name of the admission webhook.
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
// of the organization.
// Required.
Name *string `json:"name,omitempty"`
// clientConfig defines how to communicate with the hook.
// Required
ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"`
// rules describes what operations on what resources/subresources the webhook cares about.
// The webhook cares about an operation if it matches _any_ Rule.
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
// from putting the cluster in a state which cannot be recovered from without completely
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
Rules []v1.RuleWithOperationsApplyConfiguration `json:"rules,omitempty"`
// failurePolicy defines how unrecognized errors from the admission endpoint are handled -
// allowed values are Ignore or Fail. Defaults to Ignore.
FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"`
// matchPolicy defines how the "rules" list is used to match incoming requests.
// Allowed values are "Exact" or "Equivalent".
//
// - Exact: match a request only if it exactly matches a specified rule.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
//
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
//
// Defaults to "Exact"
MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"`
// namespaceSelector decides whether to run the webhook on an object based
// on whether the namespace for that object matches the selector. If the
// object itself is a namespace, the matching is performed on
// object.metadata.labels. If the object is another cluster scoped resource,
// it never skips the webhook.
//
// For example, to run the webhook on any objects whose namespace is not
// associated with "runlevel" of "0" or "1"; you will set the selector as
// follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "runlevel",
// "operator": "NotIn",
// "values": [
// "0",
// "1"
// ]
// }
// ]
// }
//
// If instead you want to only run the webhook on any objects whose
// namespace is associated with the "environment" of "prod" or "staging";
// you will set the selector as follows:
// "namespaceSelector": {
// "matchExpressions": [
// {
// "key": "environment",
// "operator": "In",
// "values": [
// "prod",
// "staging"
// ]
// }
// ]
// }
//
// See
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
// for more examples of label selectors.
//
// Default to the empty LabelSelector, which matches everything.
NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
// objectSelector decides whether to run the webhook based on if the
// object has matching labels. objectSelector is evaluated against both
// the oldObject and newObject that would be sent to the webhook, and
// is considered to match if either object matches the selector. A null
// object (oldObject in the case of create, or newObject in the case of
// delete) or an object that cannot have labels (like a
// DeploymentRollback or a PodProxyOptions object) is not considered to
// match.
// Use the object selector only if the webhook is opt-in, because end
// users may skip the admission webhook by setting the labels.
// Default to the empty LabelSelector, which matches everything.
ObjectSelector *metav1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
// sideEffects states whether this webhook has side effects.
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
// rejected by a future step in the admission chain and the side effects therefore need to be undone.
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
// sideEffects == Unknown or Some. Defaults to Unknown.
SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"`
// timeoutSeconds specifies the timeout for this webhook. After the timeout passes,
// the webhook call will be ignored or the API call will fail based on the
// failure policy.
// The timeout value must be between 1 and 30 seconds.
// Default to 30 seconds.
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// admissionReviewVersions is an ordered list of preferred `AdmissionReview`
// versions the Webhook expects. API server will try to use first version in
// the list which it supports. If none of the versions specified in this list
// supported by API server, validation will fail for this object.
// If a persisted webhook configuration specifies allowed versions and does not
// include any versions known to the API Server, calls to the webhook will fail
// and be subject to the failure policy.
// Default to `['v1beta1']`.
AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"`
// matchConditions is a list of conditions that must be met for a request to be sent to this
// webhook. Match conditions filter requests that have already been matched by the rules,
// namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests.
// There are a maximum of 64 match conditions allowed.
//
// The exact matching logic is (in order):
// 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
// 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
// 3. If any matchCondition evaluates to an error (but none are FALSE):
// - If failurePolicy=Fail, reject the request
// - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
}
// ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with

View File

@@ -29,10 +29,15 @@ import (
// ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use
// with apply.
//
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead.
type ValidatingWebhookConfigurationApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
// webhooks is a list of webhooks and the affected resources and operations.
Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"`
}
// ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with
@@ -45,29 +50,14 @@ func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfiguration
return b
}
// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a
// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractValidatingWebhookConfigurationFrom extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractValidatingWebhookConfigurationFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "")
}
// ExtractValidatingWebhookConfigurationStatus is the same as ExtractValidatingWebhookConfiguration except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractValidatingWebhookConfigurationStatus(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return extractValidatingWebhookConfiguration(validatingWebhookConfiguration, fieldManager, "status")
}
func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
func ExtractValidatingWebhookConfigurationFrom(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string, subresource string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
b := &ValidatingWebhookConfigurationApplyConfiguration{}
err := managedfields.ExtractInto(validatingWebhookConfiguration, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingWebhookConfiguration"), fieldManager, b, subresource)
if err != nil {
@@ -79,6 +69,21 @@ func extractValidatingWebhookConfiguration(validatingWebhookConfiguration *admis
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b, nil
}
// ExtractValidatingWebhookConfiguration extracts the applied configuration owned by fieldManager from
// validatingWebhookConfiguration. If no managedFields are found in validatingWebhookConfiguration for fieldManager, a
// ValidatingWebhookConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// validatingWebhookConfiguration must be a unmodified ValidatingWebhookConfiguration API object that was retrieved from the Kubernetes API.
// ExtractValidatingWebhookConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractValidatingWebhookConfiguration(validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, fieldManager string) (*ValidatingWebhookConfigurationApplyConfiguration, error) {
return ExtractValidatingWebhookConfigurationFrom(validatingWebhookConfiguration, fieldManager, "")
}
func (b ValidatingWebhookConfigurationApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -24,11 +24,77 @@ import (
// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use
// with apply.
//
// Validation specifies the CEL expression which is used to apply the validation.
type ValidationApplyConfiguration struct {
Expression *string `json:"expression,omitempty"`
Message *string `json:"message,omitempty"`
Reason *v1.StatusReason `json:"reason,omitempty"`
MessageExpression *string `json:"messageExpression,omitempty"`
// expression represents the expression which will be evaluated by CEL.
// ref: https://github.com/google/cel-spec
// CEL expressions have access to the contents of the API request/response, organized into CEL variables as well as some other useful variables:
//
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
// - 'oldObject' - The existing object. The value is null for CREATE requests.
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
// request resource.
//
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
// object. No other metadata properties are accessible.
//
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
// Accessible property names are escaped according to the following rules when accessed in the expression:
// - '__' escapes to '__underscores__'
// - '.' escapes to '__dot__'
// - '-' escapes to '__dash__'
// - '/' escapes to '__slash__'
// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
// "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
// "import", "let", "loop", "package", "namespace", "return".
// Examples:
// - Expression accessing a property named "namespace": {"Expression": "object.__namespace__ > 0"}
// - Expression accessing a property named "x-prop": {"Expression": "object.x__dash__prop > 0"}
// - Expression accessing a property named "redact__d": {"Expression": "object.redact__underscores__d > 0"}
//
// Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
// Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
// - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and
// non-intersecting elements in `Y` are appended, retaining their partial order.
// - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values
// are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with
// non-intersecting keys are appended, retaining their partial order.
// Required.
Expression *string `json:"expression,omitempty"`
// message represents the message displayed when validation fails. The message is required if the Expression contains
// line breaks. The message must not contain line breaks.
// If unset, the message is "failed rule: {Rule}".
// e.g. "must be a URL with the host matching spec.host"
// If the Expression contains line breaks. Message is required.
// The message must not contain line breaks.
// If unset, the message is "failed Expression: {Expression}".
Message *string `json:"message,omitempty"`
// reason represents a machine-readable description of why this validation failed.
// If this is the first validation in the list to fail, this reason, as well as the
// corresponding HTTP response code, are used in the
// HTTP response to the client.
// The currently supported reasons are: "Unauthorized", "Forbidden", "Invalid", "RequestEntityTooLarge".
// If not set, StatusReasonInvalid is used in the response to the client.
Reason *v1.StatusReason `json:"reason,omitempty"`
// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
// Since messageExpression is used as a failure message, it must evaluate to a string.
// If both message and messageExpression are present on a validation, then messageExpression will be used if validation fails.
// If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced
// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and
// the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged.
// messageExpression has access to all the same variables as the `expression` except for 'authorizer' and 'authorizer.requestResource'.
// Example:
// "object.x must be less than max ("+string(params.max)+")"
MessageExpression *string `json:"messageExpression,omitempty"`
}
// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with

View File

@@ -20,8 +20,15 @@ package v1beta1
// VariableApplyConfiguration represents a declarative configuration of the Variable type for use
// with apply.
//
// Variable is the definition of a variable that is used for composition. A variable is defined as a named expression.
type VariableApplyConfiguration struct {
Name *string `json:"name,omitempty"`
// name is the name of the variable. The name must be a valid CEL identifier and unique among all variables.
// The variable can be accessed in other expressions through `variables`
// For example, if name is "foo", the variable will be available as `variables.foo`
Name *string `json:"name,omitempty"`
// expression is the expression that will be evaluated as the value of the variable.
// The CEL expression has access to the same identifiers as the CEL expressions in Validation.
Expression *string `json:"expression,omitempty"`
}

View File

@@ -20,10 +20,44 @@ package v1beta1
// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use
// with apply.
//
// WebhookClientConfig contains the information to make a TLS
// connection with the webhook
type WebhookClientConfigApplyConfiguration struct {
URL *string `json:"url,omitempty"`
Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"`
CABundle []byte `json:"caBundle,omitempty"`
// url gives the location of the webhook, in standard URL form
// (`scheme://host:port/path`). Exactly one of `url` or `service`
// must be specified.
//
// The `host` should not refer to a service running in the cluster; use
// the `service` field instead. The host might be resolved via external
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
// in-cluster DNS as that would be a layering violation). `host` may
// also be an IP address.
//
// Please note that using `localhost` or `127.0.0.1` as a `host` is
// risky unless you take great care to run this webhook on all hosts
// which run an apiserver which might need to make calls to this
// webhook. Such installs are likely to be non-portable, i.e., not easy
// to turn up in a new cluster.
//
// The scheme must be "https"; the URL must begin with "https://".
//
// A path is optional, and if present may be any string permissible in
// a URL. You may use the path to pass an arbitrary string to the
// webhook, for example, a cluster identifier.
//
// Attempting to use a user or basic auth e.g. "user:password@" is not
// allowed. Fragments ("#...") and query parameters ("?...") are not
// allowed, either.
URL *string `json:"url,omitempty"`
// service is a reference to the service for this webhook. Either
// `service` or `url` must be specified.
//
// If the webhook is running within the cluster, then you should use `service`.
Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"`
// caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
// If unspecified, system trust roots on the apiserver are used.
CABundle []byte `json:"caBundle,omitempty"`
}
// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with

View File

@@ -20,11 +20,22 @@ package v1alpha1
// ServerStorageVersionApplyConfiguration represents a declarative configuration of the ServerStorageVersion type for use
// with apply.
//
// An API server instance reports the version it can decode and the version it
// encodes objects to when persisting objects in the backend.
type ServerStorageVersionApplyConfiguration struct {
APIServerID *string `json:"apiServerID,omitempty"`
EncodingVersion *string `json:"encodingVersion,omitempty"`
// apiServerID is the ID of the reporting API server.
APIServerID *string `json:"apiServerID,omitempty"`
// encodingVersion the API server encodes the object to when persisting it in
// the backend (e.g., etcd).
EncodingVersion *string `json:"encodingVersion,omitempty"`
// decodableVersions are the encoding versions the API server can handle to decode.
// The API server can decode objects encoded in these versions.
// The encodingVersion must be included in the decodableVersions.
DecodableVersions []string `json:"decodableVersions,omitempty"`
ServedVersions []string `json:"servedVersions,omitempty"`
// servedVersions lists all versions the API server can serve.
// DecodableVersions must include all ServedVersions.
ServedVersions []string `json:"servedVersions,omitempty"`
}
// ServerStorageVersionApplyConfiguration constructs a declarative configuration of the ServerStorageVersion type for use with

View File

@@ -29,11 +29,18 @@ import (
// StorageVersionApplyConfiguration represents a declarative configuration of the StorageVersion type for use
// with apply.
//
// Storage version of a specific resource.
type StorageVersionApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata.
// The name is <group>.<resource>.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *apiserverinternalv1alpha1.StorageVersionSpec `json:"spec,omitempty"`
Status *StorageVersionStatusApplyConfiguration `json:"status,omitempty"`
// spec is an empty spec. It is here to comply with Kubernetes API style.
Spec *apiserverinternalv1alpha1.StorageVersionSpec `json:"spec,omitempty"`
// status on the version the API server instance can decode from and
// encode objects to when persisting objects in the backend.
Status *StorageVersionStatusApplyConfiguration `json:"status,omitempty"`
}
// StorageVersion constructs a declarative configuration of the StorageVersion type for use with
@@ -46,29 +53,14 @@ func StorageVersion(name string) *StorageVersionApplyConfiguration {
return b
}
// ExtractStorageVersion extracts the applied configuration owned by fieldManager from
// storageVersion. If no managedFields are found in storageVersion for fieldManager, a
// StorageVersionApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractStorageVersionFrom extracts the applied configuration owned by fieldManager from
// storageVersion for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// storageVersion must be a unmodified StorageVersion API object that was retrieved from the Kubernetes API.
// ExtractStorageVersion provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractStorageVersionFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractStorageVersion(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) {
return extractStorageVersion(storageVersion, fieldManager, "")
}
// ExtractStorageVersionStatus is the same as ExtractStorageVersion except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractStorageVersionStatus(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) {
return extractStorageVersion(storageVersion, fieldManager, "status")
}
func extractStorageVersion(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string, subresource string) (*StorageVersionApplyConfiguration, error) {
func ExtractStorageVersionFrom(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string, subresource string) (*StorageVersionApplyConfiguration, error) {
b := &StorageVersionApplyConfiguration{}
err := managedfields.ExtractInto(storageVersion, internal.Parser().Type("io.k8s.api.apiserverinternal.v1alpha1.StorageVersion"), fieldManager, b, subresource)
if err != nil {
@@ -80,6 +72,27 @@ func extractStorageVersion(storageVersion *apiserverinternalv1alpha1.StorageVers
b.WithAPIVersion("internal.apiserver.k8s.io/v1alpha1")
return b, nil
}
// ExtractStorageVersion extracts the applied configuration owned by fieldManager from
// storageVersion. If no managedFields are found in storageVersion for fieldManager, a
// StorageVersionApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// storageVersion must be a unmodified StorageVersion API object that was retrieved from the Kubernetes API.
// ExtractStorageVersion provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractStorageVersion(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) {
return ExtractStorageVersionFrom(storageVersion, fieldManager, "")
}
// ExtractStorageVersionStatus extracts the applied configuration owned by fieldManager from
// storageVersion for the status subresource.
func ExtractStorageVersionStatus(storageVersion *apiserverinternalv1alpha1.StorageVersion, fieldManager string) (*StorageVersionApplyConfiguration, error) {
return ExtractStorageVersionFrom(storageVersion, fieldManager, "status")
}
func (b StorageVersionApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -25,13 +25,21 @@ import (
// StorageVersionConditionApplyConfiguration represents a declarative configuration of the StorageVersionCondition type for use
// with apply.
//
// Describes the state of the storageVersion at a certain point.
type StorageVersionConditionApplyConfiguration struct {
Type *apiserverinternalv1alpha1.StorageVersionConditionType `json:"type,omitempty"`
Status *apiserverinternalv1alpha1.ConditionStatus `json:"status,omitempty"`
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
// type of the condition.
Type *apiserverinternalv1alpha1.StorageVersionConditionType `json:"type,omitempty"`
// status of the condition, one of True, False, Unknown.
Status *apiserverinternalv1alpha1.ConditionStatus `json:"status,omitempty"`
// observedGeneration represents the .metadata.generation that the condition was set based upon, if field is set.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// lastTransitionTime is the last time the condition transitioned from one status to another.
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
// reason for the condition's last transition.
Reason *string `json:"reason,omitempty"`
// message is a human readable string indicating details about the transition.
Message *string `json:"message,omitempty"`
}
// StorageVersionConditionApplyConfiguration constructs a declarative configuration of the StorageVersionCondition type for use with

View File

@@ -20,10 +20,20 @@ package v1alpha1
// StorageVersionStatusApplyConfiguration represents a declarative configuration of the StorageVersionStatus type for use
// with apply.
//
// API server instances report the versions they can decode and the version they
// encode objects to when persisting objects in the backend.
type StorageVersionStatusApplyConfiguration struct {
StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"`
CommonEncodingVersion *string `json:"commonEncodingVersion,omitempty"`
Conditions []StorageVersionConditionApplyConfiguration `json:"conditions,omitempty"`
// storageVersions lists the reported versions per API server instance.
StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"`
// commonEncodingVersion is set to an encoding storage version if all API server
// instances share that same version. If they don't share one storage version, this
// field is left empty.
// API servers should finish updating its storageVersionStatus entry before
// serving write operations, so that this field will be in sync with the reality.
CommonEncodingVersion *string `json:"commonEncodingVersion,omitempty"`
// conditions lists the latest available observations of the storageVersion's state.
Conditions []StorageVersionConditionApplyConfiguration `json:"conditions,omitempty"`
}
// StorageVersionStatusApplyConfiguration constructs a declarative configuration of the StorageVersionStatus type for use with

View File

@@ -30,11 +30,25 @@ import (
// ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use
// with apply.
//
// ControllerRevision implements an immutable snapshot of state data. Clients
// are responsible for serializing and deserializing the objects that contain
// their internal state.
// Once a ControllerRevision has been successfully created, it can not be updated.
// The API Server will fail validation of all requests that attempt to mutate
// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both
// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However,
// it may be subject to name and representation changes in future releases, and clients should not
// depend on its stability. It is primarily for internal use by controllers.
type ControllerRevisionApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Data *runtime.RawExtension `json:"data,omitempty"`
Revision *int64 `json:"revision,omitempty"`
// Data is the serialized representation of the state.
Data *runtime.RawExtension `json:"data,omitempty"`
// Revision indicates the revision of the state represented by Data.
Revision *int64 `json:"revision,omitempty"`
}
// ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with
@@ -48,29 +62,14 @@ func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfigur
return b
}
// ExtractControllerRevision extracts the applied configuration owned by fieldManager from
// controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a
// ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractControllerRevisionFrom extracts the applied configuration owned by fieldManager from
// controllerRevision for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API.
// ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractControllerRevisionFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) {
return extractControllerRevision(controllerRevision, fieldManager, "")
}
// ExtractControllerRevisionStatus is the same as ExtractControllerRevision except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractControllerRevisionStatus(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) {
return extractControllerRevision(controllerRevision, fieldManager, "status")
}
func extractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) {
func ExtractControllerRevisionFrom(controllerRevision *appsv1.ControllerRevision, fieldManager string, subresource string) (*ControllerRevisionApplyConfiguration, error) {
b := &ControllerRevisionApplyConfiguration{}
err := managedfields.ExtractInto(controllerRevision, internal.Parser().Type("io.k8s.api.apps.v1.ControllerRevision"), fieldManager, b, subresource)
if err != nil {
@@ -83,6 +82,21 @@ func extractControllerRevision(controllerRevision *appsv1.ControllerRevision, fi
b.WithAPIVersion("apps/v1")
return b, nil
}
// ExtractControllerRevision extracts the applied configuration owned by fieldManager from
// controllerRevision. If no managedFields are found in controllerRevision for fieldManager, a
// ControllerRevisionApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// controllerRevision must be a unmodified ControllerRevision API object that was retrieved from the Kubernetes API.
// ExtractControllerRevision provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractControllerRevision(controllerRevision *appsv1.ControllerRevision, fieldManager string) (*ControllerRevisionApplyConfiguration, error) {
return ExtractControllerRevisionFrom(controllerRevision, fieldManager, "")
}
func (b ControllerRevisionApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -29,11 +29,22 @@ import (
// DaemonSetApplyConfiguration represents a declarative configuration of the DaemonSet type for use
// with apply.
//
// DaemonSet represents the configuration of a daemon set.
type DaemonSetApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *DaemonSetSpecApplyConfiguration `json:"spec,omitempty"`
Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"`
// The desired behavior of this daemon set.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec *DaemonSetSpecApplyConfiguration `json:"spec,omitempty"`
// The current status of this daemon set. This data may be
// out of date by some window of time.
// Populated by the system.
// Read-only.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"`
}
// DaemonSet constructs a declarative configuration of the DaemonSet type for use with
@@ -47,29 +58,14 @@ func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration {
return b
}
// ExtractDaemonSet extracts the applied configuration owned by fieldManager from
// daemonSet. If no managedFields are found in daemonSet for fieldManager, a
// DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractDaemonSetFrom extracts the applied configuration owned by fieldManager from
// daemonSet for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API.
// ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractDaemonSetFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractDaemonSet(daemonSet *appsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) {
return extractDaemonSet(daemonSet, fieldManager, "")
}
// ExtractDaemonSetStatus is the same as ExtractDaemonSet except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractDaemonSetStatus(daemonSet *appsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) {
return extractDaemonSet(daemonSet, fieldManager, "status")
}
func extractDaemonSet(daemonSet *appsv1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) {
func ExtractDaemonSetFrom(daemonSet *appsv1.DaemonSet, fieldManager string, subresource string) (*DaemonSetApplyConfiguration, error) {
b := &DaemonSetApplyConfiguration{}
err := managedfields.ExtractInto(daemonSet, internal.Parser().Type("io.k8s.api.apps.v1.DaemonSet"), fieldManager, b, subresource)
if err != nil {
@@ -82,6 +78,27 @@ func extractDaemonSet(daemonSet *appsv1.DaemonSet, fieldManager string, subresou
b.WithAPIVersion("apps/v1")
return b, nil
}
// ExtractDaemonSet extracts the applied configuration owned by fieldManager from
// daemonSet. If no managedFields are found in daemonSet for fieldManager, a
// DaemonSetApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// daemonSet must be a unmodified DaemonSet API object that was retrieved from the Kubernetes API.
// ExtractDaemonSet provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractDaemonSet(daemonSet *appsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) {
return ExtractDaemonSetFrom(daemonSet, fieldManager, "")
}
// ExtractDaemonSetStatus extracts the applied configuration owned by fieldManager from
// daemonSet for the status subresource.
func ExtractDaemonSetStatus(daemonSet *appsv1.DaemonSet, fieldManager string) (*DaemonSetApplyConfiguration, error) {
return ExtractDaemonSetFrom(daemonSet, fieldManager, "status")
}
func (b DaemonSetApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -26,12 +26,20 @@ import (
// DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use
// with apply.
//
// TODO: Add valid condition types of a DaemonSet.
// DaemonSetCondition describes the state of a DaemonSet at a certain point.
type DaemonSetConditionApplyConfiguration struct {
Type *appsv1.DaemonSetConditionType `json:"type,omitempty"`
Status *corev1.ConditionStatus `json:"status,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
// Type of DaemonSet condition.
Type *appsv1.DaemonSetConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status *corev1.ConditionStatus `json:"status,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason *string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
Message *string `json:"message,omitempty"`
}
// DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with

View File

@@ -25,12 +25,32 @@ import (
// DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use
// with apply.
//
// DaemonSetSpec is the specification of a daemon set.
type DaemonSetSpecApplyConfiguration struct {
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
UpdateStrategy *DaemonSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"`
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
// A label query over pods that are managed by the daemon set.
// Must match in order to be controlled.
// It must match the pod template's labels.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// An object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node
// that matches the template's node selector (or on every node if no node
// selector is specified).
// The only allowed template.spec.restartPolicy value is "Always".
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
// An update strategy to replace existing DaemonSet pods with new pods.
UpdateStrategy *DaemonSetUpdateStrategyApplyConfiguration `json:"updateStrategy,omitempty"`
// The minimum number of seconds for which a newly created DaemonSet pod should
// be ready without any of its container crashing, for it to be considered
// available. Defaults to 0 (pod will be considered available as soon as it
// is ready).
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
// The number of old history to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
// Defaults to 10.
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
}
// DaemonSetSpecApplyConfiguration constructs a declarative configuration of the DaemonSetSpec type for use with

View File

@@ -20,17 +20,42 @@ package v1
// DaemonSetStatusApplyConfiguration represents a declarative configuration of the DaemonSetStatus type for use
// with apply.
//
// DaemonSetStatus represents the current status of a daemon set.
type DaemonSetStatusApplyConfiguration struct {
CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"`
NumberMisscheduled *int32 `json:"numberMisscheduled,omitempty"`
DesiredNumberScheduled *int32 `json:"desiredNumberScheduled,omitempty"`
NumberReady *int32 `json:"numberReady,omitempty"`
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
UpdatedNumberScheduled *int32 `json:"updatedNumberScheduled,omitempty"`
NumberAvailable *int32 `json:"numberAvailable,omitempty"`
NumberUnavailable *int32 `json:"numberUnavailable,omitempty"`
CollisionCount *int32 `json:"collisionCount,omitempty"`
Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,omitempty"`
// The number of nodes that are running at least 1
// daemon pod and are supposed to run the daemon pod.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"`
// The number of nodes that are running the daemon pod, but are
// not supposed to run the daemon pod.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
NumberMisscheduled *int32 `json:"numberMisscheduled,omitempty"`
// The total number of nodes that should be running the daemon
// pod (including nodes correctly running the daemon pod).
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
DesiredNumberScheduled *int32 `json:"desiredNumberScheduled,omitempty"`
// numberReady is the number of nodes that should be running the daemon pod and have one
// or more of the daemon pod running with a Ready Condition.
NumberReady *int32 `json:"numberReady,omitempty"`
// The most recent generation observed by the daemon set controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// The total number of nodes that are running updated daemon pod
UpdatedNumberScheduled *int32 `json:"updatedNumberScheduled,omitempty"`
// The number of nodes that should be running the
// daemon pod and have one or more of the daemon pod running and
// available (ready for at least spec.minReadySeconds)
NumberAvailable *int32 `json:"numberAvailable,omitempty"`
// The number of nodes that should be running the
// daemon pod and have none of the daemon pod running and available
// (ready for at least spec.minReadySeconds)
NumberUnavailable *int32 `json:"numberUnavailable,omitempty"`
// Count of hash collisions for the DaemonSet. The DaemonSet controller
// uses this field as a collision avoidance mechanism when it needs to
// create the name for the newest ControllerRevision.
CollisionCount *int32 `json:"collisionCount,omitempty"`
// Represents the latest available observations of a DaemonSet's current state.
Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,omitempty"`
}
// DaemonSetStatusApplyConfiguration constructs a declarative configuration of the DaemonSetStatus type for use with

View File

@@ -24,8 +24,16 @@ import (
// DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use
// with apply.
//
// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.
type DaemonSetUpdateStrategyApplyConfiguration struct {
Type *appsv1.DaemonSetUpdateStrategyType `json:"type,omitempty"`
// Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate.
Type *appsv1.DaemonSetUpdateStrategyType `json:"type,omitempty"`
// Rolling update config params. Present only if type = "RollingUpdate".
// ---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be. Same as Deployment `strategy.rollingUpdate`.
// See https://github.com/kubernetes/kubernetes/issues/35345
RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"`
}

View File

@@ -29,11 +29,17 @@ import (
// DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use
// with apply.
//
// Deployment enables declarative updates for Pods and ReplicaSets.
type DeploymentApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"`
Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"`
// Specification of the desired behavior of the Deployment.
Spec *DeploymentSpecApplyConfiguration `json:"spec,omitempty"`
// Most recently observed status of the Deployment.
Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"`
}
// Deployment constructs a declarative configuration of the Deployment type for use with
@@ -47,29 +53,14 @@ func Deployment(name, namespace string) *DeploymentApplyConfiguration {
return b
}
// ExtractDeployment extracts the applied configuration owned by fieldManager from
// deployment. If no managedFields are found in deployment for fieldManager, a
// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractDeploymentFrom extracts the applied configuration owned by fieldManager from
// deployment for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API.
// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractDeploymentFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractDeployment(deployment *appsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) {
return extractDeployment(deployment, fieldManager, "")
}
// ExtractDeploymentStatus is the same as ExtractDeployment except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractDeploymentStatus(deployment *appsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) {
return extractDeployment(deployment, fieldManager, "status")
}
func extractDeployment(deployment *appsv1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) {
func ExtractDeploymentFrom(deployment *appsv1.Deployment, fieldManager string, subresource string) (*DeploymentApplyConfiguration, error) {
b := &DeploymentApplyConfiguration{}
err := managedfields.ExtractInto(deployment, internal.Parser().Type("io.k8s.api.apps.v1.Deployment"), fieldManager, b, subresource)
if err != nil {
@@ -82,6 +73,33 @@ func extractDeployment(deployment *appsv1.Deployment, fieldManager string, subre
b.WithAPIVersion("apps/v1")
return b, nil
}
// ExtractDeployment extracts the applied configuration owned by fieldManager from
// deployment. If no managedFields are found in deployment for fieldManager, a
// DeploymentApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// deployment must be a unmodified Deployment API object that was retrieved from the Kubernetes API.
// ExtractDeployment provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractDeployment(deployment *appsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) {
return ExtractDeploymentFrom(deployment, fieldManager, "")
}
// ExtractDeploymentScale extracts the applied configuration owned by fieldManager from
// deployment for the scale subresource.
func ExtractDeploymentScale(deployment *appsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) {
return ExtractDeploymentFrom(deployment, fieldManager, "scale")
}
// ExtractDeploymentStatus extracts the applied configuration owned by fieldManager from
// deployment for the status subresource.
func ExtractDeploymentStatus(deployment *appsv1.Deployment, fieldManager string) (*DeploymentApplyConfiguration, error) {
return ExtractDeploymentFrom(deployment, fieldManager, "status")
}
func (b DeploymentApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -26,13 +26,21 @@ import (
// DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use
// with apply.
//
// DeploymentCondition describes the state of a deployment at a certain point.
type DeploymentConditionApplyConfiguration struct {
Type *appsv1.DeploymentConditionType `json:"type,omitempty"`
Status *corev1.ConditionStatus `json:"status,omitempty"`
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
// Type of deployment condition.
Type *appsv1.DeploymentConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status *corev1.ConditionStatus `json:"status,omitempty"`
// The last time this condition was updated.
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason *string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
Message *string `json:"message,omitempty"`
}
// DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with

View File

@@ -25,15 +25,37 @@ import (
// DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use
// with apply.
//
// DeploymentSpec is the specification of the desired behavior of the Deployment.
type DeploymentSpecApplyConfiguration struct {
Replicas *int32 `json:"replicas,omitempty"`
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"`
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
Paused *bool `json:"paused,omitempty"`
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"`
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
Replicas *int32 `json:"replicas,omitempty"`
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
// It must match the pod template's labels.
Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
// Template describes the pods that will be created.
// The only allowed template.spec.restartPolicy value is "Always".
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
// The deployment strategy to use to replace existing pods with new ones.
Strategy *DeploymentStrategyApplyConfiguration `json:"strategy,omitempty"`
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
// The number of old ReplicaSets to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
// Defaults to 10.
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
// Indicates that the deployment is paused.
Paused *bool `json:"paused,omitempty"`
// The maximum time in seconds for a deployment to make progress before it
// is considered to be failed. The deployment controller will continue to
// process failed deployments and a condition with a ProgressDeadlineExceeded
// reason will be surfaced in the deployment status. Note that progress will
// not be estimated during the time a deployment is paused. Defaults to 600s.
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"`
}
// DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with

View File

@@ -20,16 +20,34 @@ package v1
// DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use
// with apply.
//
// DeploymentStatus is the most recently observed status of the Deployment.
type DeploymentStatusApplyConfiguration struct {
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
Replicas *int32 `json:"replicas,omitempty"`
UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"`
ReadyReplicas *int32 `json:"readyReplicas,omitempty"`
AvailableReplicas *int32 `json:"availableReplicas,omitempty"`
UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"`
TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"`
Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"`
CollisionCount *int32 `json:"collisionCount,omitempty"`
// The generation observed by the deployment controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// Total number of non-terminating pods targeted by this deployment (their labels match the selector).
Replicas *int32 `json:"replicas,omitempty"`
// Total number of non-terminating pods targeted by this deployment that have the desired template spec.
UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"`
// Total number of non-terminating pods targeted by this Deployment with a Ready Condition.
ReadyReplicas *int32 `json:"readyReplicas,omitempty"`
// Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.
AvailableReplicas *int32 `json:"availableReplicas,omitempty"`
// Total number of unavailable pods targeted by this deployment. This is the total number of
// pods that are still required for the deployment to have 100% available capacity. They may
// either be pods that are running but not yet available or pods that still have not been created.
UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"`
// Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
// .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
//
// This is a beta field and requires enabling DeploymentReplicaSetTerminatingReplicas feature (enabled by default).
TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"`
// Represents the latest available observations of a deployment's current state.
Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"`
// Count of hash collisions for the Deployment. The Deployment controller uses this
// field as a collision avoidance mechanism when it needs to create the name for the
// newest ReplicaSet.
CollisionCount *int32 `json:"collisionCount,omitempty"`
}
// DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with

View File

@@ -24,8 +24,16 @@ import (
// DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use
// with apply.
//
// DeploymentStrategy describes how to replace existing pods with new ones.
type DeploymentStrategyApplyConfiguration struct {
Type *appsv1.DeploymentStrategyType `json:"type,omitempty"`
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
Type *appsv1.DeploymentStrategyType `json:"type,omitempty"`
// Rolling update config params. Present only if DeploymentStrategyType =
// RollingUpdate.
// ---
// TODO: Update this to follow our convention for oneOf, whatever we decide it
// to be.
RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"`
}

View File

@@ -29,11 +29,24 @@ import (
// ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use
// with apply.
//
// ReplicaSet ensures that a specified number of pod replicas are running at any given time.
type ReplicaSetApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:",inline"`
metav1.TypeMetaApplyConfiguration `json:""`
// If the Labels of a ReplicaSet are empty, they are defaulted to
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *ReplicaSetSpecApplyConfiguration `json:"spec,omitempty"`
Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"`
// Spec defines the specification of the desired behavior of the ReplicaSet.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec *ReplicaSetSpecApplyConfiguration `json:"spec,omitempty"`
// Status is the most recently observed status of the ReplicaSet.
// This data may be out of date by some window of time.
// Populated by the system.
// Read-only.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"`
}
// ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with
@@ -47,29 +60,14 @@ func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration {
return b
}
// ExtractReplicaSet extracts the applied configuration owned by fieldManager from
// replicaSet. If no managedFields are found in replicaSet for fieldManager, a
// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// ExtractReplicaSetFrom extracts the applied configuration owned by fieldManager from
// replicaSet for the specified subresource. Pass an empty string for subresource to extract
// the main resource. Common subresources include "status", "scale", etc.
// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API.
// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow.
// ExtractReplicaSetFrom provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractReplicaSet(replicaSet *appsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {
return extractReplicaSet(replicaSet, fieldManager, "")
}
// ExtractReplicaSetStatus is the same as ExtractReplicaSet except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractReplicaSetStatus(replicaSet *appsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {
return extractReplicaSet(replicaSet, fieldManager, "status")
}
func extractReplicaSet(replicaSet *appsv1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) {
func ExtractReplicaSetFrom(replicaSet *appsv1.ReplicaSet, fieldManager string, subresource string) (*ReplicaSetApplyConfiguration, error) {
b := &ReplicaSetApplyConfiguration{}
err := managedfields.ExtractInto(replicaSet, internal.Parser().Type("io.k8s.api.apps.v1.ReplicaSet"), fieldManager, b, subresource)
if err != nil {
@@ -82,6 +80,33 @@ func extractReplicaSet(replicaSet *appsv1.ReplicaSet, fieldManager string, subre
b.WithAPIVersion("apps/v1")
return b, nil
}
// ExtractReplicaSet extracts the applied configuration owned by fieldManager from
// replicaSet. If no managedFields are found in replicaSet for fieldManager, a
// ReplicaSetApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// replicaSet must be a unmodified ReplicaSet API object that was retrieved from the Kubernetes API.
// ExtractReplicaSet provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
func ExtractReplicaSet(replicaSet *appsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {
return ExtractReplicaSetFrom(replicaSet, fieldManager, "")
}
// ExtractReplicaSetScale extracts the applied configuration owned by fieldManager from
// replicaSet for the scale subresource.
func ExtractReplicaSetScale(replicaSet *appsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {
return ExtractReplicaSetFrom(replicaSet, fieldManager, "scale")
}
// ExtractReplicaSetStatus extracts the applied configuration owned by fieldManager from
// replicaSet for the status subresource.
func ExtractReplicaSetStatus(replicaSet *appsv1.ReplicaSet, fieldManager string) (*ReplicaSetApplyConfiguration, error) {
return ExtractReplicaSetFrom(replicaSet, fieldManager, "status")
}
func (b ReplicaSetApplyConfiguration) IsApplyConfiguration() {}
// WithKind sets the Kind field in the declarative configuration to the given value

View File

@@ -26,12 +26,19 @@ import (
// ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use
// with apply.
//
// ReplicaSetCondition describes the state of a replica set at a certain point.
type ReplicaSetConditionApplyConfiguration struct {
Type *appsv1.ReplicaSetConditionType `json:"type,omitempty"`
Status *corev1.ConditionStatus `json:"status,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
// Type of replica set condition.
Type *appsv1.ReplicaSetConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status *corev1.ConditionStatus `json:"status,omitempty"`
// The last time the condition transitioned from one status to another.
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason *string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
Message *string `json:"message,omitempty"`
}
// ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with

Some files were not shown because too many files have changed in this diff Show More