Compare commits

...

2911 Commits

Author SHA1 Message Date
Kubernetes Publisher
a21b32978c Update dependencies to v0.35.2 tag 2026-02-27 04:23:44 +00:00
Kubernetes Publisher
2d83546256 Merge remote-tracking branch 'origin/master' into release-1.35
Kubernetes-commit: b5f0a8229dd6ce88c2364257acb65d5875706b14
2025-12-05 03:34:45 +00:00
Kubernetes Publisher
56b4af2aeb 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 06:29:44 +00:00
Kubernetes Publisher
891f94c690 Merge remote-tracking branch 'origin/master' into release-1.35
Kubernetes-commit: fc0159905536cd41e3d2a3ac8fcbd905d1bc7c3f
2025-12-04 21:37:05 +00:00
Kubernetes Publisher
65ffe044e5 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:45:12 +00:00
Lukasz Szaszkiewicz
2fe4ac239c 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
171ef8cd00 Use transformer in consistency checker
Kubernetes-commit: 91368adbb556286942d996c60ab6cc39306415b7
2025-11-26 15:19:00 -05: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
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
7cf6a05732 Add unit tests for Data Consistency Detector
Kubernetes-commit: 76da8d6de027a4bf62601d45b8d72f8fa627ab5c
2025-07-28 13:53:34 -04:00
Valerian Roche
f466f58eea [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
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
Kubernetes Publisher
da11948805 Merge pull request #130653 from yliaog/master
kubelet and scheduler for extended resource backed by DRA

Kubernetes-commit: 1b273b385e0ec817167040ec2b75cb7fdda105da
2025-07-29 22:51:22 +00:00
yliao
3b7d818a7f extended resource backed by DRA: codegen
Kubernetes-commit: 3068b60b830fb77694300c2274144de13a220481
2025-07-17 16:45:05 +00:00
Kubernetes Publisher
bb115818ba Merge pull request #130160 from KobayashiD27/dra-device-binding-conditions
Implement DRA Device Binding Conditions (KEP-5007)

Kubernetes-commit: e2ab84070896a8ed5b703b015522326d44597400
2025-07-29 14:53:08 +00:00
Kobayashi,Daisuke
9999d6448a KEP-5007 DRA Device Binding Conditions: Run make update
Kubernetes-commit: ac81b829e4a1a26e11b5eb058b754b3fc621b0aa
2025-07-29 11:34:03 +00:00
Kubernetes Publisher
f78361a647 Merge pull request #132942 from thockin/kyaml
Add KYAML support to kubectl

Kubernetes-commit: 1451dd1b0873e801e082f3a06a52685bcd68dcac
2025-07-25 02:49:18 +00:00
Kubernetes Publisher
8b03d65abb Merge pull request #132632 from sdowell/gc-rv-race
fix: add RV check on GC delete calls

Kubernetes-commit: a5d8ab60efe08062bdf065646f200ec83d4278d8
2025-07-25 02:49:16 +00:00
Kubernetes Publisher
bce2be2f20 Merge pull request #132642 from yuanwang04/restart-rules
Implement container restart policy rules

Kubernetes-commit: 26045b2fab22857c5b8a836ad709df717637491a
2025-07-25 02:49:15 +00:00
Kubernetes Publisher
6314d905de Merge pull request #131549 from carlory/KEP-3751-GA
[Kep-3751] Promote VolumeAttributesClass to GA

Kubernetes-commit: 7912e5fd677226e4ab18a1940aa8c91bac816997
2025-07-25 02:49:13 +00:00
Kubernetes Publisher
d4f2d5b8cc Merge pull request #132935 from benluddy/cbor-bump-custom-marshalers
KEP-4222: Adopt text and JSON transcoding support for CBOR.

Kubernetes-commit: dfc0998baa4d6c2cd630aa3c5b8def4e9b1fcd8e
2025-07-24 22:49:06 +00:00
Kubernetes Publisher
f4919f808e Merge pull request #133171 from p0lyn0mial/upstream-fake-metadata-client-opts-watch
client-go/metadata/fake: sets opts.Watch to true

Kubernetes-commit: 3a99a64438d7f15e170889181f93bb1dc48c4888
2025-07-24 18:49:18 +00:00
Tim Hockin
38777006cd Re-vendor sigs.k8s.io/yaml @ v1.6.0
Kubernetes-commit: 8182a27f3b0769cefe1bcebfb938a7bafd51c88e
2025-07-24 11:46:03 -07:00
Mayuka Channankaiah
753cfe1811 client-go, kubectl: Replace deprecated ErrWaitTimeout with recommended method (#132718)
* client-go: Replace depracted ErrWaitTimeout with recommended method

* Fix UT and Integration tests

* IT test

Kubernetes-commit: ffe306d67958297202e9492ea644b42c0e7e694d
2025-07-24 20:26:27 +05:30
Kubernetes Publisher
764374b324 Merge pull request #132706 from pohly/dra-api-v1
DRA API: graduation to GA

Kubernetes-commit: 254a46943aab33017b581a7e9e393f3b720feef8
2025-07-24 14:49:11 +00:00
Lukasz Szaszkiewicz
fcbe18a69a client-go/metadata/fake: sets opts.Watch to true
Kubernetes-commit: 12d67506661cfc3e16a769ded834f5d08dba40c9
2025-07-24 13:50:05 +02:00
Patrick Ohly
14fa3d1f20 DRA API: s/v1beta2/v1/ and generated files
Kubernetes-commit: 4e592f6c145bb322786aa77ff2d25d8fe370b893
2025-07-03 13:29:02 +02:00
Patrick Ohly
dce90c45af DRA API: verbatim copy v1beta2 -> v1
Kubernetes-commit: 1f2f433f76dbc28d1fd6602f96e6dd871893601b
2025-07-03 12:11:01 +02:00
Kubernetes Publisher
5f1f878e5c Merge pull request #132558 from HirazawaUi/Implement-4762
KEP-4762: Allows setting any FQDN as the pod's hostname

Kubernetes-commit: 6ef2215eb7e4227ca762ad1c2d462f109b37292d
2025-07-24 02:49:01 +00:00
Jordan Liggitt
70f53edfc8 Make dynamic and metadata clients plumb DeleteOptions
Kubernetes-commit: 84f6d742c5b09480fc3199f9995effb898c60099
2025-07-01 19:38:11 -04:00
Yuan Wang
3d6860cb41 Add container restart rules to API
Kubernetes-commit: af595a44aefcbf01dfad82c40af2e97346c938d9
2025-07-01 02:33:00 +00:00
HirazawaUi
8d8a532ad4 Add the HostnameOverride field to the Pod API
Kubernetes-commit: 8b3814c4ab8971dc4c1bef32457a595c5a6eaa63
2025-06-27 19:41:18 +08:00
Kubernetes Publisher
06fcc8a075 Merge pull request #133124 from p0lyn0mial/upstream-fake-dynamic-client-opts-watch
client-go/dynamic/fake: sets opts.Watch true

Kubernetes-commit: c2be2cac02d07edc01ea7e6c2f789992e6c1f96f
2025-07-23 06:28:49 +00:00
Bing Hongtao
a052c014c7 KEP-3721: Support for env files (#132626)
* Add FileKeyRef field and struct to the Pod API

* Add the implementation code in the kubelet.

* Add validation code

* Add basic functionality e2e tests

* add codes for drop disabled pod fields

* update go.mod

Kubernetes-commit: 6f3b6b91f08585727784620285f990782901572f
2025-07-23 06:28:49 +00:00
Lukasz Szaszkiewicz
aca441f80e client-go/dynamic/fake: sets opts.Watch true
Kubernetes-commit: b97decb7d918083e97beb7ff4e5e2052b6e63220
2025-07-22 15:58:22 +02:00
Kubernetes Publisher
ec5b832e60 Merge pull request #128010 from ahmedtd/pod-certificates-types
Pod Certificates: Preliminary implementation of KEP-4317

Kubernetes-commit: cc674e7470cc1e98145ce6f915469ff6f748f443
2025-07-22 05:10:00 +00:00
Kubernetes Publisher
b9f61132f4 Merge pull request #133101 from isimluk/cleanup-testfiles
ci: client-go: test should cleanup their temp dir

Kubernetes-commit: 9636317da03df9e8e71eab9327854c0ec8dc9d7c
2025-07-22 01:09:48 +00:00
Kubernetes Publisher
8ff0be58e3 Merge pull request #133103 from isimluk/remove-unnecessary-test-harness
ci: remove unnecessary test harness

Kubernetes-commit: b4de8bc1b1095d8f465995521a6986e201812342
2025-07-21 10:04:28 -07:00
Šimon Lukašík
f4943db564 ci: remove unnecessary test harness
This TestMain() is equivalent to not having any TestMain() at all.

This is the only such instance in whole repo.

Kubernetes-commit: 7e5aafcb164db5135a4d18ee4661c8813f2cc908
2025-07-21 12:59:52 +02:00
Šimon Lukašík
2d84553721 ci cleanup: make sure to remove test KUBECONFIGs
Calling os.Exit() skipped the

    `defer os.RemoveAll(tmp)`

above and thus dangling files & dirs would appear in their $TMPDIR.

Since go1.15 we can safely remove os.Exit() from TestMain() function.
As this exact issue was common enough so that go1.15 changed[1] the API of
TestMain to no longer require os.Exit to be called.

Reproducer:

    $ (cd staging/src/k8s.io/client-go; go test ./tools/clientcmd)
    $ ls -d /tmp/testkubeconfig*
    /tmp/testkubeconfig1015943687

[1]: https://go-review.googlesource.com/c/go/+/219639

Kubernetes-commit: 457df1cf9817e29381609fbf2d85854a6b6a52ac
2025-07-21 10:46:37 +02:00
Taahir Ahmed
0d5cb31872 Pod Certificates: make update
Change-Id: Ib258c1f3bf238f41cfa1d6de8e8d0de5b8379a06

Kubernetes-commit: 6d4000f844e22a13bc4f9cb3932ea1ab50216651
2025-07-21 05:41:20 +00:00
Kubernetes Publisher
5f8e38e02c Merge pull request #133030 from PatrickLaabs/132749-timerptr
chore: replacing timer ptr with ptr.To

Kubernetes-commit: 792061af02da263576b9b0676c331e28b93d3943
2025-07-19 05:09:29 +00:00
Kubernetes Publisher
be36413bbc Merge pull request #132821 from cici37/mapBeta
[KEP-3962]Promote MutatingAdmissionPolicy to Beta

Kubernetes-commit: 3dd0e86190cc023a98f59d48d75efde08a27fd82
2025-07-18 01:09:28 +00:00
Kubernetes Publisher
fa10fa2dea Merge pull request #132849 from kei01234kei/update_lease_resource_version_before_update_lease
Prevent the failure of releasing the lock by updating the resource version in case of the resource conflict

Kubernetes-commit: 793191529651ab5c9e49914f19e9bdf85d412218
2025-07-17 17:09:21 +00:00
Kubernetes Publisher
715e46ed57 Merge pull request #133020 from pohly/apimachinery-list-map-keys
support optional listMapKeys in server-side apply

Kubernetes-commit: d33af7f7efc7ff5d8813a85290189883167a5226
2025-07-17 17:09:20 +00:00
Keisuke Ishigami
e36950929b set the timeout to Get method
Kubernetes-commit: 300c7b815a2eb9598c53c0b386715650f5052804
2025-07-17 22:33:32 +09:00
PatrickLaabs
d4f7b29b04 chore: replacing timer ptr with ptr.To
Kubernetes-commit: 2b13b87e609b83f453f7a160d9cae8a15c0e64f2
2025-07-17 15:11:55 +02:00
Kubernetes Publisher
a21e7a8bf0 Merge pull request #131293 from skitt/typo-watchAction
Typo fix: watchActcion

Kubernetes-commit: 051cf278cf7b1d8784c6c6ca39bd8ab6c4a8c02f
2025-07-17 09:09:20 +00:00
Jordan Liggitt
d1ceeb33a0 sigs.k8s.io/structured-merge-diff/v6 v6.3.0
Kubernetes-commit: 4d34975a46658efd90274c5fe05d46732e04ca67
2025-07-16 16:57:41 -04:00
Kubernetes Publisher
f78427e367 Merge pull request #132871 from dims/bump-k8s.io/kube-openapi-to-latest-SHA-f3f2b991d03b
Bump k8s.io/kube-openapi to latest SHA (f3f2b991d03b) and sigs.k8s.io/structured-merge-diff/{v4 => v6}

Kubernetes-commit: 48e04d0d6c43cfc4729857775252b89b68d65b87
2025-07-15 09:09:29 +00:00
Kubernetes Publisher
34f52c14ea Merge pull request #131200 from ntnn/kcp3350-client-go
Update docs on workqueue to match implementation

Kubernetes-commit: c34c70b2db75efc113402805d0a3bff391d13a79
2025-07-15 05:09:06 +00:00
Kubernetes Publisher
f84a70ae3c Merge pull request #132928 from p0lyn0mial/upstream-watchlist-reflector-table-unsupported
reflector: detects unsupported meta.Table gvks for watchlist

Kubernetes-commit: 1127e027898e12b4dde8694660da2fbf81c7028a
2025-07-14 21:09:13 +00:00
Keisuke Ishigami
be4c8bc002 fix test
Kubernetes-commit: 9a7dddf5a713e109418f3726514fdf60246ada3b
2025-07-15 01:07:43 +09:00
Keisuke Ishigami
3633ea23d3 chore
Kubernetes-commit: 09ec6f744833fb72a319013ae25cf0286cdd125e
2025-07-15 01:07:25 +09:00
Keisuke Ishigami
b62c1cc29f add test which checks release method calls Get
Kubernetes-commit: f20be4c094cdc037e54d755dcd6292991cee701d
2025-07-14 23:17:19 +09:00
Lukasz Szaszkiewicz
c1d15a3638 reflector: detects unsupported meta.Table gvks for watchlist
Kubernetes-commit: da7c55e0d2f962c8493864a069be5acb8902579f
2025-07-14 13:13:44 +02:00
Kubernetes Publisher
3a4ad9c658 Merge pull request #132878 from ylink-lfs/chore/int32ptr_removal
chore: replace int32Ptr usage with ptr.To

Kubernetes-commit: 20114b2090791e191eff4417dfd56f50252fd714
2025-07-13 05:08:51 +00:00
ylink-lfs
81caec87ee chore: replace int32Ptr usage with ptr.To
Kubernetes-commit: e0f9914ef726bd5bcafcdadf5a6a0a6e92d9a885
2025-07-11 09:11:04 +08:00
Davanum Srinivas
f4d210639b Bump k8s.io/kube-openapi to latest SHA (f3f2b991d03b)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: ebc1ccc491c944fa0633f147698e0dc02675051d
2025-07-10 09:21:52 -04:00
Nelo-T. Wallus
6116f46372 Update docs on shutdown and draining
Kubernetes-commit: 67aaa956da3e6110e8155cc08539c488fc5e1298
2025-07-09 21:43:30 +02:00
Keisuke Ishigami
500bfe00cd Prevent the failure of releasing the lock by updating the resource version in case of a resource conflict
Kubernetes-commit: 271233a62aeab02eb0f7a6567d3ddba6d09a4f21
2025-07-10 02:59:21 +09:00
Kubernetes Publisher
5439ef7b0c Merge pull request #132775 from ash2k/use-sets-type
Use `sets.Set` instead of a local impl

Kubernetes-commit: 1d392729b52129886d8ed286282be8f6dd36fa9f
2025-07-09 01:08:32 +00:00
Kubernetes Publisher
879be6242f Merge pull request #131203 from xuzhenglun/fix-ws-race
make sure all streams are created before start demux websocket

Kubernetes-commit: 2dfb3e4ffd31c8b6b9f7c55328bcf8c7da53aa68
2025-07-08 17:08:40 +00:00
Cici Huang
6d6ff9fbae Auto gen
Kubernetes-commit: 6cd00cdcba01f8d6873a3c94a4e997e1e9329187
2025-07-08 13:34:43 +00:00
xuzhenglun
2f016580ef make sure all streams are created before starting demux websocket
Kubernetes-commit: 3379d5ac4b6a1afbbaead06689a8584ce546a275
2025-07-08 18:31:30 +08:00
Mikhail Mazurskiy
76df3ebd2e Use sets.Set instead of a local impl
Kubernetes-commit: d193ffe57ffbbbc07dd49993e4f06ab3b50b2317
2025-07-07 19:21:39 +10:00
Kubernetes Publisher
6c24674413 Merge pull request #132005 from kei01234kei/handle_context_in_processloop
Handle context in the process loop

Kubernetes-commit: 43a30ef17b378ea460bb34d47f16047da50bfce2
2025-07-07 01:08:46 +00:00
Kubernetes Publisher
660181394a Merge pull request #132699 from PatrickLaabs/132086-csr
chore: depr. pointer pkg replacement for the csr

Kubernetes-commit: de74ab716ef1014206427622d2070482dc304cc6
2025-07-03 21:08:33 +00:00
Kubernetes Publisher
7d9d3036fb Merge pull request #132698 from PatrickLaabs/132086-reflector
chore: depr. pointer pkg replacement for the reflector

Kubernetes-commit: 0ce9a03285b8d689e0072b06a42ffeae77fc416c
2025-07-03 21:08:31 +00:00
PatrickLaabs
286cc8368b chore: depr. pointer pkg replacement for the csr
Kubernetes-commit: 6c3146e3557e1de3d617f49d0b64ee380a42a8b1
2025-07-03 11:34:13 +02:00
PatrickLaabs
735f105e54 chore: depr. pointer pkg replacement for the reflactor
Kubernetes-commit: 9345552274d2999c59a609488d0673edbb3a246e
2025-07-03 11:27:00 +02:00
Kubernetes Publisher
2cfeed63b2 Merge pull request #132675 from dims/bump-sigs-k8s-io-json-no-code-changes
Bump sigs.k8s.io/json to latest - no code changes

Kubernetes-commit: e47ac3eb6faa97874658dc281c72b5623f994801
2025-07-03 01:08:29 +00:00
Kubernetes Publisher
783cf83ee3 Merge pull request #132677 from dims/update-github.com/emicklei/go-restful/v3-to-v3.12.2
Update github.com/emicklei/go-restful/v3 to v3.12.2

Kubernetes-commit: 305c0e06c99ff9df013edd804294217a04e4dd31
2025-07-02 21:08:39 +00:00
Arthur Befumo
6980728f27 Fix AuthInfo godoc for Token / TokenFile precedence (#132659)
* Fix AuthInfo godoc for Token / TokenFile precedence

* nit

* update

Kubernetes-commit: 33cd2e1ba08bf6b936c0c2c29bcabe502ce75851
2025-07-02 11:55:24 -04:00
Kubernetes Publisher
0746d1b732 Merge pull request #132676 from dims/bump-go.yaml.in/yaml/v3-to-v3.0.4
Bump go.yaml.in/yaml/v3 to v3.0.4

Kubernetes-commit: 01c03ae9cf7b1371c8bc2bdf12d9244e63e83750
2025-07-02 17:08:47 +00:00
Davanum Srinivas
cb8249f035 Update github.com/emicklei/go-restful/v3 to v3.12.2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: b44b0fbf1299c6821033076352b91914d2efef67
2025-07-02 08:00:43 -04:00
Davanum Srinivas
cec6959636 Bump go.yaml.in/yaml/v3 to v3.0.4
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 58e620cc4403d30f9fb6aab245cfb47db17957de
2025-07-02 07:37:06 -04:00
Davanum Srinivas
e5813734c1 Bump sigs.k8s.io/json to latest - no code changes
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 00f8cbae6b8fd3799a1a044abcefdbb572d35b27
2025-07-02 07:32:24 -04:00
Kubernetes Publisher
b254476a92 Merge pull request #132654 from Jefftree/b-openapi
Bump kube-openapi

Kubernetes-commit: db49c25956df36c777213251c4a47d6d9ee1c5ea
2025-07-01 21:08:27 +00:00
Jefftree
059a564a92 Update vendor
Kubernetes-commit: d04ee27c98ba91680ac6c6a8ade9e33d7ee44569
2025-07-01 15:23:58 +00:00
Jefftree
599cc9f395 pin kube-openapi to v0.0.0-20250628140032-d90c4fd18f59
Kubernetes-commit: b41d375b8881f25ff5fe7775b4dedaba1eaa3f02
2025-07-01 15:21:22 +00:00
Kubernetes Publisher
5e8db78e04 Merge pull request #131799 from DataDog/client-go-reflector-transformer
[client-go #1415] Use transformer from provided store within internal stores in reflector to limit memory usage bursts

Kubernetes-commit: 3f0a1c6c7f02f33649e58996408b1501fce3c0ee
2025-06-30 17:29:37 +00:00
Kubernetes Publisher
c2ce9a8b31 Merge pull request #132584 from alvaroaleman/fix-asfafs
Applyconfiguration-Gen: Only the root AC should implement runtime.ApplyConfiguration

Kubernetes-commit: b361d91a6f789d89c1b125d8fc8838adbb91d5c5
2025-06-28 01:29:33 +00:00
Kubernetes Publisher
267615c1eb Merge pull request #132438 from dims/golangci-plugin-for-sorting-feature-gates
golangci plugin for sorting feature gates

Kubernetes-commit: 2e02a0088574d126c6d4a82ea472c7cb6c3252f5
2025-06-27 21:29:30 +00:00
Alvaro Aleman
3d73750dfc Re-generate applyconfigurations
Kubernetes-commit: 7d5ab75627716d57f8937a7eb0f453f420cb766d
2025-06-27 14:30:38 -04:00
Valerian Roche
71776a84bd [client-go #1415] Use transformer from provided store within internal stores in reflector to limit memory usage bursts
Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>

Kubernetes-commit: 585ed0a5cb378e794e4775bc846d5309ca65f2c6
2025-06-26 22:00:41 -04:00
Keisuke Ishigami
d9cda8802e resolve linter check
Kubernetes-commit: 5cca03792748714547c39330ac9cb8cb9c7c60ae
2025-06-27 00:49:02 +09:00
Keisuke Ishigami
fc748aa158 Revert "pop respects the context"
This reverts commit 1c33d98762511c10f89c40358a1935250b03b0c8.

Kubernetes-commit: 74af3ac8ad1122528bb9971c3a2d282eff529beb
2025-06-26 23:49:34 +09:00
Keisuke Ishigami
bc19363821 Revert "modify tests"
This reverts commit 2cd5dbbdaab98020b37df7125f622db7a6dd885a.

Kubernetes-commit: 2dcce93336e52eb16aab595fcc75254f4abfa5ae
2025-06-26 23:49:25 +09:00
Davanum Srinivas
40f8130723 Ensure all the files have the updated sorting
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: d50e1a684cd53950210041b875ae3a41dac05c33
2025-06-25 08:21:01 -04:00
Kubernetes Publisher
9582881101 Merge pull request #132357 from dims/drop-usage-of-forked-copies-of-goyaml.v2-and-goyaml.v3
Drop usage of forked copies of goyaml.v2 and goyaml.v3

Kubernetes-commit: c1afec6a0b15ca1ed853c1321ac2c972488bf5b8
2025-06-25 17:29:11 +00:00
Kubernetes Publisher
cf3a9d7f2e Merge pull request #132504 from jpbetz/name-formats
Introduce OpenAPI format support for k8s-short-name and k8s-long-name

Kubernetes-commit: 1d932bd6cc951b9182d07d701946aebaf667df94
2025-06-25 17:29:09 +00:00
Davanum Srinivas
11885e75d4 switch to latest sigs.k8s.io/yaml v1.5.0 (run update-gofmt.sh as well)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: c5b4b133ce3252ee19b7167eb69a99d88fdefda8
2025-06-25 08:03:06 -04:00
Lukasz Szaszkiewicz
1785b5afec client-go/reflector: stop exposing UseWatchList (#132453)
* client-go/reflector: stop exposing UseWatchList

* apiserver/cacher: stop setting reflector.UseWatchList

* test/integration/watchlist: fix TestReflectorWatchListFallback

Kubernetes-commit: b8b3984874e930c92057589fd1a7668dbdffc117
2025-06-25 13:04:29 +02:00
Ben Luddy
39c7041873 Bump to github.com/fxamacker/cbor/v2 v2.9.0.
Kubernetes-commit: 917659269af60f8ca960deeb0991df93e5ad1635
2025-06-24 14:25:43 -04:00
Kubernetes Publisher
bb7300621b Merge pull request #132255 from likakuli/feat-nothingfastreturn
feat: optimize ListAll and ListAllByNamespace to return directly when nothing to select

Kubernetes-commit: c379296bd1b29ee8e890aff393959398ac905b2f
2025-06-24 17:29:33 +00:00
Joe Betz
6a256de8a6 Bump to latest kube-openapi
Kubernetes-commit: dc323756cea2d1ebe32d7acb5a14a1769c14486f
2025-06-24 09:24:27 -04:00
Keisuke Ishigami
00429ab356 modify tests
Kubernetes-commit: 2cd5dbbdaab98020b37df7125f622db7a6dd885a
2025-06-14 22:04:22 +09:00
Keisuke Ishigami
d56ed5816f pop respects the context
Kubernetes-commit: 1c33d98762511c10f89c40358a1935250b03b0c8
2025-06-14 21:59:56 +09:00
likakuli
d158bb37c5 feat: optimize ListAll and ListAllByNamespace to return directly when nothing to select
Signed-off-by: likakuli <1154584512@qq.com>

Kubernetes-commit: 5a7e04b6cc70bd7624536e09b4e977e8f25cb476
2025-06-12 17:33:32 +08:00
Kubernetes Publisher
41574813b1 Merge pull request #132194 from alvaroaleman/local0dev
Add an interface that all apply configurations implement

Kubernetes-commit: 7b04d7faefcc28a90fb092e789abda467b086403
2025-06-19 11:27:34 +00:00
Alvaro Aleman
97456eac24 Re-Generate applyconfigs
Kubernetes-commit: a5d42f5693973c11ca911863a0fd6cc2f2a0b4a6
2025-05-28 17:35:29 -04:00
Kubernetes Publisher
212c32462b Merge pull request #132350 from p0lyn0mial/upstream-rm-data-consistency-checker-for-list-requests
client-go/util/consistencydetector: remove CheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: c0cb737a9e198b60dfac235ca77edee07fc7c45d
2025-06-17 10:50:59 -07:00
Lukasz Szaszkiewicz
16465459fa client-go/util/consistencydetector: move IsDataConsistencyDetectionForWatchListEnabled
Kubernetes-commit: 32fcaf14067c3dc054c887f5060bdb3325965014
2025-06-17 15:05:46 +02:00
Lukasz Szaszkiewicz
a7dabba123 client-go/util/consistencydetector: remove CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: bad49390493c10e5288ecdd5d81dc6c16f2b7520
2025-06-17 13:37:57 +02:00
Kubernetes Publisher
10fe56d6e0 Merge pull request #132221 from dims/new-cmp-diff-impl
New implementation for `Diff` (drop in replacement for `cmp.Diff`)

Kubernetes-commit: 3e39d1074fc717a883aaf57b966dd7a06dfca2ec
2025-06-17 03:31:48 +00:00
Kubernetes Publisher
62b0aba8c9 Merge pull request #132285 from p0lyn0mial/upstream-watchlist-rest-client-rm
rest client: remove support for API streaming 

Kubernetes-commit: c6777da47d1f9e93585cf23363da5c393eb7011a
2025-06-13 06:43:11 -07:00
Lukasz Szaszkiewicz
65a2176a48 client-go/rest: rm watchlist
Kubernetes-commit: 6a37976848b43dae9aa82854b5c5d321f148bb0b
2025-06-13 10:48:45 +02:00
Kubernetes Publisher
03836b3bdc Merge pull request #132257 from p0lyn0mial/upstream-watchlist-typed-client-rm
typed client: remove support for API streaming

Kubernetes-commit: 41dc045529a306932165684450cfe89d160fe8c9
2025-06-13 14:12:13 +00:00
Kubernetes Publisher
4e82e68412 Merge pull request #132269 from dims/update-to-latest-github.com/modern-go/reflect2
Update to latest github.com/modern-go/reflect2

Kubernetes-commit: d55b119d34883bbad2a3436dcb6c62339d963031
2025-06-12 20:00:49 +00:00
Kubernetes Publisher
87b1ff7794 Merge pull request #132000 from pohly/dra-api-alpha3-removal
DRA API: remove obsolete types from v1alpha3

Kubernetes-commit: 7e94ec9eacc2996e0e5b00af003276ae751915bc
2025-06-12 20:00:47 +00:00
Davanum Srinivas
25fa1fdef2 Update to latest github.com/modern-go/reflect2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 3908550c0dc189cfa9de38a84bee508fa0659463
2025-06-12 11:20:39 -04:00
Kubernetes Publisher
d33a6ba860 Merge pull request #132229 from p0lyn0mial/upstream-watchlist-dynamic-client-rm
dynamic client: remove support for API streaming

Kubernetes-commit: 5abd2ac2e3900165d87c6078f55afd98ae6b085a
2025-06-12 08:00:42 +00:00
Lukasz Szaszkiewicz
3fab93670b client-go/gentype: remove watchlist
Kubernetes-commit: 2f943293ed80e329141a0b8ab8ce093416c456c7
2025-06-11 13:43:37 +02:00
Lukasz Szaszkiewicz
6708db95c9 client-go/dynamic: rm watchlist
Kubernetes-commit: 3038f3530d1b35d896826673acdae0bd55bd769c
2025-06-11 09:45:09 +02:00
Davanum Srinivas
f21dd69478 Add a replacement for cmp.Diff using json+go-difflib
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 03afe6471bdbf6462b7035fdaae5aa0dd9545396
2025-06-10 23:08:41 -04:00
Kubernetes Publisher
c828854c20 Merge pull request #131670 from pohly/client-go-watch-context-comment
client-go: call out WithContext inconsistency

Kubernetes-commit: 3d699ce0ecd9b2abff3ee98c1dcbaa8e073ac5cd
2025-06-11 00:01:06 +00:00
Kubernetes Publisher
9638111dc7 Merge pull request #132149 from p0lyn0mial/upstream-watchlist-meta-client-rm
metadata client: remove support for API streaming

Kubernetes-commit: 3aa448625c2d2f10275c608f54b88074ef6aeafa
2025-06-09 12:01:07 +00:00
Kubernetes Publisher
ce2092b6b1 Merge pull request #132176 from dims/tolerate-newer-golang/oauth2-version
tolerate newer golang/oauth2 version in TestTokenSourceTransportRoundTrip

Kubernetes-commit: 34cea34c7f1530edbaaeb0524c16885d7894a7ec
2025-06-08 20:38:22 -07:00
Davanum Srinivas
f7066acf25 tolerate newer golang/oauth2 version
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 32aa52adf667d7873eaed8094fc5489a93517e38
2025-06-07 19:52:48 -04:00
Kubernetes Publisher
12398ddf4e Merge pull request #132103 from nojnhuh/typed-ring-buffer
Replace queue.FIFOs with k8s.io/utils/buffer.Ring

Kubernetes-commit: 5090812df4fb6cf09a9181635d90c2e154eab8cc
2025-06-06 20:03:05 +00:00
Lukasz Szaszkiewicz
e6fed26045 client-go/metadata: rm watchlist
Kubernetes-commit: a38ad3a2c67290e0bc3dcda17f571ad16573714e
2025-06-06 16:15:43 +02:00
Kubernetes Publisher
7c500240b1 Merge pull request #131632 from DerekFrank/custom-lease-metadata
feat: Allow leases to have custom labels set when a new holder takes the lease

Kubernetes-commit: 3eebe671eaccc63062e002ddc09fa24623ac30e6
2025-06-06 00:09:29 +00:00
Jon Huhn
e3f8badef8 Update k8s.io/utils for new generic ring buffer
Kubernetes-commit: 8cdbbf5cdaef7e37cfd432e9044aa52f4d42adcd
2025-06-04 12:09:53 -05:00
Kubernetes Publisher
647bbbe859 Merge pull request #132039 from alvaroaleman/fix-w-unstructured
FieldManagedObjectTracker: Fix to work with unstructured

Kubernetes-commit: fd53f7292c7d5899135fddd928c0dc3844126820
2025-06-03 01:42:04 +00:00
Alvaro Aleman
81ecec406a FieldManagedObjectTracker: Fix to work with unstructured
Prior to this patch, this fails because the skipnonappliedfieldmanager
uses the `objectcreater` (aka `*runtime.Scheme`) to create a new object
for which it never sets the GVK. In the case of
`*unstructured.Unstructured`, the GVK can not be derived from the object
itself so the operation would subsequently fail [here][0] with an
```
Object 'Kind' is missing in 'unstructured object has no kind'
```

error. Fix this by explicitly setting the GVK in case of unstructured.

[0]: 02eb7d424a/staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/structuredmerge.go (L98)

Kubernetes-commit: dbdd6a3b4358d91a064de9c0f01d3050e606d553
2025-05-30 15:30:33 -04:00
Kubernetes Publisher
e9ca982cec Merge pull request #132004 from alvaroaleman/fix-fasf
ManagedFieldsObjectTracker: Reload scheme

Kubernetes-commit: c5c87bde8f0ff405f89ead5aff9f609b42e29b55
2025-05-30 01:41:51 +00:00
Kubernetes Publisher
26cda34605 Merge pull request #132022 from Jefftree/client-go-template
Update client-go PR template

Kubernetes-commit: fc0e3bf957808d08da103d824164b993ea763556
2025-05-30 01:41:49 +00:00
Jeffrey Ying
d90ce655d4 Update client-go template with backticks
Kubernetes-commit: b9496d1a9d7a2aea71603896cca40374a98f1aed
2025-05-29 16:18:47 -04:00
Jefftree
2dd7d946ba Update client-go PR template
Kubernetes-commit: d70fcf731bd302eda3f58c96cdb3f3cc7bfa406f
2025-05-29 20:13:56 +00:00
Keisuke Ishigami
03728c1ebe handle context in process loop
Kubernetes-commit: f67d30b3529ea970dd5fd069eaddfc7f61d74169
2025-05-29 00:34:43 +09:00
Patrick Ohly
d267bacbd5 DRA API: remove obsolete types from v1alpha3
The v1alpha3 version is still needed for DeviceTaintRule, but the rest of the
types and most structs became obsolete in v1.32 when we introduced v1beta1 and
bumped the storage version to v1beta1.

Removing them now simplifies adding new features because new fields don't need
to be added to these obsolete types. This could have been done already in 1.33,
but wasn't to minimize disrupting on-going work.

Kubernetes-commit: 10de6780cf6b24d5115e508606334b81d6634ba6
2025-05-28 12:03:25 +02:00
Kubernetes Publisher
e75871c731 Merge pull request #131642 from pohly/e2e-pod-exec-logging
client-go remotecommand: avoid "unexpected error" log when there is no error

Kubernetes-commit: 460a84a5daef3a8c0f67797aa475c9adfaf0722a
2025-05-26 13:41:58 +00:00
Kubernetes Publisher
433f2064f1 Merge pull request #131825 from yanhuan0802/fix-clean-addIndexers-comment
cleanup: remove error comment of AddIndexers func

Kubernetes-commit: 6407d3b76e248b7d12696d633b99775513b07bd0
2025-05-21 03:36:57 +00:00
Kubernetes Publisher
cd9e9393ec Merge pull request #131840 from pohly/client-go-workqueue-wording
client-go workqueue: clarify parallel reenqueuing

Kubernetes-commit: 148761ce2c309d52722a7125dffda1d5890e9f04
2025-05-20 19:37:07 +00:00
Kubernetes Publisher
e9c99fd4fa Merge pull request #131741 from soltysh/deprecate_preferences
Deprecate kubeconfig's preference field in favor of kuberc

Kubernetes-commit: c40db09a0a2bf8df02be93d7da1912cfa7cbe333
2025-05-20 08:11:18 -07:00
Patrick Ohly
8f2e17a6ba client-go workqueue: clarify parallel reenqueuing
"Is allowed" does not exactly say what happens. Let's be more explicit.

Kubernetes-commit: 772d010665141cf74d4a34af6da08ea4761ce1f8
2025-05-19 08:02:43 +02:00
Maciej Szulik
5334fcaa9c Deprecate kubeconfig's preference field in favor of kuberc
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 8cf5e8db78deb186ef362f64ab779c09e9520156
2025-05-13 13:39:13 +02:00
Kubernetes Publisher
025e06660a Merge pull request #128419 from liggitt/etcd-3.6
etcd 3.6 client update

Kubernetes-commit: 09ca440a450e9103a8f835f598c09237dba6ecbb
2025-05-16 03:37:11 +00:00
Jordan Liggitt
68b411bd5b bump etcd client to 3.6
hack/pin-dependency.sh go.etcd.io/etcd/api/v3 v3.6.0
hack/pin-dependency.sh go.etcd.io/etcd/client/pkg/v3 v3.6.0
hack/pin-dependency.sh go.etcd.io/etcd/client/v3 v3.6.0
hack/pin-dependency.sh go.etcd.io/etcd/pkg/v3 v3.6.0
hack/pin-dependency.sh go.etcd.io/etcd/server/v3 v3.6.0

hack/pin-dependency.sh github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0

hack/update-vendor.sh

Kubernetes-commit: cf0bbf1171e918d5d7ba1d3c83b5f347fc8333b0
2025-05-15 21:19:11 -04:00
Kubernetes Publisher
1308d7c66b Merge pull request #131318 from aojea/lock_servicecidr
Lock MultiCIDRServiceAllocator to default and DisableAllocatorDualWrite to GA

Kubernetes-commit: c96032addd81199453a815c85370d8930b2f1cd3
2025-05-13 19:19:53 +00:00
Patrick Ohly
4e28a08da3 client-go: call out WithContext inconsistency
This raises awareness so that developers hopefully get it right without having to
learn about it from compile errors. It also explains that creating a PR to
fix the naming is not desired.

Kubernetes-commit: f40892f4813f29fc305d59073d2464a1fd7d6fe5
2025-05-08 14:29:21 +02:00
Kubernetes Publisher
996ce6af9b Merge pull request #131616 from jpbetz/typeconverter-cleanup
Reorganize scheme type converter into apimachinery utils

Kubernetes-commit: 7cb2bd78b22c4ac8d9a401920fbcf7e2b240522d
2025-05-08 03:26:44 +00:00
Joe Betz
eff66266b5 generate code
Kubernetes-commit: ce02da8dabaeb7c3e938224254fd42dcdc64b719
2025-05-07 10:10:48 -04:00
Joe Betz
571b9f39e0 Reorganize scheme type converter into apimachinery utils
This removes a dependency from generated applyconfigurations to a testing
package. To do this, the type converter in the testing package has been
moved out to the apimachinery package and the utilities the converter
depend on have been reorganized.

Kubernetes-commit: 4821604f83a6f4764497879b666087ba7cb05060
2025-05-07 10:07:55 -04:00
Patrick Ohly
804ee8c42e client-go remotecommand: avoid "unexpected error" log when there is no error
Normal execution always started to trigger this after adding more logging in
the E2E framework's exec_util.go:

     I0506 21:23:56.781188 6341 exec_util.go:201] unexpected error trying to use websockets for pod exec: <nil>

That the "should fall back" implementation gets called when there is no error
and thus no reason to even consider falling back is odd. Now the execute
implementation checks for nil first.

This is the same approach taken also in the portforward code:
b35c5c0a30/staging/src/k8s.io/client-go/tools/portforward/fallback_dialer.go (L52)

Kubernetes-commit: 35870c480d64a8ae35c0e5839cc40b0115b7328a
2025-05-07 14:51:18 +02:00
Kubernetes Publisher
bf3d45b702 Merge pull request #129150 from huww98/version-comment
remove out-of-date comments about version

Kubernetes-commit: 3dca763acc9c6898e08f762ee71d60aa0a8123ea
2025-05-06 23:20:31 +00:00
Kubernetes Publisher
2d0ad1ac54 Merge pull request #131165 from liggitt/e2e-requesturi
Make Request#RequestURI honor configured context root

Kubernetes-commit: d76b47cc4cd58fcb6544764ea6c1c809ab8fa265
2025-05-06 19:19:44 +00:00
Derek Frank
34f791d2b1 feat: Allow leases to have custom labels set when a new holder has the lease
Kubernetes-commit: 109ae1bacadfa5c8655adb4594762c77b135f446
2025-05-06 10:43:05 -07:00
Kubernetes Publisher
7aa362d5dd Merge pull request #131595 from aojea/utils_fake_clock
update k8s.io/utils to bring fakeClock.Waiters()

Kubernetes-commit: e3e1f80c0110c847acf4381b1790c1c667395010
2025-05-03 03:17:54 +00:00
Antonio Ojea
568f678a04 update k8s.io/utils to bring fakeClock.Waiters()
Change-Id: I7e25338df225c2c27457403fbc2f158d08638f87

Kubernetes-commit: c2c003a71fc52fa79c2fff0109afad58573d0216
2025-05-02 11:21:11 +00:00
Kubernetes Publisher
a566719c94 Merge pull request #130989 from liggitt/creationTimestamp-omitzero
Omit null creationTimestamp

Kubernetes-commit: 01899a7c86337b05a16a4155c9351cf947beaee9
2025-05-02 23:18:52 +00:00
carlory
93aeba057d Promoted API VolumeAttributesClass and VolumeAttributesClassList to storage.k8s.io/v1.
Promoted feature-gate `VolumeAttributesClass` to GA (on by default)

Signed-off-by: carlory <baofa.fan@daocloud.io>

Kubernetes-commit: 94bf8fc8a9d1d6c989eddad07996be0ca4dd3448
2025-04-30 17:35:21 +08:00
Antonio Ojea
2153502961 remove networking v1alpha1 and make update
Kubernetes-commit: 15ab88f88bf19b738cee0e63f1c1d83e720331a8
2025-04-30 09:18:02 +00: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
Stephen Kitt
03fb151034 Typo fix: watchActcion
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 3d53bfec09f1cb8dde5aed84ce1d330a34aec61c
2025-04-14 17:19:50 +02:00
Jordan Liggitt
25d4fa6ba8 Make Request#RequestURI honor configured context root
Kubernetes-commit: 5677f7ab0b1b1ab22a71d01e4a710bf0f5e633aa
2025-04-03 12:51:46 -04:00
Jordan Liggitt
5be379c517 Drop null creationTimestamp from test fixtures
Kubernetes-commit: 6bb6c9934294d8265197c9dfc4c9dd3adaca147a
2025-03-24 09:37:26 -04:00
Jordan Liggitt
61eae7552c bump cbor to add omitzero support
Kubernetes-commit: bc6051717137cef288b82305588e675de4a32c0d
2025-03-25 12:27:43 -04:00
Jordan Liggitt
fcc2100a59 bump structured-merge-diff to add omitzero support
Kubernetes-commit: 06b0784062f68566daa8eed83c475b738dcf620c
2025-03-24 16:34:01 -04:00
Kubernetes Publisher
05e0ea6c1e Merge pull request #131029 from liggitt/to-unstructured-stdlib
Make ToUnstructured match stdlib omitempty and anonymous behavior

Kubernetes-commit: ef239ae62b86ee03b8b5e7a01d7c4cf4dcdd4a92
2025-05-02 15:18:34 +00:00
Jordan Liggitt
ebd18c5e7c Make ToUnstructured match stdlib omitempty and anonymous behavior
Kubernetes-commit: 09912f3521932db99fe19f993db240fd43f3240e
2025-03-24 11:52:44 -04:00
Kubernetes Publisher
17ad09eb27 Merge pull request #131321 from karlkfi/karl-very-fast-watch
chore: Add VeryShortWatchError typed error

Kubernetes-commit: 07bcf936786b0e0a1d47b307aededb526ba4fca5
2025-04-24 23:17:38 +00:00
Karl Isenberg
921628ecd6 chore: Add VeryShortWatchError typed error
- Add a new VeryShortWatchError struct for error matching, returned
  by `handleAnyWatch`, up through `Reflector.ListAndWatch`.
- Update test expectations to match exact errors.

Kubernetes-commit: 6eff9db0f10db72f2c64390e106a80621d136439
2025-04-15 11:48:57 -07:00
Kubernetes Publisher
1601be3d14 Merge pull request #131266 from karlkfi/karl-reflector-refactor
fix: Watcher deadlock from Stop not being called

Kubernetes-commit: d6d6aad0d89abea236996b12d0545642f96684fb
2025-04-24 03:22:41 +00:00
Kubernetes Publisher
45e758d19c Merge pull request #131242 from zhifei92/update-mockery-version
Upgrade the mockery version to v2.53.3

Kubernetes-commit: 077a38217092f2ed72330e3232fdf6a16c1d97d8
2025-04-24 03:22:39 +00:00
Kubernetes Publisher
82c2b6c716 Merge pull request #131143 from liggitt/cache-test-goroutine-leak
Clean up leaked goroutines in cache unit tests

Kubernetes-commit: f7715e9b9d29ea93f9e95ba3a1d085d5daf7e230
2025-04-24 03:22:38 +00:00
Kubernetes Publisher
d01bdb17a5 Merge pull request #131111 from novahe/certificate_store
Certificate store: ensure data is written to disk

Kubernetes-commit: cd7195976f2621bd7a193de6d22ee49deead6a65
2025-04-23 23:25:14 +00:00
Kubernetes Publisher
451ac0fcb5 Merge pull request #130995 from xigang/utils
bump k8s.io/utils for improvements

Kubernetes-commit: 43a7d3be12425cc80ca6ad3599809a19728c5566
2025-04-23 23:25:13 +00:00
Karl Isenberg
e9ce1dd558 fix: Watcher deadlock from Stop not being called
Change:
- refactor Reflector.ListAndWatch and Reflector.watch to always call
  watcher.Stop.
- refactor Reflector.handleAnyWatch to always call watcher.Stop,
  EXCEPT when exitOnWatchListBookmarkReceived &&
  watchListBookmarkReceived.
- Update unit tests with these new expectations.

Effect:
- ensures watcher.Stop is always called at least once
- avoids deadlocks in watcher implementations when watcher.Watch is
  called, but watcher.Stop is never called.

Note: It's impossible to guarantee that Stop will only be called once.
So watch.Interface implementations must tollerate Stop being called
multiple times.

Kubernetes-commit: 3e609ecf6e945bf4562bddfc563fde9a4c3d0d90
2025-04-11 14:30:29 -07:00
zhangzhifei16
335b05fae2 chore: Upgrade the mockery version to v2.53.3.
Kubernetes-commit: c1ff9cf4e8113ce17215ac71b3bc7ef419626b64
2025-04-10 21:16:47 +08:00
Jordan Liggitt
a3cad0dc91 Clean up leaked goroutines in cache unit tests
Kubernetes-commit: 6747bf7a9cb3009aae4cba1e1d249d56a66a981b
2025-04-01 13:59:32 -04:00
Kubernetes Publisher
18a1faa115 Merge pull request #131103 from ahrtr/etcd_sdk_20250328
Bump etcd 3.5.21 sdk

Kubernetes-commit: f4d1686120d2367dd4c00df53e93dad51c414435
2025-04-01 10:32:47 +00:00
novahe
3262fdedea Certificate store: ensure data is written to disk
Kubernetes-commit: 653f48d8867d0b8487e3f824b3680ddc7d85758f
2025-03-30 10:46:59 +08:00
Benjamin Wang
983fe07d27 bump etcd 3.5.21 sdk
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>

Kubernetes-commit: f3b80a858225178e3f7a3ae07bd1b9894e7b3456
2025-03-28 14:30:47 +00:00
Kubernetes Publisher
2086688a72 Merge pull request #129970 from mortent/AddResourceV1beta2API
Add resource v1beta2 API

Kubernetes-commit: 070f0ad3bdfc17da90defdb45bb644aaf07dd43e
2025-03-26 18:25:06 +00:00
Morten Torkildsen
dba34c781e Run make update
Kubernetes-commit: e761be47a45b97574499069ea198d879e7050e51
2025-03-26 14:52:36 +00:00
Kubernetes Publisher
e359642e7c Merge pull request #130556 from sreeram-venkitesh/kep-4960-container-stop-signals
KEP 4960: Container Stop Signals

Kubernetes-commit: ff25881bc1fe9da1dda4ec82d294b92078ae2763
2025-03-25 02:24:14 +00:00
Kubernetes Publisher
3bf0a05288 Merge pull request #130797 from jm-franc/configurable-tolerance
Add support for HPA configurable tolerance

Kubernetes-commit: 34e80be1330556848521314ece92e9277efb26d4
2025-03-24 22:24:53 +00:00
Sreeram
7a03a3b92e Generated files
Kubernetes-commit: d6d9a354d7df9ad331ffe7e6212767cf8f90016c
2025-03-25 02:06:29 +05:30
xigang
55aca3c6c1 bump k8s.io/utils
Kubernetes-commit: fe14689f221a968806b771b226581efb834654cd
2025-03-22 10:14:01 +08:00
Jean-Marc François
1676beb32a Refresh autogenerated files following the configurable tolerance updates.
Kubernetes-commit: ac107137ce85166464465ea3954092752ca88326
2025-03-21 17:41:50 -04:00
Kubernetes Publisher
387edb880f Merge pull request #130967 from aojea/listers
benchmarks inefficiency on listers linear search lookup

Kubernetes-commit: 47a61c5c98822989d955e00d42f895234c1a1cb1
2025-03-21 10:24:27 +00:00
Antonio Ojea
21dc3b4441 benchmark to show inefficient linear search lookup
goos: linux
goarch: amd64
pkg: k8s.io/client-go/tools/cache
cpu: Intel(R) Xeon(R) CPU @ 2.60GHz
BenchmarkLister_Match_1k_100
BenchmarkLister_Match_1k_100-48      	   41910	     28255 ns/op	   16384 B/op	       1 allocs/op
BenchmarkLister_Match_10k_100
BenchmarkLister_Match_10k_100-48     	    3487	    337728 ns/op	  163848 B/op	       1 allocs/op
BenchmarkLister_Match_100k_100
BenchmarkLister_Match_100k_100-48    	     222	   7040793 ns/op	 1605659 B/op	       1 allocs/op
BenchmarkLister_Match_1M_100
BenchmarkLister_Match_1M_100-48      	      12	  97962328 ns/op	16007172 B/op	       1 allocs/op
PASS
ok  	k8s.io/client-go/tools/cache	10.480s

Kubernetes-commit: 33fbce73ae203ffeb1b9ea63ac43d567d1bdb1ad
2025-03-21 06:09:23 +00:00
Kubernetes Publisher
a27e26debd Merge pull request #129872 from seans3/websocket-https-proxy
WebSocket HTTPS Proxy support

Kubernetes-commit: 6f13ba03dac1865174b4edf2b43f6a0f453a8ac7
2025-03-21 03:54:09 +00:00
Kubernetes Publisher
e782ad64ac Merge pull request #130764 from cici37/partitionableDevice
[KEP-4815]DRA Partitionable device

Kubernetes-commit: d8607b91a78d01d5e0903e69765feb66651af2cf
2025-03-20 05:34:18 +00:00
Cici Huang
379ed45313 Auto gen
Kubernetes-commit: ea2f8881093b01f27807ee4fa4e6ca2b88a7bc71
2025-03-18 07:16:21 +00:00
Kubernetes Publisher
b0ed7301c5 Merge pull request #130844 from danwinship/improved-traffic-distribution
KEP-3015 PreferSameZone/PreferSameNode traffic distribution

Kubernetes-commit: 68ba091fca6927534e187d8b2595882352497f2f
2025-03-19 21:34:23 +00:00
Kubernetes Publisher
a9cdb028d1 Merge pull request #130447 from pohly/dra-device-taints
device taints and tolerations (KEP 5055)

Kubernetes-commit: ab3cec07014e58ef49050f953fb8426efbc85192
2025-03-19 21:34:21 +00:00
Kubernetes Publisher
169f1af1bf Merge pull request #130906 from serathius/streaming-validation
Update kube-openapi and integrate streaming tags validation

Kubernetes-commit: 32b1819423de505da855cf7544e871a04e63d6ed
2025-03-19 05:34:12 +00:00
Kubernetes Publisher
ac9f6ffb9a Merge pull request #130901 from deads2k/perms
add API approvers to generated applyconfigurations

Kubernetes-commit: 0f7ab496c1a1302118887f76f440694da1fe3380
2025-03-18 21:34:17 +00:00
Eddie Torres
7ed5fa7538 Implement KEP 4876 Mutable CSINode (#130007)
* Implement KEP-4876 Mutable CSINode Allocatable Count

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

* Update TestGetNodeAllocatableUpdatePeriod

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

* Implement CSINodeUpdater

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

* Use sync.Once in csiNodeUpdater

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

* ImVerify driver is installed before running periodic updates

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

* Update NodeAllocatableUpdatePeriodSeconds type comment

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

* Leverage apivalidation.ValidateImmutableField in ValidateCSINodeUpdate

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

* Update strategy functions

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

* Run hack/update-openapi-spec.sh

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

* Update VolumeError.ErrorCode field

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

* CSINodeUpdater improvements

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

* Iron out concurrency in syncDriverUpdater

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

* Run hack/update-openapi-spec.sh

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

* Revise logging

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

* Revise log in VerifyExhaustedResource

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

* Update API validation

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

* Add more code coverage

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

* Fix pull-kubernetes-linter-hints

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

* Update API types documentation

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

* Update strategy and validation for new errorCode field

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

* Update validation tests after strategy changes

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

* Update VA status strategy

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

---------

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

Kubernetes-commit: c766a52356a277da5e9f29f77aab5212f1b083c6
2025-03-18 21:34:16 +00:00
Marek Siarkowicz
9475320ce4 Update kube-openapi and integrate streaming tags validation
Kubernetes-commit: 75a4d136abac241f728407515e3d0d8305594675
2025-03-18 21:26:22 +01:00
David Eads
c8ae9cfa75 add API approvers to generated applyconfigurations
API approvers review new fields and need permissions to approve the
files generated from those new fields

Kubernetes-commit: 691398c8563f12db07505df7c05211e93145689a
2025-03-18 13:29:10 -04:00
Kubernetes Publisher
c5b5caed20 Merge pull request #129954 from iholder101/swap/capacity-on-node-sys-info
[KEP-2400] Report swap capacity as part of node.status.nodeSystemInfo

Kubernetes-commit: 2499a2c0a0f61f259156925cdd25dfb65df334f1
2025-03-18 05:34:27 +00:00
Kubernetes Publisher
b4e9c91225 Merge pull request #130721 from yanhuan0802/fix-informer-typo
fix: shared informer typos

Kubernetes-commit: 859eb4cd789754b09fdef853eb2affb59a546eb5
2025-03-17 17:35:45 +00:00
Kubernetes Publisher
97feb5b4e1 Merge pull request #130347 from Jefftree/remove-v2beta1-agg-discovery
Add a deprecated feature gate to stop serving apidiscovery.k8s.io/v2beta1

Kubernetes-commit: 8906223b000d94ad3947c1582c5ba452c6766e6c
2025-03-17 17:35:44 +00:00
Huan Yan
115024100c cleanup: remove error comment of AddIndexers func
Kubernetes-commit: a271d3e5339fa60b661b316a0e2f378f3afc51af
2025-03-16 23:39:33 +08:00
Jefftree
8ddf4401e5 Gate apidiscovery/v2beta1 serving with a feature gate
Kubernetes-commit: 95d3d4a22d705ef6bf2d494c065743d356914e8d
2025-03-13 17:58:06 +00:00
Kubernetes Publisher
595b7ca245 Merge pull request #130725 from jpbetz/replication-controller-minimums-to-declarative
Migrate to declarative validation: ReplicationController spec.replicas and spec.minReadySeconds fields

Kubernetes-commit: 6ef1a1f98e90ea541eedb45274886fc3d255ea1d
2025-03-14 17:34:25 +00:00
Kubernetes Publisher
5f676853f1 Merge pull request #129345 from pohly/log-client-go-workqueue
client-go workqueue: add optional logger

Kubernetes-commit: 9fd0e20bc2526483fdb1328305fc12ac638085dc
2025-03-14 17:34:22 +00:00
Kubernetes Publisher
7faeb317c7 Merge pull request #130751 from Jefftree/cle-promote-beta
[KEP-4355] Promote Coordinated Leader Election to Beta

Kubernetes-commit: be127ae0e27644edead7007834b5c8437fb6eb0b
2025-03-13 21:35:13 +00:00
Kubernetes Publisher
8489267318 Merge pull request #130693 from novahe/fix/test-cases
Fix test cases that may potentially cause a panic.

Kubernetes-commit: 336a32a270997731873b6d8b616f4ae91d903fcf
2025-03-13 13:33:51 +00:00
Kubernetes Publisher
8ee5c997b3 Merge pull request #130748 from jpbetz/revert-125102
Revert PR 125102: Add unit tests to client-go/tools/cache/listers.go

Kubernetes-commit: fb98a599a6811ee0b673883a0f471ec7b9e28083
2025-03-12 17:34:06 +00:00
Jefftree
0a56d352bc generated
Kubernetes-commit: a7505f026215954809d57b9e6c0a3abdddf00e16
2025-03-12 16:59:43 +00:00
Joe Betz
bcd36428c5 Revert PR 125102: Add unit tests to client-go/tools/cache/listers.go
Kubernetes-commit: 37ddc637f55af547862ac41452ade42ed15b778b
2025-03-12 11:43:15 -04:00
Kubernetes Publisher
92865bf125 Merge pull request #125102 from 0xMALVEE/unit-tests-listers.go
Add unit tests to client-go/tools/cache/listers.go

Kubernetes-commit: 0b00454617397cea2e9e6ed75b232a4e1e9cfb6d
2025-03-12 09:33:53 +00:00
Kubernetes Publisher
65ca8d80f5 Merge pull request #128499 from stlaz/ctb_betav1
ClusterTrustBundles - move to beta

Kubernetes-commit: 309c4c17fb1dec52328f3e6b4482bc2a4037c45a
2025-03-11 21:35:03 +00:00
Huan Yan
4ba25ca711 fix: shared informer typos
Kubernetes-commit: b38bfaa2ac99deb28eb8c70fcd9466492b292a01
2025-03-11 20:00:16 +08:00
novahe
5c7f206b25 Fix test cases that may potentially cause a panic.
Kubernetes-commit: 9e53371ddaaeab4083fde45e43c803071238e686
2025-03-11 17:41:37 +08:00
Patrick Ohly
71c858c5f4 DRA: generated files for device taints API
Kubernetes-commit: 99dbd85c45f77a4fd719ff9271128e8a4ed46082
2025-03-07 14:59:08 +01:00
Alvaro Aleman
a539a79dea ManagedFieldsObjectTracker: Reload scheme
In controller-runtime it is generally not expected to do any sort of
scheme registration if unstructured.Unstructured is used. To make this
work in the fakeclient, the fakeclient will register unstructured to
scheme if the scheme doesn't recognize the GVK.

This currently doesn't work with the `ManagedFieldsObjectTracker` as it
never reloads the scheme. This change makes it reload the scheme in an
inefficient but simple manner, which should be good enough for unit
tests.

Kubernetes-commit: 1cd71cbb14ecfd0ec6c5e8a57db6be00ecb8a4d1
2025-03-02 12:43:08 -05:00
Jefftree
dbe73bc712 Add LeaseCandidate v1beta1
Kubernetes-commit: 5ba4a90fdad6bf9cdfa69e166aff9786efc9430c
2025-02-19 21:43:35 +00:00
Dan Winship
789d60d280 update generate docs for PreferSameTrafficDistribution
Kubernetes-commit: af3584778e0075fed6090a1207794cbdbc71f2cb
2025-02-11 10:06:25 -05:00
Itamar Holder
9a7d64c561 add auto-generated files: ./hack/update-codegen.sh
Signed-off-by: Itamar Holder <iholder@redhat.com>

Kubernetes-commit: 4bdaf6cbbde9d7bda89ff734691fc3195a1ecbd5
2025-02-04 14:03:52 +02:00
Sean Sullivan
c77f9e4f9e Websocket HTTPS proxy support
Kubernetes-commit: f73945aae56b51078318199ff2f0ecae91bc489e
2025-01-29 03:56:55 +00:00
Stanislav Láznička
2241515bf6 generate code
Kubernetes-commit: ccd2d4d62ad7be67a85fb5e28d0359d2e388cf27
2025-01-14 14:18:57 +01:00
Kubernetes Publisher
a50f4a61f1 Merge pull request #130555 from thockin/k_k_randfill
Use randfill in k/k

Kubernetes-commit: 0f2bde7745f3b4eadcf317bc5056dfeb96859bd3
2025-03-09 13:35:02 +00:00
Tim Hockin
1459662525 Vendor randfill
Kubernetes-commit: 0ce4268b1fe4f78d77249e329b0349b9d2dd2c65
2025-03-03 23:46:48 -08:00
Tim Hockin
4a6072d89f Use randfill, do API renames
Kubernetes-commit: e54719bb6674fac228671e0786d19c2cf27b08a3
2025-02-20 09:45:22 -08:00
Kubernetes Publisher
b3c8744140 Merge pull request #130569 from dims/update-to-latest-cadvisor-v0.52.0
Update to latest cadvisor @ v0.52.1 and new opencontainer/cgroups and drops opencontainers/runc

Kubernetes-commit: 0eaee48ecb8669dc65bfdf9a3583326ab88fc39d
2025-03-08 01:33:34 +00:00
Kubernetes Publisher
d42a6bba80 Merge pull request #130352 from natasha41575/kubelet-pod-observedgen
[FG:PodObservedGenerationTracking] Kubelet sets pod `status.observedGeneration` when updating the pod status

Kubernetes-commit: 2effa5e3cf92af7dbcff87822b3293354823f567
2025-03-08 01:33:32 +00:00
Davanum Srinivas
dd81c64258 update to v1.22.0-rc.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 97a54dc4b04b7d2938d11c5ae9a6233348e854ef
2025-03-07 13:45:34 -05:00
Kubernetes Publisher
0445543f66 Merge pull request #130635 from zimnx/fix-websocket-read-error
Return correct error upon websocket message read failure

Kubernetes-commit: 0e2a2afc4c7687e71f2dddbb7edfd03f082c6876
2025-03-07 17:33:39 +00:00
Kubernetes Publisher
d5f336d4f5 Merge pull request #130489 from p0lyn0mial/upstream-fake-client-pass-opts
client-gen/fake: pass ListOptions to Watch method

Kubernetes-commit: ea49618a749b84c3cb5bd781380891eb51289950
2025-03-07 17:33:38 +00:00
Kubernetes Publisher
a48b937483 Merge pull request #130470 from p0lyn0mial/upstream-fake-client-opts-watch
client-go/gentype/fake: sets opts.Watch true

Kubernetes-commit: 4468565250c940bbf70c2bad07f2aad387454be1
2025-03-07 13:33:41 +00:00
Maciej Zimnoch
c1ee4cc22c Return correct error upon websocket message read failure
This fixes variable passed as error reason upon websocker message read failure.
Previously a wrong variable was passed resulting in returning failure with nil error reason.

Kubernetes-commit: e1d3aaf8612c490fae965272a304d74fccf7e294
2025-03-07 12:53:47 +01:00
Kubernetes Publisher
ca10b28dd3 Merge pull request #128586 from mortent/DRAPrioritizedList
Prioritized Alternatives in Device Requests

Kubernetes-commit: 9d45ea8b9d0be4f2f90159ff272851b8e985c904
2025-03-07 05:34:09 +00:00
Davanum Srinivas
9cfcaac397 update to latest cadvisor @ v0.52.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 5ecddb65715af7e2afc4f3cbb1abe393bfb4346a
2025-03-04 14:29:08 -05:00
Kubernetes Publisher
ec8a292223 Merge pull request #130515 from Jefftree/revert-cle-beta-types
Revert "LeaseCandidate v1beta1 API"

Kubernetes-commit: 78c41fbcc9a1bad39021f22fbda516bfd04dbaeb
2025-03-02 00:06:36 +00:00
Kubernetes Publisher
05e64ee1f6 Merge pull request #128919 from dashpole/update_otel
Update go.opentelemetry.io dependencies to v1.33.0/v0.58.0

Kubernetes-commit: eea2f78e61fe91bb8fcd3c4a357ea3a10d1389db
2025-03-02 00:06:34 +00:00
David Ashpole
030621a307 update go.opentelemetry.io dependencies to v1.33.0/v0.58.0
Kubernetes-commit: 29c219dcebe30be99d6917623f8d8707a47194c1
2025-03-01 19:17:16 +00:00
Jefftree
41d7de3d5a Revert "LeaseCandidate alpha -> beta,"
This reverts commit ac7a95efb092944ad9be0ceecb94a868342af1f1.

Kubernetes-commit: 1a1b566d61f7dd6f7b4b577369a6c3b471c9d239
2025-03-01 14:14:19 +00:00
Jefftree
29076dbc0b Revert "generated"
This reverts commit 2d10dec3a297e6be29f47c68722c1ef5ea727fbf.

Kubernetes-commit: 71622aee49d05fe1aa3c7b0b8a18028c5ebb1459
2025-03-01 14:10:35 +00:00
Kubernetes Publisher
cb16ee3635 Merge pull request #130474 from dims/bump-x/crypto-and-x/oauth2
Bump x/oauth2 and x/crypto

Kubernetes-commit: 01ed8ed4ff0a0cbea99370c7a268019829d19e82
2025-02-28 20:07:28 +00:00
Kubernetes Publisher
ebce4d7b9d Merge pull request #130291 from Jefftree/cle-beta
LeaseCandidate v1beta1 API

Kubernetes-commit: ef1c659569409471b4bdfeb83ba69cb1772ed37d
2025-02-28 20:07:26 +00:00
Morten Torkildsen
2143ace7a7 Run make update
Kubernetes-commit: 68040a31736cc9f33763e87fc4ebea27cf447743
2025-02-28 19:28:26 +00:00
Kubernetes Publisher
8247f1e51f Merge pull request #129338 from pohly/log-client-go-certificates
client-go certificate: context-aware APIs and logging

Kubernetes-commit: c92dde6941356e499308b7caf8aa84a7c1f74667
2025-02-28 16:07:32 +00:00
Lukasz Szaszkiewicz
7b0f098f60 ./hack/update-codegen.sh
Kubernetes-commit: 325a54f73dcdc5fc7a7d47bd78791abcba93456a
2025-02-28 09:43:58 +01:00
Kubernetes Publisher
b46275ad75 Merge pull request #129688 from cpanato/update-main-go124
[go] Bump images, dependencies and versions to go 1.24.0

Kubernetes-commit: b8c95e1954ef222988c0dfe5b45d5cc96c09bcb8
2025-02-27 20:07:27 +00:00
Davanum Srinivas
9dffd3c20f Bump x/oauth2 and x/crypto
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 0fede7b8a2fb4c7f120876c9ef1e826f8ef28da2
2025-02-27 10:59:37 -05:00
Lukasz Szaszkiewicz
2790aee4eb client-go/gentype/fake: sets opts.Watch true
Kubernetes-commit: f73f6fd2ab59c14a7379bc3086f7cc26cf9f8b4a
2025-02-27 12:11:47 +01:00
Natasha Sarkar
3c80fbbe56 run 'make update'
Kubernetes-commit: 6edd92174692822ca7b2549adbfe7286a8ee7b66
2025-02-25 20:46:33 +00:00
cpanato
a126675a40 bump go.mod to set min go1.24
Signed-off-by: cpanato <ctadeu@gmail.com>

Kubernetes-commit: 88300c406b9199ed017e1bada29951fc18e66ae1
2025-02-25 13:21:52 +01:00
Kubernetes Publisher
8dd5edb393 Merge pull request #130359 from my-git9/assertion1
fix wrong assertion on tests

Kubernetes-commit: 06d81cfc7a485487375814fd8d5cefdf644c2d28
2025-02-24 15:55:11 +00:00
Kubernetes Publisher
8fa90a0728 Merge pull request #130187 from mansikulkarni96/129084
fix:  Sweep and fix stat, lstat, evalsymlink usage for go1.23 on Windows

Kubernetes-commit: ef54ac803b712137871c1a1f8d635d50e69ffa6c
2025-02-22 23:50:35 +00:00
xin.li
d8b34c3ab2 fix wrong assertion on tests
Signed-off-by: xin.li <xin.li@daocloud.io>

Kubernetes-commit: bc4ae15d77beab23f321bf6547f82c04ba27c3fa
2025-02-22 12:39:01 +08:00
Jefftree
50aba71374 generated
Kubernetes-commit: 2d10dec3a297e6be29f47c68722c1ef5ea727fbf
2025-02-19 21:51:25 +00:00
Jefftree
e6e6fcf176 LeaseCandidate alpha -> beta,
Kubernetes-commit: ac7a95efb092944ad9be0ceecb94a868342af1f1
2025-02-19 21:50:31 +00:00
Jordan Liggitt
c92258a929 Drop winsymlink go 1.23 workaround
(cherry picked from commit 3990b6324d0427eaf9ff970da2be02711567ef5f)

Kubernetes-commit: 1f642c79c3192994e76bbe8e7360fd661cd21ab4
2025-02-06 12:45:52 -05:00
Kubernetes Publisher
9c375bc53d Merge pull request #129790 from aojea/event_name
events: ensure the name is valid

Kubernetes-commit: 052d7a5310b0bab58f81519253e08f456f39e8f3
2025-02-20 19:50:35 +00:00
Antonio Ojea
023460f5a8 events: ensure the name is valid
The event Object is created from the referenced Object name, however,
there is no guarantee that the name from the referenced Object will be a
valid Event Name.

For those Objects with name not valid for an Event, generate a new valid
name using an UUID.

Kubernetes-commit: ee36b817df06f84ce1a48ef4d65ed559c3775404
2025-02-20 09:13:56 +00:00
Kubernetes Publisher
d067ae26c7 Merge pull request #130269 from tmmorin/fix-optimitically-typo
fix typo: optimitically -> optimistically

Kubernetes-commit: c2b8721c3b11306b70f3448053ddcad1b2075834
2025-02-19 23:50:54 +00:00
Kubernetes Publisher
84ec13492b Merge pull request #130047 from HirazawaUi/modify-loopback-cert-valid-period
Extending loopback certificate validity in kube-apiserver

Kubernetes-commit: 77667834b072db7e26a69d78c5e9f3181e12959f
2025-02-19 16:00:48 +00:00
Thomas Morin
89a3804453 fix typo: optimitically -> optimistically
Signed-off-by: Thomas Morin <thomas.morin@orange.com>

Kubernetes-commit: 293a6c5c91619a86b70e9d23e26412a1095db569
2025-02-19 13:37:51 +01:00
Kubernetes Publisher
72c2d4d415 Merge pull request #130249 from seans3/bump-websockets-version
Update gorilla/websockets library from 1.5.0 to latest 1.5.3

Kubernetes-commit: 728dc0d8c7a4d68157b2106330b65abcd5faac87
2025-02-19 03:51:21 +00:00
Sean Sullivan
7392886a8b Update gorilla/websockets library from 1.5.0 to latest 1.5.3
Kubernetes-commit: 3100bbab2f7f013b08910f28d8a3debc28a57ea9
2025-02-19 00:26:21 +00:00
Kubernetes Publisher
90ccd59ab1 Merge pull request #130105 from seans3/websocket-logging-level
Update websocket logging levels for better debuggability

Kubernetes-commit: 4e7e14203db8cde906604b057b1b2a8a15e8a50d
2025-02-15 19:50:49 +00:00
Kubernetes Publisher
bf05f9c594 Merge pull request #130039 from p0lyn0mial/upstream-fake-client-improve-unit-test
fake/clientset: improve TestNewSimpleClientset

Kubernetes-commit: d7db75ce91f74dc560115c9f485032701e913c84
2025-02-12 23:51:42 +00:00
Sean Sullivan
3ead27a3a2 Update websocket logging levels for better debuggability
Kubernetes-commit: d3feb5080c18fa73aa87c81a78d5cac82c6ed06d
2025-02-11 20:20:23 +00:00
Kubernetes Publisher
8683d2da3b Merge pull request #130049 from aojea/avoid_ginkgo_dep
reduce dependencies in apimachinery net testing utils

Kubernetes-commit: 670b98bf9229bb1f193571949871f794f7b11ec3
2025-02-11 11:52:16 +00:00
Antonio Ojea
fb7de29368 reduce dependencies in apimachinery net testing utils
Consumers of the kubernetes golang API and clients must use
k8s.io/api,apimachinery,client-go. This is also require to download all
the necessary dependencies.

The apimachinery code contains a testing util for proxies that is used
in client-go and in the kubectl e2e. Since the tests on e2e require
ginkgo and we want to ensure this testing library is not used in
production, we cast the interface to match one of those libraries, but
the problem is that this forces consumers of apimachinery to also
download the ginkgo library.

Since NewHTTPProxyHandler receives a testing.TB interface, there is no
need to cast the interface, if someone wants to use it by implementing a
testing interface it is already aware of the risks.

Kubernetes-commit: af3b9e613d3b76b826369153760a069aabb4cf7f
2025-02-08 15:27:20 +00:00
HirazawaUi
5c249861a4 adjusting loopback certificate validity in kube-apiserver
Kubernetes-commit: 553e9bf84d199be3d6a3da6675671859723219f4
2025-02-08 19:43:48 +08:00
Lukasz Szaszkiewicz
2b1c073f58 fake/clientset: improve TestNewSimpleClientset
Kubernetes-commit: d195ea8756d7a0babae1e052d17ad891cd3312d2
2025-02-07 14:39:15 +01:00
Kubernetes Publisher
07d61b66a6 Merge pull request #129341 from pohly/log-client-go-watch
client-go watch: context support

Kubernetes-commit: a02fe24385a36f43e96844e19c438cc4097704ef
2025-02-07 12:55:24 +00:00
Patrick Ohly
57bc261e52 client-go watch: NewIndexerInformerWatcherWithContext -> WithLogger
The ability to automatically stop on context cancellation was new functionality
that adds complexity and wasn't really used in Kubernetes. If someone wants
this, they can add it outside of the function.

A *WithLogger variant avoids the complexity and is consistent with
NewStreamWatcherWithLogger over in apimachinery.

Kubernetes-commit: 1a8d8c9b4a33daf9330434e1ad544ef3571722a3
2025-01-31 10:18:04 +01:00
Kubernetes Publisher
362c5e8de9 Merge pull request #129568 from deads2k/tighten-fifo-interface
create RealFIFO implementation

Kubernetes-commit: a8ef3639f9db66d8c894a880fd35a9cd011b2cb9
2025-01-30 00:24:47 +00:00
Kubernetes Publisher
f2030849e1 Merge pull request #129330 from pohly/log-client-go-transport
client-go/transport: structured, contextual logging

Kubernetes-commit: e07aeb7c8b52a486518f2f55ea58595ae007f3b0
2025-01-27 20:23:51 +00:00
Kubernetes Publisher
ce24f3c462 Merge pull request #129815 from dims/linter-to-ensure-go-cmp/cmp-is-used-only-in-tests
Linter to ensure go-cmp/cmp is used ONLY in tests

Kubernetes-commit: d36322f8d76c8e2a456e381bcc6bb43e4bbe602c
2025-01-26 00:23:39 +00:00
Davanum Srinivas
de67e026ad Linter to ensure go-cmp/cmp is used ONLY in tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
2025-01-24 17:03:29 -05:00
Kubernetes Publisher
97f3d2697c Merge pull request #128546 from atiratree/pod-replacement-policy-terminating-pods
add PodReplacementPolicy for Deployments: terminating pods

Kubernetes-commit: 5aeea45357176e7224f908329fb7958d88a7eeac
2025-01-24 04:23:58 +00:00
David Eads
f2d9cfb8c8 switch to using the real FIFO
Kubernetes-commit: a9aab298b4738f4ea9111131cdf193a3b1ba14e5
2025-01-10 16:23:23 -05:00
David Eads
43bf1a1b0a make a real FIFO implementation
Kubernetes-commit: 24b43ea96ec60ca2c574ccc6b51c989488ca3210
2025-01-10 16:23:07 -05:00
David Eads
52af3bdc0f Remove cache.ErrRequeue
cache.ErrRequeue advertised itself as a way to requeue failures on a
FIFO, but it suffers the same problems as AddIfNotPresent.  If we do
requeue an item at the end, we'll move the informer back in time.  If we
requeue at the beginning we'll simply wedge FIFO.

We didn't find examples in the wild, but by removing the error type
those impacted will get a compile error and get to decide what action is
most appropriate for their failure.  Most of the time, proceeding to the
next item is best.

Kubernetes-commit: 238c32a1d9b2c72d648193fa8642a53a2884975f
2025-01-20 13:59:43 -05:00
David Eads
d853ccf18c Remove Queue.AddIfNotPresent
Logically a cache.Queue.AddIfNotPresent means that the informer can move
back in time since an older item is placed after newer items.  The
alternative of placing errors at the head of the queue leads to
indefinite memory growth and repeated failures on retry.

Luckily this behavior was behind RetryOnError, which was always set to
false and impossible for normal users to set to true.  By removing the
function and setting, impacted users (none found in a github search)
will get a compile failure.

Kubernetes-commit: 8e77ac000131019d5aa49c19aa1f477f6dac4d59
2025-01-20 13:54:32 -05:00
David Eads
f29637f7f2 shrink the cache.Queue interface to what is actually used
Kubernetes-commit: 0ddab1694579d523e3865c75ca44d6cdf1b0ef93
2025-01-08 15:31:47 -05:00
Tim Hockin
d6ee3825de Add declarative default for RC.Spec.MinReadySeconds
Kubernetes-commit: 1e336160681f129cb34d6fabfa23cdac50cc107b
2024-12-22 22:59:32 -08:00
Tim Hockin
5adc342f3d Add declarative default for RC.Spec.Replicas
Remove manual default:

```
$ git diff
diff --git a/pkg/apis/core/v1/defaults.go b/pkg/apis/core/v1/defaults.go
index e66de8bb432..1dd28dd35fb 100644
--- a/pkg/apis/core/v1/defaults.go
+++ b/pkg/apis/core/v1/defaults.go
@@ -60,10 +60,6 @@ func SetDefaults_ReplicationController(obj *v1.ReplicationController) {
                        obj.Labels = labels
                }
        }
-       if obj.Spec.Replicas == nil {
-               obj.Spec.Replicas = new(int32)
-               *obj.Spec.Replicas = 1
-       }
 }
 func SetDefaults_Volume(obj *v1.Volume) {
        if ptr.AllPtrFieldsNil(&obj.VolumeSource) {
```

The test fails:

```
$ go test ./pkg/apis/core/v1 | grep -v gate | grep -v SetEmulationVersion
--- FAIL: TestSetDefaultReplicationControllerReplicas (0.00s)
    defaults_test.go:1608: expected: 1 replicas, got: 0
FAIL
FAIL	k8s.io/kubernetes/pkg/apis/core/v1	0.269s
FAIL
```

Declare the default, update codegen and re-run the test:

```
$ git diff
diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go
index 406ab56a002..7e5136fe9f6 100644
--- a/staging/src/k8s.io/api/core/v1/types.go
+++ b/staging/src/k8s.io/api/core/v1/types.go
@@ -5101,6 +5101,7 @@ type ReplicationControllerSpec struct {
        // Defaults to 1.
        // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
        // +optional
+       // +default=1
        // +k8s:minimum=0
        Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`

$ ./hack/update-codegen.sh default
+++ [1219 08:58:43] Generating defaulter code for 102 targets

$ git diff
diff --git a/pkg/apis/core/v1/zz_generated.defaults.go b/pkg/apis/core/v1/zz_generated.defaults.go
index 3b6eb4f0a93..567c49053aa 100644
--- a/pkg/apis/core/v1/zz_generated.defaults.go
+++ b/pkg/apis/core/v1/zz_generated.defaults.go
@@ -878,6 +878,10 @@ func SetObjectDefaults_PodTemplateList(in *corev1.PodTemplateList) {

 func SetObjectDefaults_ReplicationController(in *corev1.ReplicationController) {
        SetDefaults_ReplicationController(in)
+       if in.Spec.Replicas == nil {
+               var ptrVar1 int32 = 1
+               in.Spec.Replicas = &ptrVar1
+       }
        if in.Spec.Template != nil {
                SetDefaults_PodSpec(&in.Spec.Template.Spec)
                for i := range in.Spec.Template.Spec.Volumes {

$ go test ./pkg/apis/core/v1 | grep -v gate | grep -v SetEmulationVersion
ok  	k8s.io/kubernetes/pkg/apis/core/v1	(cached)
```

Kubernetes-commit: 21b3da7e5aadf77e8fd17e467c86ff7e18f7d9ed
2024-12-19 09:03:52 -08:00
Patrick Ohly
a96aa53864 client-go workqueue: add optional logger
NewTypedDelayingQueueWithConfig spawns a goroutine, but apparently shutdown is
already handled somehow. Therefore only the option to set a logger gets added
to the Config struct.

The problem then becomes that developers might forget to set that
logger. logcheck can't detect that. For now, all in-tree users get updated
immediately.

Kubernetes-commit: f20eb2e7c16a9b28e69fd0bba2000e7166d68f29
2024-12-11 12:45:57 +01:00
胡玮文
48920637ea remove out-of-date comments about version
mark_new_version.sh (actually mark-new-version.sh) has been removed. And we are
not creating vX.Y tags. We are using ldflags -X now.

Kubernetes-commit: 0f0f9d01c0db8906989616ccc1ef04175035ddf9
2024-12-11 01:16:38 +08:00
Patrick Ohly
e8a7cb0e18 client-go informers: provide ListWatch *WithContext variants
For compatibility reasons, the old functions without the ctx parameter still
get generated, now with context.Background instead of context.TODO. In practice
that code won't be used by the client-go reflector code because it prefers
the *WithContext functions, but it cannot be ruled out that some other code
only supports the old fields.

Kubernetes-commit: 8cc74e8a266e1042be1c60adfa3091852036f48a
2024-12-09 16:04:52 +01:00
Patrick Ohly
bad1caabde client-go + apimachinery watch: context support
The Lister and Watcher interfaces only supported methods without context, but
were typically implemented with client-go API calls which need a context. New
interfaces get added using the same approach as in
https://github.com/kubernetes/kubernetes/pull/129109.

Kubernetes-commit: 6688adae142e37114d9dfa8d94cd1d8a91fbcc13
2024-12-20 13:55:47 +01:00
Patrick Ohly
d0f5d55191 client-go certificate: context-aware APIs and logging
For NewManager, the Config struct gets changed (not extended!) so that the
caller can provide a logger instead of just a logging function. Breaking the
API was chosen because it avoids having to maintain two different log calls in
various places (one for printf-style logging, one for structured logging).

RequestCertificateWithContext is an extension. It enables getting rid of
context.TODO calls.

NewFileStoreWithLogger also is an extension.

Kubernetes-commit: f9051901cee8d8ff4aed3db27ff495a706f1a487
2024-12-09 12:45:54 +01:00
Patrick Ohly
82fcce0646 client-go/transport: structured, contextual logging
The revised logging emits one log entry at the start of
round-tripping ("Request") and another at the end ("Response"). This avoids the
risk that related output gets interleaved by other output.

No API changes are necessary. A contextual logger is picked up from the context
of the request that is being handled. The verbosity level of that logger is
checked to determine what is supposed to be logged. This enables reducing log
details on a by-request basis by storing a `logger.V(1)` in the context of the
request.

As before, logging only gets injected into request processing at -v6 or higher,
so normally there is no additional overhead.

Kubernetes-commit: a85f489b28d3b0ef82dffb267b6145c73c2d0e33
2024-12-04 15:09:37 +01:00
Filip Křepinský
df7621a0b4 update generated files and feature gates
Kubernetes-commit: 28437797b525b17a5a20b8e6c7daf30046a3864c
2024-11-04 19:52:30 +01:00
Tiago Silva
9f1cce41d5 client-go: transform watchErrorStream to wrap the underlying error (#129765)
* `client-go`: transform `watchErrorStream` to wrap the underlying error

This PR transforms the `client-go`'s `watchErrorStream` to wrap the error instead of transforming it into a single string. This enables clients to use `errors.Is/As/Unwrap` with the errors that come out of `StreamWithContext`

Fixes https://github.com/kubernetes/kubernetes/issues/129763

* adjust unit tests

Kubernetes-commit: 067012f5844b7390e7279f575342ae0536f80520
2025-01-23 20:07:37 +00:00
Kubernetes Publisher
3b09c13448 Merge pull request #128971 from aojea/servicecidr_ga
KEP-1880 Multiple Service CIDRs: Graduate to GA

Kubernetes-commit: 45d0fddaf1f24f7b559eb936308ce2aeb9871850
2025-01-22 20:27:05 +00:00
Kubernetes Publisher
3617101e66 Merge pull request #127709 from pohly/log-client-go-rest
client-go/rest: finish context support

Kubernetes-commit: 427cd18f726be3e3c4f657258dc17a97beca92d5
2025-01-22 20:27:02 +00:00
Patrick Ohly
be86cb59f1 client-go rest: store logger in Result
Storing a context and making sure that it never gets canceled also has
overhead. We might as well just do the klog.FromContext when constructing
the Result and store the logger for later use.

Kubernetes-commit: b7386467c8df686e935c477eac26049a80de789b
2024-11-27 13:19:47 +01:00
Antonio Ojea
a9177f9ca1 make update
Kubernetes-commit: 3606d52cd6de7366ca855d571b27193c32b029fb
2024-11-26 03:52:02 +00:00
Patrick Ohly
5d128adc87 client-go/rest: finish conversion to contextual logging
The remaining calls can be converted without API changes.

Kubernetes-commit: 7821abf2ae289673bbfa3b9a6b8b34f5196c7c7e
2024-09-02 17:55:12 +02:00
Patrick Ohly
7aa9904196 client-go/rest: backoff with context support
The BackoffManager interface sleeps without considering the caller's context,
i.e. cancellation is not supported. This alone is reason enough to deprecate it
and to replace it with an interface that supports a context parameter.

The other reason is that contextual logging needs that parameter.

Kubernetes-commit: b15a1943d51adfb8c5e0185d58d25e038c3d6ade
2024-09-02 20:18:47 +02:00
Patrick Ohly
2b2015d460 client-go/test: warning handler with contextual logging
The default handler now uses contextual logging. Instead of

     warnings.go:106] warning 1

it now logs the caller of client-go and uses structured, contextual
logging

     main.go:100] "Warning" message="warning 1"

Users of client-go have the choice whether the handler that they provide uses
the traditional API (no API break!) or contextual logging.

Kubernetes-commit: 48fb886325fce4b16e4067caadb7bcd3044d460f
2024-09-02 17:51:01 +02:00
Kubernetes Publisher
9897373fe6 Merge pull request #129631 from kishen-v/update-client-go-docs
Update compatibility matrix and maintenance status upto release-1.32

Kubernetes-commit: d06398aac3e378da0c95472cd39713998206e9ff
2025-01-16 20:23:32 +00:00
Kubernetes Publisher
49eb6dc066 Merge pull request #129633 from skitt/revert-go-difflib-go-spew
Revert to go-difflib and go-spew releases

Kubernetes-commit: 6d570c923f66a1f214d0c3ba3eddd9a0cd0fae68
2025-01-15 20:23:22 +00:00
Stephen Kitt
2d999b8c6e Revert to go-difflib and go-spew releases
The last dependency pulling in the tips of go-difflib and go-spew has
reverted to the last release of both projects, so k/k can revert to
the releases too. As can be seen from the contents of vendor, this
doesn't result in any actual change in the code.

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

Kubernetes-commit: 3986472b3c7202716f92e586ccfaa4b4fe573dc5
2025-01-15 09:07:27 +01:00
Kishen Viswanathan
ea0b82ef07 Update compatibility matrix and maintenance status upto release-1.32
Kubernetes-commit: fef67f64c7bdb3a44fccfb1b84805c8c52c290c9
2025-01-15 12:16:25 +05:30
Kubernetes Publisher
151d631605 Merge pull request #129615 from pohly/log-client-go-tools-cache-apis-fix
client-go/tools/cache: fix TestAddWhileActive

Kubernetes-commit: 1a9feed0cd89f3299ddb6f5eaa5663496c59342c
2025-01-14 20:40:51 +00:00
Patrick Ohly
40cace856c client-go/tools/cache: fix TestAddWhileActive
4638ba971661497b147906b8977ae206c9dd6e44 added tracking of the goroutine which
executes informer.Run. In the TestAddWhileActive the original `go
informer.Run()` was left in place, causing a data race between the two
`informer.Run` instances:

==================
WARNING: DATA RACE
Read at 0x00c000262398 by goroutine 5302:
  k8s.io/client-go/tools/cache.(*controller).RunWithContext()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/controller.go:162 +0x1ad
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).RunWithContext()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer.go:584 +0x6c5
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).Run()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer.go:527 +0x48
  k8s.io/client-go/tools/cache.TestAddWhileActive.gowrap1()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:1080 +0x17

Previous write at 0x00c000262398 by goroutine 5301:
  k8s.io/client-go/tools/cache.New()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/controller.go:142 +0x9de
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).RunWithContext.func1()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer.go:562 +0xa78
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).RunWithContext()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer.go:565 +0x119
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).Run()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer.go:527 +0x44
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).Run-fm()
      <autogenerated>:1 +0x17
  k8s.io/client-go/tools/cache.TestAddWhileActive.(*Group).StartWithChannel.func2()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go:55 +0x38
  k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go:72 +0x86

Goroutine 5302 (running) created at:
  k8s.io/client-go/tools/cache.TestAddWhileActive()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:1080 +0x93e
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x44

Goroutine 5301 (running) created at:
  k8s.io/apimachinery/pkg/util/wait.(*Group).Start()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go:70 +0xe4
  k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithChannel()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go:54 +0x7e6
  k8s.io/client-go/tools/cache.TestAddWhileActive()
      /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/client-go/tools/cache/shared_informer_test.go:1074 +0x6a1
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x44
==================

Kubernetes-commit: d66ced5730fa60c04b0a39df58a156b7045585f6
2025-01-14 14:06:31 +01:00
Kubernetes Publisher
e421aed7f1 Merge pull request #129139 from tklauser/client-setconfigdefaults-noerror
Remove always-`nil` `setConfigDefaults` error return value in generated clients

Kubernetes-commit: 2331c028c2000f7d31efeeb405d8151a78a9de9c
2025-01-09 16:30:42 +00:00
Kubernetes Publisher
26c6fd655e Merge pull request #129343 from pohly/log-client-go-v1-event
client-go event: add WithContext expansion methods

Kubernetes-commit: 2832f70801fc7c505a2b90c236dcb24fb59cb9d9
2025-01-08 16:22:50 +00:00
Kubernetes Publisher
ca1e525bb4 Merge pull request #129349 from dims/bump-x/net-to-v0.33.0
Bump x/net to v0.33.0

Kubernetes-commit: b7ef173c59065f9a5f68eb514ef0483c6f3887ae
2025-01-06 20:23:09 +00:00
Kubernetes Publisher
2ad95cfec9 Merge pull request #128872 from alvaroaleman/generics
Use generic btree in watchcache

Kubernetes-commit: 8f8c94a04d00e59d286fe4387197bc62c6a4f374
2025-01-03 16:22:09 +00:00
Alvaro Aleman
91ed5e1d2b Update github.com/google/btree
Kubernetes-commit: a97ed3c98bcd2c520260aa04c516a24e975e7d69
2025-01-02 19:44:07 -05:00
Kubernetes Publisher
da6e2946e5 Merge pull request #129420 from pohly/client-go-tools-cache-testhammercontroller-fix
client-go cache: fix TestHammerController

Kubernetes-commit: 8f330c63688ab920ea8d864d9a3193da535018e5
2024-12-29 16:21:56 +00:00
Patrick Ohly
498e3efe74 client-go cache: fix TestHammerController
The test relied on a 100ms sleep to ensure that controller was done.  If that
race was lost, one goroutine was intentionally prevented from completing by
locking a mutex permanently. A TODO was left about detecting that.

Adding goroutine leak checking in
https://github.com/kubernetes/kubernetes/pull/126387 revealed that this race
indeed sometimes is lost because the goroutine
leaked (https://github.com/kubernetes/kubernetes/issues/129400).

Waiting for controller shutdown instead of relying on timing should fix this.

Kubernetes-commit: 8e1403563a60f3b7a258e3bbb64b5c3a7f6548fb
2024-12-29 12:18:50 +01:00
Davanum Srinivas
6584190087 Bump x/net to v0.33.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 0b6e3718340fa7e3846cf9b7d5a0f7a684a6fa5a
2024-12-20 14:30:57 -05:00
Kubernetes Publisher
ea791f2501 Merge pull request #126387 from pohly/log-client-go-tools-cache-apis
client-go/tools/cache: add APIs with context parameter

Kubernetes-commit: e305c3398896b04c0d3b58d64531f8a87f685f68
2024-12-18 21:52:29 +00:00
Tobias Klauser
9f31100789 Update generated clients after removing always-nil setConfigDefaults error return value
Kubernetes-commit: 2c24a12804ca0020e57592a6844f7c5874dffcfe
2024-12-15 23:19:18 +01:00
Kubernetes Publisher
67da6d1a41 Merge pull request #129212 from Jefftree/add-clientgo-readme
Add client-go README

Kubernetes-commit: cb93d6ee69b8d4ca8701336e4f7cb278751f34e4
2024-12-15 01:51:03 +00:00
Kubernetes Prow Robot
d5ac3dbddc Merge pull request #1394 from Jefftree/patch-1
Delete README.md
2024-12-14 15:58:43 +01:00
Kubernetes Publisher
61ee2c5802 Merge pull request #129213 from Jefftree/k-openapi
Bump kube-openapi

Kubernetes-commit: 13eb074ddd231d127709f0410185eeca68a69c8a
2024-12-14 01:51:28 +00:00
Jefftree
540fb4f698 bump kube-openapi
Kubernetes-commit: 3269f4bb94c58dfe577621c42f88ea06fbdd79a7
2024-12-13 20:50:49 +00:00
Jeffrey Ying
a6e6f66ef7 Delete README.md 2024-12-13 15:32:23 -05:00
Jefftree
ec0ec91b19 Add client-go README
Kubernetes-commit: 8f782fea93023a3faa43ad0c22f8c295f732a65b
2024-12-13 20:30:13 +00:00
Kubernetes Publisher
ab443a50c6 Merge pull request #128659 from saschagrunert/google-go-protobuf
Replace `github.com/golang/protobuf` with `google.golang.org/protobuf`

Kubernetes-commit: b1f2af04328936c2fa79db4af14f5c6ad9160748
2024-12-13 17:52:36 +00:00
Kubernetes Publisher
fae881e13f Merge pull request #129041 from aojea/flowcontrol
flowcontrol: remove test dependencies from go binaries

Kubernetes-commit: e8312395f09619d4808d6e4a78d85dc500a6ea15
2024-12-13 13:51:28 +00:00
Kubernetes Publisher
633c24cce5 Merge pull request #129195 from dims/update-x/crypto/ssh-dependency
Update x/crypto/ssh dependency to v0.31.0

Kubernetes-commit: b21ab179c74a270cd276d2dbb5f4b55730838096
2024-12-13 09:51:37 +00:00
Davanum Srinivas
e82d0c2ac7 Update x/crypto/ssh dependency
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 80735180ab2c61232dcc4646e693ddcaeaf96ca3
2024-12-12 20:46:15 -05:00
Antonio Ojea
92b4ec71fb flowcontrol: remove testing dependencies
The methods NewFakeClock were using a testing dependency as a parameter,
to avoid breaking compatibility and to remove this dependency, just use
the clock.Clock interface.

If we have to do it again most probable we have chosen other pattern and
for sure other names, but now is too late.

Kubernetes-commit: 5c283cbb453acac9869b49020f6f999796360729
2024-12-12 17:42:41 +00:00
Kubernetes Publisher
1df7a02c72 Merge pull request #129054 from pohly/remove-import-name
remove import doc comments

Kubernetes-commit: e8615e27125518f0ed0ba06244b7ecee21451bb0
2024-12-12 09:50:39 +00:00
Kubernetes Publisher
706280d1e7 Merge pull request #128753 from skitt/skitt-reviewer-client-go
Add myself to client-go reviewers

Kubernetes-commit: b50043e3123cdcb0f5912972a918bf476f1d295d
2024-12-12 05:51:54 +00:00
Patrick Ohly
1047529e64 client-go event: add WithContext expansion methods
Only the v1 API should be in use. The v1beta1 API therefore doesn't get updated
and doesn't need the context.TODO anymore.

Kubernetes-commit: f1834f06f4f7de8c6a5a70138cf08f8ca804f5c2
2024-12-09 17:41:14 +01:00
Kubernetes Publisher
8e21410d16 Merge pull request #129103 from liggitt/drop-winreadlinkvolume
Drop use of winreadlinkvolume godebug option

Kubernetes-commit: bfe431b53e600c9a36c46eef0f6ecfcf37265d60
2024-12-06 18:26:37 +00:00
Jordan Liggitt
e95e61cd4f Drop use of winreadlinkvolume godebug option
Kubernetes-commit: 3046fe23d4fe4ba86713ffd61bf0e07156b2b7c3
2024-12-06 02:40:53 -05:00
Kubernetes Publisher
f118320d13 Merge pull request #129083 from liggitt/go1.23windows
Revert to go1.22 windows filesystem stdlib behavior

Kubernetes-commit: 6fc64a261c1dca857a5a7fd1bc87fae38dbe1c8a
2024-12-04 22:23:15 +00:00
Jordan Liggitt
06af948aa5 Revert to go1.22 windows filesystem stdlib behavior
Kubernetes-commit: 3878a3a6de64660e356a35f70471c27a09698090
2024-12-04 09:52:56 -05:00
Patrick Ohly
70a4950f35 remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".

Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
2024-12-02 14:43:58 +01:00
Stephen Kitt
111d4bc2cc Add myself to client-go reviewers
Given the ongoing work on generifying client-go, it might make sense
for me to be a reviewer (at least to keep better track of changes
being made before they go in).

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

Kubernetes-commit: 3d069b2a8a6a635434331f96b79e44bc7c98f29c
2024-11-11 15:03:14 -07:00
Kubernetes Publisher
37045084c2 Merge pull request #126503 from skitt/generic-fake-client
Use generics to share code in fake client-go implementations

Kubernetes-commit: 31970d418ccae80c9c7e25e8c503035a79a53763
2024-11-08 17:54:43 +00:00
Stephen Kitt
eb282ed4ca Align fake client-go clients with the main interface
"Real" clients use objectWithMeta to enforce support for meta.Object;
strictly speaking, fakes don't need this, but it's best to align them
with the real clients to ensure that fakes don't end up allowing types
that can't be used with the real clients.

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

Kubernetes-commit: 736e5560ba6b21247c21f8ed12007e1d6d5fec1a
2024-11-08 10:42:12 +01:00
Sascha Grunert
be40e97e1a Replace github.com/golang/protobuf with google.golang.org/protobuf
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Kubernetes-commit: c1d0e870f4f45548c0d5b2bf83f36fb208252978
2024-11-07 12:47:08 +01:00
Stephen Kitt
646e79b061 Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: be03bcf3244e6c280b8aaf7a638d1926f0960eab
2024-08-01 12:10:10 +02:00
Stephen Kitt
c475fe0910 Generify fake clientsets
This adds a generic implementation of a fake clientset, and uses it to
replace the template code in generated fake clientsets for the default
methods. The templates are preserved as-is (or as close as they can
be) for use in extensions, whether for resources or subresources.

Fake clientsets with no extensions are reduced to their main getter,
their specific struct, and their constructor. All method
implementations are provided by the generic implementation. The
dedicated struct is preserved to allow extensions and expansions to be
defined where necessary.

Instead of handling the variants (with/without list, apply) with a
complex sequence of if statements, build up an index into an array
containing the various declarations.

Similarly, instead of calling different action constructors for
namespaced and non-namespaced clientsets, assume the current behaviour
of non-namespaced action creation (equivalent to creating a namespaced
action with an empty namespace) and document that assumption in the
action implementation.

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

Kubernetes-commit: b0ce65df9b74d4dc72050840d5ad067596d7b822
2024-07-30 15:47:02 +02:00
Kubernetes Publisher
955401ca9a Merge pull request #128407 from ndixita/pod-level-resources
[PodLevelResources] Pod Level Resources Feature Alpha

Kubernetes-commit: c25f5eefe4efda4c0d9561d06942cd3de3dfe2e4
2024-11-08 11:58:33 +00:00
Kubernetes Publisher
eddb107938 Merge pull request #127857 from Jefftree/cle-v1alpha2
Coordinated Leader Election add v1alpha2

Kubernetes-commit: 45260fd76aa7b2ceed16aea173ccb3f81e3ab98b
2024-11-08 11:58:30 +00:00
ndixita
77d9809f89 Generated files and compatability data from API changes
Kubernetes-commit: 85488b5f10bc6128dab69e4bdd94cec2c005c7f5
2024-10-16 20:34:52 +00:00
Jefftree
ef8b7aa53e generated
Kubernetes-commit: e86c38b249bb614c13210f1fe34fb92247641ef9
2024-10-04 15:53:28 +00:00
Jefftree
bf1a6eed35 v1alpha2 LeaseCandidate API
Kubernetes-commit: 0ce7b688a65a65031c6ee8c616989e4b0be4ce9f
2024-10-04 14:43:11 +00:00
Kubernetes Publisher
ec126553e2 Merge pull request #128240 from LionelJouin/KEP-4817
DRA: Implementation of ResourceClaim.Status.Devices (KEP-4817)

Kubernetes-commit: 4cf2818f964d8862db4399cb548060f72bea4ded
2024-11-08 11:58:27 +00:00
Kubernetes Publisher
fcfb2ba016 Merge pull request #127513 from tkashem/delete-undecryptable
KEP-3926: unsafe deletion of corrupt objects

Kubernetes-commit: 4d10ae8fdc579e2bb09789507cae7b8d32cbd306
2024-11-08 11:58:24 +00:00
Kubernetes Publisher
fe3db7fea6 Merge pull request #128681 from soltysh/client-go_port_forward_reset
Client go port forward reset, error handling and tests

Kubernetes-commit: 210deea063a5a778e8c3a8e32b8bc4c808b87835
2024-11-08 11:58:21 +00:00
Kubernetes Publisher
2d3b1e2feb Merge pull request #128356 from lauralorenz/crashloopbackoff-maintain10minuterecoverythreshold
KEP-4603: Maintain current 10 minute recovery threshold for container backoff regardless of changes to the maximum duration

Kubernetes-commit: ab30adcbae57fc498cb876979e232b422468af9a
2024-11-08 11:58:20 +00:00
Kubernetes Publisher
c57e0a82c3 Merge pull request #128641 from benluddy/e2e-cbor-client-compat
KEP-4222: Fix JSON fallback for clients using default content-type and add E2E client test.

Kubernetes-commit: 7243fa60e1c85d85bf5c129d09b7bd9bdfe24ccc
2024-11-08 11:58:17 +00:00
Lionel Jouin
fba42f0ac4 [KEP-4817] make update
Kubernetes-commit: d84c8d2a647aee3a7b0ac499a55e5f630c71d2a9
2024-11-07 22:19:09 +01:00
Lionel Jouin
bfbe175263 [KEP-4817] make update
Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>

Kubernetes-commit: d28b50e0a04a4c5bbf494a423ad7851f0393467c
2024-11-07 10:36:09 +01:00
Ben Luddy
49537610e8 Fix content type fallback when a client defaults to CBOR.
With the ClientsAllowCBOR client-go feature gate enabled, a 415 response to a CBOR-encoded REST
causes all subsequent requests from the client to fall back to a JSON request encoding. This
mechanism had only worked as intended when CBOR was explicitly configured in the
ClientContentConfig. When both ClientsAllowCBOR and ClientsPreferCBOR are enabled, an
unconfigured (empty) content type defaults to CBOR instead of JSON. Both ways of configuring a
client to use the CBOR request encoding are now subject to the same fallback mechanism.

Kubernetes-commit: a77f4c7ba2e761461daaf115a38903fc91916dd6
2024-11-07 00:05:03 -05:00
Kubernetes Publisher
c57dbd8dec Merge pull request #128503 from benluddy/cbor-codecs-featuregate
KEP-4222: Wire serving codecs to CBOR feature gate.

Kubernetes-commit: 6399c32669c62cfbf7c33b14b77d6781ce1cce27
2024-11-07 03:06:07 +00:00
Abu Kashem
e132ac21c9 handle watch for unsafe delete
Kubernetes-commit: 25efc8f2d136a9574166be02789ac727c5b4a3fd
2024-11-05 20:36:56 -05:00
Ben Luddy
334e30739d Wire serving codecs to CBOR feature gate.
Integration testing has to this point relied on patching serving codecs for built-in APIs. The
test-only patching is removed and replaced by feature gated checks at runtime.

Kubernetes-commit: 439d2f7b4028638b3d8d9261bb046c3ba8d9bfcb
2024-11-01 16:05:32 -04:00
Kubernetes Publisher
2d5ed6fa11 Merge pull request #128501 from benluddy/watch-cbor-seq
KEP-4222: Use cbor-seq content-type for CBOR watch responses.

Kubernetes-commit: a885e446d6f6f5530da4923a3872eb27ca47bdc0
2024-11-06 23:06:15 +00:00
Ben Luddy
10c2fdb7f4 Use application/cbor-seq media type in streaming CBOR responses.
The media type application/cbor describes exactly one encoded item. As a new (to Kubernetes) format
with no existing clients, streaming/watch responses will use the application/cbor-seq media
type. CBOR watch responses conform to the specification of CBOR Sequences and are encoded as the
concatenation of zero or more items with no additional framing.

Kubernetes-commit: 504f14998e920ca8837b3310094b3da11c62a070
2024-11-01 13:14:06 -04:00
Kubernetes Publisher
ae04abdbe9 Merge pull request #127511 from pohly/dra-1.32-api
DRA 1.32 API: promotion to beta

Kubernetes-commit: e273349f3a2fde9a2499902645e8f10001c899bf
2024-11-06 15:06:18 +00:00
Patrick Ohly
4e05c623ae DRA API: rename DeviceCapacity.Quantity to DeviceCapacity.Value
Based on review
feedback (https://github.com/kubernetes/kubernetes/pull/127511#discussion_r1823521172).

Kubernetes-commit: 30f52826560129839922e1756730b02f184f0ef9
2024-10-31 21:30:28 +01:00
Laura Lorenz
ab2cdceca1 Maintain 10 minute recovery threshold for container backoff
Signed-off-by: Laura Lorenz <lauralorenz@google.com>

Kubernetes-commit: a0b83a774102a6d8ce03ce03c9d0431b44559019
2024-10-26 02:17:23 +00:00
Maciej Szulik
bf414551df Clean error handling in port-forward
This commit introduces:
1. Cleanups in port-forwarding error handling code, which ensures that
   we only compare lowercased text always.
2. E2E verifying that when a pod is removed a port-forward is stopped.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 0b1617ccefbc6ea61c0e7c2b0b4052703f11c51c
2024-10-16 14:02:01 +02:00
Nic
d6404c8d76 fix: draining remote stream after port-forward connection broken
Signed-off-by: Nic <qianyong@api7.ai>

Kubernetes-commit: dbe6b6657bacc846656f4009ee869ca996dde1da
2024-10-04 14:48:15 +08:00
Patrick Ohly
f65974c297 DRA API: use DeviceCapacity struct instead of plain Quantity
This enables a future extension where capacity of a single device gets consumed
by different claims. The semantic without any additional fields is the same as
before: a capacity cannot be split up and is only an attribute of a device.

Because its semantically the same as before, two-way conversion to v1alpha3 is
possible.

Kubernetes-commit: 81fd64256c9cfca47385997e06a694bf98bfb799
2024-09-26 16:56:48 +02:00
Patrick Ohly
98e4506ad9 DRA API: generated files
Kubernetes-commit: 0ee52b23cd56aa4a8e33cc366c2d150286ad041e
2024-09-26 12:07:39 +02:00
Kubernetes Publisher
e6df85f02b Merge pull request #128266 from AnishShah/resize-subresource
[FG:InPlacePodVerticalScaling] Introduce  /resize subresource to request pod resource resizing

Kubernetes-commit: 648717cc740cafbce778e983f195dc6879bf22e3
2024-11-06 11:05:54 +00:00
Anish Shah
db23975bde client-go: rename Resize to UpdateResize
Kubernetes-commit: 79f45bce19d1d832cc30812b8cf2a192ebe76d97
2024-10-29 21:09:47 +00:00
Anish Shah
951bba35c5 update codegen
Kubernetes-commit: 277edcdb485cf6a7fae0da48489e0632438c0a8a
2024-10-24 23:52:49 +00:00
Anish Shah
fc589c225c api: generate client code for resize subresource
Kubernetes-commit: d9a1d861f7cec8c00a034e67a8d7d34aaebd76e8
2024-10-22 12:20:31 -07:00
Kubernetes Publisher
9d76eb1606 Merge pull request #128539 from benluddy/cbor-feature-gates
KEP-4222: Add CBOR feature gates.

Kubernetes-commit: a28f14089cfa47ef9c57f9f283e1504a68f616d6
2024-11-06 03:05:49 +00:00
Kubernetes Publisher
c1010ffd7d Merge pull request #128580 from jpbetz/bump-kube-openapi
Bump kube-openapi to latest

Kubernetes-commit: 9a2a7537f035969a68e432b4cc276dbce8ce1735
2024-11-05 23:05:42 +00:00
Kubernetes Publisher
6d45801000 Merge pull request #127134 from jpbetz/mutating-admission
KEP-3962: MutatingAdmissionPolicy Alpha

Kubernetes-commit: 2d6c8a129df97caf5bda3a186a8f7f3e41591352
2024-11-05 19:05:46 +00:00
Joe Betz
48c6947370 hack/pin-dependency.sh k8s.io/kube-openapi 32ad38e42d3faf1ce94eb29f4ea6d763339b258e
Kubernetes-commit: f2157ff73e3c9b7c2a36bf371e388e8976d93975
2024-11-05 10:18:57 -05:00
Kubernetes Publisher
3fc0d17041 Merge pull request #128396 from ritazh/deprecate-EnforceMountableSecretsAnnotation
deprecate EnforceMountableSecretsAnnotation in 1.32

Kubernetes-commit: bc79d3ba87b8b3c4b7c68f26cdfcaa35654d96ac
2024-11-05 07:05:36 +00:00
Kubernetes Publisher
f6b680711f Merge pull request #128552 from aojea/package_kubernete_test
fix package name

Kubernetes-commit: e5a31e8bbc67857aaf9270ad15f672806dbd88e2
2024-11-05 04:45:28 +00:00
Antonio Ojea
1f96e45488 fix package name
Kubernetes-commit: 3424e7df46dccf0d7e49d325484539f777b3f0c0
2024-11-04 23:58:59 +00:00
Kubernetes Publisher
3a268848dc Merge pull request #128547 from aojea/rest_watch
rest client watch: use same name for package as folder

Kubernetes-commit: 19d56296aab8cf6f94d327466f5e9bb1488f5a83
2024-11-05 03:06:00 +00:00
Kubernetes Publisher
be38ea1eb5 Merge pull request #127981 from jsafrane/selinux-changepolicy
1710: Implement SELinuxChangePolicy

Kubernetes-commit: 97c79df18f8552facf63682b23d9380253972d48
2024-11-04 23:06:06 +00:00
Kubernetes Publisher
2ff887486f Merge pull request #128507 from dims/use-k8s.io/utils/lru-instead-of-github.com/golang/groupcache/lru
Use k8s.io/utils/lru instead of github.com/golang/groupcache/lru

Kubernetes-commit: 7a4d755644e83dfade7bbc4c240c204a9e54d9c0
2024-11-04 23:06:04 +00:00
Antonio Ojea
d69191cc45 rest client watch: use same name for package as folder
Kubernetes-commit: 8e1d0c664c60c094605f692360213b0284cdbe0f
2024-11-04 19:56:55 +00:00
Ben Luddy
8cb21671f4 Add CBOR feature gates.
For alpha, there is one apiserver feature gate and two client-go feature gates controlling
CBOR. They were initially wired to separate test-only feature gate instances in order to prevent
them from being configurable at runtime via command-line flags or environment variables (for
client-go feature gates outside of Kubernetes components). All of the integration tests required by
the KEP as alpha criteria have been implemented. This adds the feature gates to the usual feature
gate instances and removes the temporary code to support separate test-only feature gate instances.

Kubernetes-commit: 072dfcb416fd4e1ddab0a89ac4faf519e268bc96
2024-11-04 10:40:19 -05:00
Davanum Srinivas
6c84382029 Use k8s.io/utils/lru instead of github.com/golang/groupcache/lru
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 2b0592ee77d0a0bb3017df042066ecb8c83d2fb3
2024-11-01 22:19:11 -04:00
Kubernetes Publisher
67554141e0 Merge pull request #128497 from benluddy/cbor-request-contenttype-circuit-breaker
KEP-4222: Fall back to JSON request encoding after CBOR 415.

Kubernetes-commit: 3f5d0ee2cf402d10233fc403750a9784d1542059
2024-11-01 23:05:40 +00:00
Kubernetes Publisher
b3f6edec9a Merge pull request #127743 from googs1025/cleanup/leaderelection
chore(leader-election): modify leader-election comment to OnStoppedLeading callback is always called when the LeaderElector exits, even if it did not start leading.

Kubernetes-commit: 1a7326902fa07b85e07de458dd2d4d4d99057d87
2024-11-01 19:05:46 +00:00
Kubernetes Publisher
d680385f61 Merge pull request #128481 from carlory/dependencies-ginkgo-gomega
dependencies: ginkgo v2.21.0, gomega v1.35.1

Kubernetes-commit: 88a997ac01cd8a386df9318d81b89257307f53fb
2024-11-01 19:05:45 +00:00
carlory
d99919f3ff dependencies: ginkgo v2.21.0, gomega v1.35.1
Kubernetes-commit: 80b1a297865500891bd823005ace761becae5dbf
2024-11-01 11:35:24 +08:00
Kubernetes Publisher
c5d71b267c Merge pull request #128416 from jpbetz/reset-filter
Add optional ResetFieldsFilterStrategy interface for storage

Kubernetes-commit: b831df733e5cf244331f61fffb0ba86787b27236
2024-11-01 03:16:53 +00:00
Joe Betz
10f459626d hack/pin-dependency.sh sigs.k8s.io/structured-merge-diff/v4 v4.4.2
Kubernetes-commit: 6fe51403665f1b6e820226004817b92e3118cabc
2024-10-31 21:19:15 -04:00
Kubernetes Publisher
6ba2fc71bc Merge pull request #128273 from benluddy/cbor-apply
KEP-4222: Support CBOR encoding for apply requests.

Kubernetes-commit: 16f9fdc7057e1f69ff1a44e3dbbcf7b994c3cd29
2024-10-30 18:50:32 +00:00
Kubernetes Publisher
d7104c6737 Merge pull request #127266 from pohly/dra-admin-access-in-status
DRA API: AdminAccess in DeviceRequestAllocationResult + DRAAdminAccess feature gate

Kubernetes-commit: daef8c2419a638d3925e146d0f5a6b217ea69b74
2024-10-30 06:50:17 +00:00
Ben Luddy
b0bd1f5b29 Regenerate clients to support application/apply-patch+cbor.
Kubernetes-commit: 41f55d711781c48d8b1365bce087009ceef2f1e9
2024-10-29 13:38:12 -04:00
Patrick Ohly
d86bbaef58 DRA: treat AdminAccess as a new feature gated field
Using the "normal" logic for a feature gated field simplifies the
implementation of the feature gate.

There is one (entirely theoretic!) problem with updating from 1.31: if a claim
was allocated in 1.31 with admin access, the status field was not set because
it didn't exist yet. If a driver now follows the current definition of "unset =
off", then it will not grant admin access even though it should. This is
theoretic because drivers are starting to support admin access with 1.32, so
there shouldn't be any claim where this problem could occur.

Kubernetes-commit: 4419568259590c35f1dab69aabec3d740944a51d
2024-10-29 09:42:08 +01:00
Rita Zhang
f77b3993b9 deprecate EnforceMountableSecretsAnnotation in 1.32
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>

Kubernetes-commit: e7cdc595551954d6b87a859296eb09fddd01f3c9
2024-10-28 08:01:33 -07:00
Joe Betz
b5002f17ec Update OpenAPI and fix openAPI tests to handle unexported jsonreferences
Co-authored-by: Alexander Zielensk <alexzielenski@gmail.com>

Kubernetes-commit: 700e3b566428bca46d2d37514c8fd7af60c7ff34
2024-10-25 13:51:03 -04:00
Joe Betz
5295d256f6 generate code
Kubernetes-commit: fe3a7f529153db690ac8588ee9c31bdfda0ed5f8
2024-10-25 13:46:37 -04:00
Ben Luddy
15af21a2ae Fall back to JSON request encoding after CBOR 415.
If a client is configured to encode request bodies to CBOR, but the server does not support CBOR,
the server will respond with HTTP 415 (Unsupported Media Type). By feeding this response back to the
RESTClient, subsequent requests can fall back to JSON, which is assumed to be acceptable.

Kubernetes-commit: 1745dfdd154b1a838765e70b81c861c644bfcffe
2024-10-22 17:40:08 -04:00
Ben Luddy
cff56219d9 Support application/apply-patch+cbor in patch requests.
Kubernetes-commit: 37ed906a33211c7d578cab2d681941ebfd2f2f23
2024-10-22 16:08:24 -04:00
Jan Safranek
f0b2234e53 Regenerated API
Kubernetes-commit: 3867cb40add0cfc41157e9fd11f2377cda7d3770
2024-10-03 11:13:07 +02:00
googs1025
1b8aded77b chore(leader-election): modify leader-election comment to OnStoppedLeading callback is always called when the LeaderElector exits, even if it did not start leading.
Kubernetes-commit: 7d2fbc7cfd49bca7d58160ed25dfd1f838629bb9
2024-09-30 09:38:10 +08:00
Abu Kashem
95fc3d7e88 api: run codegen
run 'make update' to code gen for changes in meta/v1 DeleteOptions

Kubernetes-commit: aff05b0bcad2b62730e101067a04ffc75a96a41b
2024-09-23 13:29:15 -04:00
Patrick Ohly
d32193115c DRA API: AdminAccess in DeviceRequestAllocationResult
Drivers need to know that because admin access may also grant additional
permissions. The allocator needs to ignore such results when determining which
devices are considered as allocated.

In both cases it is conceptually cleaner to not rely on the content of the
ClaimSpec.

Kubernetes-commit: f3fef01e79a75ebc4c327afb7d05d6fd350e08fa
2024-09-04 08:03:22 +02:00
Kubernetes Publisher
a887e579c0 Merge pull request #128323 from benluddy/cbor-client-gen
KEP-4222: Support CBOR for generated clients based on client-go feature gating.

Kubernetes-commit: 30ee35516b10120590bcc35ee8b4d8113493ddee
2024-10-29 17:46:14 +00:00
Ben Luddy
886262a3de Update vendor (client now calls ParseAccept from goautoneg).
Kubernetes-commit: 969357b99cd09d47d8a2d7073287f7316f3e6239
2024-10-28 11:22:59 -04:00
Ben Luddy
c957b59518 Wire client feature gates affecting RESTClient content config.
Kubernetes-commit: 67b9dc1f3e23529804345deea76d36d07dff59b1
2024-10-25 11:50:01 -04:00
Ben Luddy
9d19c65cdb Update generated clients.
Kubernetes-commit: 8fb9622b882496dad1e91103dd15fff7fc2658e0
2024-10-24 16:50:48 -04:00
Ben Luddy
d8fc5bb524 Make generated client codecs support CBOR based on feature gate.
Kubernetes-commit: 57e337dbbf9e437bcb350d6551689669bb79d579
2024-10-24 16:38:45 -04:00
Kubernetes Publisher
3dc7fd5f4c Merge pull request #128243 from benluddy/cbor-dynamic-integration
KEP-4222: Add CBOR variant of admission webhook integration test.

Kubernetes-commit: 5147eebf224ae41892b736179ca91c47fd794565
2024-10-25 01:56:21 +00:00
Kubernetes Publisher
abe0e99c21 Merge pull request #125314 from enj/enj/i/proto_for_core
Use protobuf for core clients

Kubernetes-commit: 7b7a7968d4c90c4430b1009546e13ce78bcde134
2024-10-24 17:56:17 +00:00
Ben Luddy
1cca19dc02 Add test-only client feature gates for CBOR.
As with the apiserver feature gate for CBOR as a serving and storage encoding, the client feature
gates for CBOR are being initially added through a test-only feature gate instance that is not wired
to environment variables or to command-line flags and is intended only to be enabled
programmatically from integration tests. The test-only instance will be removed as part of alpha
graduation and replaced by conventional client feature gating.

Kubernetes-commit: ea13190d8bd3a4bb3e82055b529aa7599ae5c6e1
2024-10-23 16:36:37 -04:00
Monis Khan
86e81b0a37 Generated
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 032e7f1556c74dbc25b5ed9368b2e86e26ba774f
2024-10-23 15:33:57 +00:00
Monis Khan
6f44458e5e Use protobuf for core clients
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: c2ae465355b5222dbc27b8de8c55095b4f1b431a
2024-08-19 10:37:15 -04:00
Monis Khan
1647efd5c4 client-go/rest: move content type wiring from client to request
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: fe1eda0649fdb6a15200d279be214c67246d3b12
2024-08-18 15:01:57 -04:00
Kubernetes Publisher
c5146a9031 Merge pull request #126697 from fedebongio/patch-1
Update OWNERS file in client-go/tools/leaderelection adding jefftree

Kubernetes-commit: 16dca1c330392f26f3421fd4cd7ee3d691b93213
2024-10-23 06:07:56 +00:00
Kubernetes Publisher
f05f3ca8bc Merge pull request #125516 from ComingCL/master
fix typo errors in client-go rest package

Kubernetes-commit: 367e7e889b993cedc5f775fba9782010f7219fc9
2024-10-23 01:56:27 +00:00
Federico Bongiovanni
65ed08a834 Update OWNERS
Adding  jefftree also to the reviewers list

Kubernetes-commit: 5f052ada19c43471bdcbb6da4e6f72405ca46bd7
2024-10-22 16:26:30 -07:00
Kubernetes Publisher
23900f4929 Merge pull request #128165 from liggitt/prune-self-require
Drop self-referencing replace directives

Kubernetes-commit: a8fc7ae761c19ab436cf513c9eed877f08961cf7
2024-10-18 04:29:40 +00:00
Kubernetes Publisher
6a276b2b95 Merge pull request #128003 from pohly/dra-classic-dra-removal
DRA: remove "classic DRA"

Kubernetes-commit: b1b4e5d397e303cf7a2a3fb02e90f40536da5896
2024-10-18 00:29:00 +00:00
Jordan Liggitt
607869c7d9 Drop self-referencing replace directives
Kubernetes-commit: 3be1109829d4b0921972bb8b5f66a4d179ff6255
2024-10-17 15:51:15 -04:00
Patrick Ohly
d366fa7737 DRA: remove "classic DRA"
This removes the DRAControlPlaneController feature gate, the fields controlled
by it (claim.spec.controller, claim.status.deallocationRequested,
claim.status.allocation.controller, class.spec.suitableNodes), the
PodSchedulingContext type, and all code related to the feature.

The feature gets removed because there is no path towards beta and GA and DRA
with "structured parameters" should be able to replace it.

Kubernetes-commit: f84eb5ecf894fa0fc4e0d05da52ef51d4cd723d9
2024-10-11 16:08:54 +02:00
Kubernetes Publisher
235936510e Merge pull request #128064 from dims/update-to-last-versions-of-some-very-infrequently-updated-repos
Update to last versions of some very infrequently updated repos

Kubernetes-commit: 07e73682b9a5259cacac978346ed4567588e4165
2024-10-16 06:00:06 +00:00
Kubernetes Publisher
43e9ea4bb5 Merge pull request #124059 from benluddy/dynamic-client-negotiation
Use content negotiation in the dynamic client.

Kubernetes-commit: c360a2c75c6e2a6a66bc5c6d37b30a4171b408da
2024-10-15 18:23:03 +01:00
Davanum Srinivas
e4db112974 Update to last versions of some very infrequently updated repos
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 7f8210e33f8cd626d1fb86cd7d12d077ec3047d5
2024-10-14 17:23:16 -04:00
Federico Bongiovanni
29ce700614 Update staging/src/k8s.io/client-go/tools/leaderelection/OWNERS
Co-authored-by: Benjamin Elder <bentheelder@google.com>

Kubernetes-commit: d20bc10645e716034e91d365d17d8b1011d3f1cd
2024-08-14 13:21:52 -07:00
Federico Bongiovanni
3c2f0814df Update OWNERS
Adding jefftree to the owners file for leaderelection

Kubernetes-commit: b5bbc1508f986df7811dd79e7b5116bbede784e8
2024-08-14 12:16:59 -07:00
Patrick Ohly
5d289bc44c client-go/tools/cache: add APIs with context parameter
The context is used for cancellation and to support contextual logging.

In most cases, alternative *WithContext APIs get added, except for
NewIntegerResourceVersionMutationCache where code searches indicate that the
API is not used downstream.

An API break around SharedInformer couldn't be avoided because the
alternative (keeping the interface unchanged and adding a second one with
the new method) would have been worse. controller-runtime needs to be updated
because it implements that interface in a test package. Downstream consumers of
controller-runtime will work unless they use those test package.

Converting Kubernetes to use the other new alternatives will follow. In the
meantime, usage of the new alternatives cannot be enforced via logcheck
yet (see https://github.com/kubernetes/kubernetes/issues/126379 for the
process).

Passing context through and checking it for cancellation is tricky for event
handlers. A better approach is to map the context cancellation to the normal
removal of an event handler via a helper goroutine. Thanks to the new
HandleErrorWithLogr and HandleCrashWithLogr, remembering the logger is
sufficient for handling problems at runtime.

Kubernetes-commit: 4638ba971661497b147906b8977ae206c9dd6e44
2024-07-26 15:26:00 +02:00
Patrick Ohly
b836a27b07 client-go/tools/cache: goroutine leak checking
Several tests leaked goroutines. All of those get fixed where possible
without API changes. Goleak is used to prevent regressions.

One new test specifically covers shutdown of an informer and its event
handlers.

Kubernetes-commit: 0ba43734b4c8998b4aaeb1fa2bec8dee609fa50a
2024-11-28 17:59:36 +01:00
ComingCL
de60f3ccb5 fix typo errors in client-go rest package
Kubernetes-commit: faf891ad2d6dd1706932c8cf8774b2c7fb2b4bb1
2024-06-15 00:28:03 +08:00
0xMALVEE
8410e24e31 testes written for cache/listers.go
Kubernetes-commit: 8e8770961616369ac47149c69e7dc29562578d51
2024-05-23 23:40:18 +06:00
Ben Luddy
ee51eaf9d0 Use content negotiation in the dynamic client.
Kubernetes-commit: 97958d96a2911c8b1df324868f4730b1c622c798
2024-02-15 17:47:19 -05:00
Kubernetes Publisher
c38ce11939 Merge pull request #127812 from p0lyn0mial/upstream-decode-list-blueprint
client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests

Kubernetes-commit: a454563a8d5a93ae0288244eb63649e26e509991
2024-10-14 14:00:33 +00:00
Kubernetes Publisher
9cff3e43bd Merge pull request #128035 from alexanderstephan/export-reflector
Make getter names for reflector fields idiomatic

Kubernetes-commit: 4dc7a48ac6fb631a84e1974772bf7b8fd0bb9c59
2024-10-14 01:59:24 +00:00
Alexander Stephan
ce42c297f4 Make getter names for reflector fields idiomatic
Kubernetes-commit: fdabcb5141094cb99afde24ec1df15026b4ba349
2024-10-13 20:53:25 +00:00
Kubernetes Publisher
64f5574f09 Merge pull request #127998 from skitt/golang-x-oct-2024
October 2024 golang.org/x bump

Kubernetes-commit: 8cbb11519c54c120e2dc120a4799e53abbfea4a4
2024-10-11 14:00:21 +00:00
Kubernetes Publisher
2717ef67e3 Merge pull request #127985 from dims/update-moby-runc-dependencies-oct-10
Update moby/runc dependencies

Kubernetes-commit: 6e5e8f374e834fa8dab341bde5c522704ed55ba6
2024-10-11 14:00:19 +00:00
Stephen Kitt
9f84a0d8ed October 2024 golang.org/x bump
Nothing major here, but nothing liable to cause pain to downstreams
either.

* https://github.com/golang/crypto/compare/v0.26.0...v0.28.0 (there’s
  a SHA3 fix there but it’s only relevant for 32-bit platforms)
* https://github.com/golang/net/compare/v0.28.0...v0.30.0 (mostly
  http2; route address parsing fix on Darwin)
* https://github.com/golang/oauth2/compare/v0.21.0...v0.23.0 (Google
  license fix)
* https://github.com/golang/sys/compare/v0.23.0...v0.26.0 (faster
  getrandom() on Linux through the vDSO; improved RISC-V support)
* https://github.com/golang/term/compare/v0.23.0...v0.25.0
* https://github.com/golang/time/compare/v0.3.0...v0.7.0 (0-limit
  handling fix in x/time/rate; Google license fix)
* https://github.com/golang/tools/compare/v0.24.0...v0.26.0

This doesn’t include golang.org/x/exp; that doesn’t have any relevant
changes. There’s an apidiff fix but we always pull in the latest
apidiff anyway.

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

Kubernetes-commit: 6c5a528727c30803d4426b29c06ae5d350619877
2024-10-11 10:22:13 +02:00
Davanum Srinivas
6b8f524c7c Update moby/runc dependencies
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 521f2d106b9c5744ce57a8ec03124bcdadbca986
2024-10-10 11:58:22 -04:00
Kubernetes Publisher
d13452aae7 Merge pull request #127485 from seans3/websocket-upgrade-error-info
Upgrade websocket failure add extra error info

Kubernetes-commit: 5c96d8d34d44d5c03b206c9e48c8794730692dae
2024-10-11 02:00:19 +01:00
Lukasz Szaszkiewicz
d274c7ba36 client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests
Kubernetes-commit: 7be192ae0bd5d9628c5ee37c2e8b843d602c0fa3
2024-10-02 15:03:39 +02:00
Sean Sullivan
3cd3050ffd Upgrade websocket failure add extra error info
Kubernetes-commit: eec2be81681c5ad147df13aad60a003af0c4c48f
2024-09-19 15:47:19 -07:00
Kubernetes Publisher
cd6681f3c4 Merge pull request #127942 from liggitt/json123
sigs.k8s.io/json go 1.23 bump

Kubernetes-commit: fc318e3ba4cb1db822d7f802993059846f64179d
2024-10-10 21:56:10 +00:00
Jordan Liggitt
bbcb9ac523 Update sigs.k8s.io/json to go1.23
Kubernetes-commit: 8eff759b6ac7c3bb0c6a8823c751f5a578d6f721
2024-10-10 11:00:11 -04:00
Kubernetes Publisher
cae730524e Merge pull request #127944 from antoninbas/use-generics-for-delaying-queue-waitFor
Use generics for waitFor (delaying workqueue) in client-go

Kubernetes-commit: f7fef0384ec1c666e6b68cae83a3b3c6d95aa7b0
2024-10-09 09:55:50 +00:00
Kubernetes Publisher
ba20fcad8f Merge pull request #127663 from alexanderstephan/export-reflector
Export name and typeDescription members of reflector struct

Kubernetes-commit: 95ec69c16c76b5ee71fdbebc7a5dea2c39341eb3
2024-10-09 01:56:00 +00:00
Antonin Bas
3c28f81659 Use generics for waitFor (delaying workqueue) in client-go
With this change, we can typically avoid an extra heap allocation when
calling AddAfter with a positive duration (which causes the creation of
a waitFor object). This is because workqueues are typically used with
string keys, and casting a string (or more generally, non-pointer types)
to an `interface{}` will cause an heap escape / allocation.

Ater this change, there is no longer any usage of `type t interface{}`,
which was creating some confusion after the switch to generics in the
workqueue package.

Co-authored-by: Quan Tian <quan.tian@broadcom.com>
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>

Kubernetes-commit: 53ddffb55709857fec6bddbd5ca4ca1b03f7da97
2024-10-08 15:12:11 -07:00
Kubernetes Publisher
0dfea60d7a Merge pull request #127710 from alvaroaleman/document
RestCfg: Add godocs on how to disable ratelimiting

Kubernetes-commit: b2031b3cb46e946ee72eab7bda87b046db138d62
2024-10-08 10:20:58 +00:00
Kubernetes Publisher
5fceb99b61 Merge pull request #127635 from antoninbas/use-generics-for-queue-metrics
Use generics for workqueue metrics

Kubernetes-commit: 8461e630acd90a9eeebc7ffffefd81003be394bc
2024-10-08 10:20:56 +00:00
Alvaro Aleman
7416b2ea43 RestCfg: Add godocs on how to disable ratelimiting
I frequently find myself in the situation of not remembering which of
QPS/Burst I have to set. This change adds a small go doc to clarify
that.

Kubernetes-commit: cd1645ff2c195fbb353cfabcbc36e3c3b883c3c5
2024-09-27 10:34:15 -04:00
Alexander Stephan
146d03f559 Export name and typeDescription members of reflector struct
Kubernetes-commit: 154b8aa8806d743c41d1acf0b498bdecf1767872
2024-09-26 15:09:59 +00:00
Antonin Bas
5b31113588 Use generics for workqueue metrics
The workqueue implementation was recently updated to be strongly typed,
using Go generics. However the metrics implementation was not updated,
and continued using interface{}. This translated to unnecessary memory
allocations when invoking the queueMetrics interface methods to track
queue operation. We can avoid these extra heap allocations by using
generics for the metrics implementation as well.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>

Kubernetes-commit: 1aec7568e111f5855121e3afacacf431e5f95948
2024-09-25 14:35:03 -07:00
Kubernetes Publisher
ca4a13f6de Merge pull request #127827 from skitt/client-go-obsolete-plugins
client-go: remove obsolete auth plugins from examples

Kubernetes-commit: 8c2255657a7288386dc52acbaba81536bd1ac2d3
2024-10-03 21:30:27 +01:00
Stephen Kitt
105983d93c client-go: remove obsolete auth plugins from examples
The azure and gcp plugins no longer do anything other than point to
the corresponding external credential plugins. Client code should no
longer try to load them, so they should be removed from the examples.

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

Kubernetes-commit: 4531c6de760ec42941d9f509103f1b29c88bfae0
2024-10-03 11:08:52 +02:00
Kubernetes Publisher
3ecd72cc0b Merge pull request #127099 from jpbetz/object-selectors-ga
Add filtered informers tests for CRD field selectors

Kubernetes-commit: c5f2fc05ad5ef3d68f35263f9f965101b371b8cc
2024-10-02 02:00:09 +00:00
Kubernetes Publisher
415a0d6789 Merge pull request #127765 from alvaroaleman/fix
Fix accidental breaking change in TypedNewDelayingQueue

Kubernetes-commit: 35065cb5948fca4411007a25642b88d4b0aa60ff
2024-10-01 06:31:25 +00:00
Alvaro Aleman
71640ef872 Fix accidental breaking change in TypedNewDelayingQueue
It was added for compatibility reason but ended up getting a `config`
argument by accident, resulting in not actually being compatible, this
change fixes that.

Kubernetes-commit: 6933c1bc229c196e9c71061e19a0cdc76adb1dbc
2024-09-30 18:33:30 -04:00
Kubernetes Publisher
46093399c4 Merge pull request #127689 from mmorel-35/testifylint/expected-actual@k8s.io/client-go
fix: enable expected-actual rule from testifylint in module `k8s.io/client-go`

Kubernetes-commit: 93f82d25a5b10577116e4a72f77fb5e635e65490
2024-09-29 08:25:23 +00:00
Kubernetes Publisher
ea4f3d0f6f Merge pull request #127682 from mmorel-35/testifylint/nil-compare@k8s.io/client-go
fix: enable error-nil and nil-compare rules from testifylint in module `k8s.io/client-go`

Kubernetes-commit: 0661f1b5b3b1b292ebadc14a462d1a29e75fbce6
2024-09-28 20:25:09 +00:00
Kubernetes Publisher
2d7a47c42b Merge pull request #126764 from liggitt/mergo
reimplement merge to drop mergo dependency

Kubernetes-commit: ee74baec6e05afde972f1a8705d4f8efe066f120
2024-09-28 08:24:59 +00:00
Kubernetes Publisher
e2b5fa74cd Merge pull request #127535 from mmorel-35/testifylint/contains@k8s.io/client-go
fix: enable contains rule from testifylint in module `k8s.io/client-go`

Kubernetes-commit: a9cc5030f82bb8cc85f432cf64d315f4583afd09
2024-09-28 04:25:59 +00:00
Kubernetes Publisher
374753a638 Merge pull request #127539 from mmorel-35/testifylint/error-is-as@k8s.io/client-go
fix: enable error-is-as rule from testifylint in module `k8s.io/client-go`

Kubernetes-commit: 04ff7bd30397a12322b10294953673cca8c02db0
2024-09-28 04:25:58 +00:00
Matthieu MOREL
9d7f486102 fix: enable expected-actual rule from testifylint in module k8s.io/client-go
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Kubernetes-commit: 8286a69034d58e1ceafd6a6e5590bfcebd920b5b
2024-09-27 07:48:55 +02:00
Matthieu MOREL
84137c2466 fix: enable error-nil and nil-compare rules from testifylint in module k8s.io/client-go
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Kubernetes-commit: 71ced25f44dce83297388ca8ac0aa60afb93b009
2024-09-27 07:28:52 +02:00
Kubernetes Publisher
dfbc1c7fb1 Merge pull request #125917 from skitt/drop-auth-path-kubernetes-auth
Drop references to auth-path and kubernetes_auth

Kubernetes-commit: 61c408a7d90ecceed0687644f17c220e0eb946f0
2024-09-25 20:25:07 +00:00
Kubernetes Publisher
d79bc2831e Merge pull request #127466 from guozheng-shen/fix-return
endpointsLeasesResourceLock and configMapsLeasesResourceLock  has been removed

Kubernetes-commit: 36bbdd692f6df76710d9568aebf9778f34dc7061
2024-09-25 16:26:40 +00:00
Lukasz Szaszkiewicz
5395fd1e28 adds watchListEndpointRestrictions for watchlist requests (#126996)
* endpoints/handlers/get: intro watchListEndpointRestrictions

* consistencydetector/list_data_consistency_detector: expose IsDataConsistencyDetectionForListEnabled

* e2e/watchlist: extract common function for adding unstructured secrets

* e2e/watchlist: new e2e scenarios for convering watchListEndpointRestrict

Kubernetes-commit: ae35048cb0b9b177891aab41346b6d6cc504582f
2024-09-25 12:26:22 +00:00
Kubernetes Publisher
def003bc95 Merge pull request #127573 from benluddy/dynamic-golden-response-test
Add test for unintended changes to dynamic client response handling.

Kubernetes-commit: 56071089e274c21db051b4ca400cc1db730e8f42
2024-09-24 17:26:01 +01:00
Matthieu MOREL
baf58c3d79 fix: enable error-is-as rule from testifylint in module k8s.io/client-go
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Kubernetes-commit: a28c2b6bf8657889c18b683dd42044559a96c304
2024-09-22 12:21:05 +02:00
Matthieu MOREL
c2ecdf4169 fix: enable contains rule from testifylint in module k8s.io/client-go
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Kubernetes-commit: f50a173bec32cd01b5f9d749c5c8a57aef732d42
2024-09-22 11:57:09 +02:00
guozheng-shen
4d28b8364c endpointsLeasesResourceLock and configMapsLeasesResourceLock are removed too
Kubernetes-commit: a302abb32fc94842c421a4082dfb52be07b16c34
2024-09-19 14:02:52 +08:00
Ben Luddy
08c6c3148c Add test for unintended changes to dynamic client response handling.
The goal is to increase confidence that a change to the dynamic client does not unintentionally
introduce subtle changes to objects returned by dynamic clients in existing programs.

Kubernetes-commit: c8b1037a58ab6ddc3a8b237938eca2f6336abb73
2024-09-16 10:10:49 -04:00
Kubernetes Publisher
fcb1b60516 Merge pull request #127527 from mmorel-35/testifylint/compares@k8s.io/client-go
fix: enable compares rule from testifylint in module k8s.io/client-go

Kubernetes-commit: 6bd57ffc5c107a2109b73026515551a81eab33f2
2024-09-22 21:25:59 +01:00
Matthieu MOREL
290f054d9b fix: enable compares rule from testifylint in module
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Kubernetes-commit: 407d74fb6a563951045287338a6c64a79fcad8ec
2024-09-21 21:23:07 +02:00
Kubernetes Publisher
8887e59dfb Merge pull request #126760 from ncdc/ncdc/emeritus
Move ncdc to emeritus

Kubernetes-commit: f9a57ba82d05a8b9f442092f0b391ae8bd74287c
2024-09-20 20:24:41 +00:00
Kubernetes Publisher
40a93af788 Merge pull request #127422 from srivastav-abhishek/go-vet-fix
Go vet fixes for gotip

Kubernetes-commit: f2700895a4315014c56bfe1db7fb1562a61a8b50
2024-09-20 16:24:41 +00:00
Kubernetes Publisher
4f57ad3204 Merge pull request #127388 from p0lyn0mial/upstream-watchlist-meta-client
metadata client: add support for API streaming 

Kubernetes-commit: 1874039f8269dde591dc736507f5bca6f4cb8972
2024-09-17 21:54:44 +01:00
Lukasz Szaszkiewicz
b42d55bc18 client-go/metadata: use watchlist
Kubernetes-commit: 0912e400cda2dd6ef6950dea15b18f826777ac41
2024-09-16 12:00:11 +02:00
Lukasz Szaszkiewicz
892e9b89df client-go/metadata: add watchlist method
Kubernetes-commit: 3a0aa1093f5e11afb3d729e5799c2de526c20de9
2024-09-16 11:56:54 +02:00
Lukasz Szaszkiewicz
68a23b85b6 client-go/metadata: refactor List method
Kubernetes-commit: 1994540ffc5495bc78a4aaa428873d04d4dda442
2024-09-16 11:51:26 +02:00
Kubernetes Publisher
fb6ca040d7 Merge pull request #125186 from liyuerich/newserializer
drop deprecated json/yaml newSerializers, use json.NewSerializerWithO…

Kubernetes-commit: e5dd48efd07e8a052604b3073e0fafe7361ca689
2024-09-13 15:34:00 +00:00
Abhishek Kr Srivastav
7141d012f4 Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <rajalakshmi.girish1@ibm.com>
Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>

Kubernetes-commit: 95860cff1c418ea6f5494e4a6168e7acd1c390ec
2024-09-12 18:15:22 +05:30
Kubernetes Publisher
53c7e93bf2 Merge pull request #126999 from pohly/log-client-go-rest-body
client-go/rest: contextual logging of request/response

Kubernetes-commit: 9e597655855771bd241508fab4501ac099e29f16
2024-09-12 11:33:59 +00:00
Kubernetes Publisher
c5e16f8d68 Merge pull request #127271 from liggitt/go1.23
Update go.mod for go 1.23

Kubernetes-commit: c775fb2238e1ed48f62f02898bbb3ecee993e044
2024-09-12 03:44:00 +00:00
Jordan Liggitt
1431fe0377 Pin godebug default to go1.23
Kubernetes-commit: 102a9dbab1764e8793d0237b25143fa49cd96831
2024-09-10 12:22:40 -04:00
Jordan Liggitt
9daa93c17a Update go.mod to go 1.23
Kubernetes-commit: 65ef53139012dee36c08f558604dea48af170e11
2024-09-10 12:07:06 -04:00
Kubernetes Publisher
8d0bbdfdcc Merge pull request #126809 from ryantxu/fix-client-get-list
client-go(dynamic): avoid panic when subresource is a list

Kubernetes-commit: 8819dfb639706bc3ce87cdd902ef685677c221a5
2024-09-10 23:34:03 +00:00
Ryan McKinley
fae3dcdbf6 avoid panic when subresource is a list
Kubernetes-commit: 2e3b937dcdb02cab74213a5608cc4dac39c6423e
2024-09-09 09:40:38 +03:00
Kubernetes Publisher
51f5488cb9 Merge pull request #115834 from stlaz/remote-uid
RequestHeader authentication: add UID to recognized request headers

Kubernetes-commit: 9f01cd7b28fdbc8a1ceb9ec371fd817551659ee5
2024-09-05 15:34:35 +00:00
Joe Betz
1d3f0e5617 Add dynamic informers tests for field and label selectors
Kubernetes-commit: 6ba426c0c09c30411a7c6121044d7b1db1722776
2024-09-03 12:12:30 -04:00
Patrick Ohly
3d02d42465 client-go/rest: contextual logging of request/response
Logging in rest.Request.Body cannot be made context-aware without an API
change. Such a change is complicated if done in a backwards-compatible
fashion (must change lots of callers in Kubernetes) and prohibitive if not (all
callers of Body would have to pass a context).

Instead, logging of the request body gets moved into the functions which send
the request. This is a change of behavior, but it is limited to log levels >= 8
and thus should have no impact in production.

A request which gets sent multiple times will also log the body multiple
times. This might even be a good thing because it serves as reminder what is
being sent when it is being sent.

While at it, stack backtracing gets enhanced so that the caller of the REST API
is logged and tests for the new behavior get added.

Kubernetes-commit: 57f9b7c7a2412865e7817dbf7638881b00ac9721
2024-08-29 19:44:55 +02:00
Jordan Liggitt
1b9b709183 Update vendor
Kubernetes-commit: 745ae75a15cad2f1c5da5518c00f2eb366ffb786
2024-08-17 21:42:00 -04:00
Jordan Liggitt
a398951ea1 Implement limited merge function
Kubernetes-commit: 4d8cbad58e21e701af735c5ffa1a9fd3393de096
2024-08-17 21:27:26 -04:00
Jordan Liggitt
56b7eaf344 Narrow merge interface to merging the same types
Kubernetes-commit: 9fde1c6a85c1390c7be7705385eb99b3ebc8e06a
2024-08-17 20:43:53 -04:00
Jordan Liggitt
b3dca7eb8a Isolate mergo use, add test coverage and error checking
Kubernetes-commit: 3b3886a4509a83aff0afe7ad42da9b7819a17aed
2024-08-17 16:42:11 -04:00
Andy Goldstein
da3ab4e935 Move ncdc to emeritus
I am moving myself to emeritus as I am now firmly on the end-user side
of things.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>

Kubernetes-commit: 3ab816dcabf37acda33c665ab5aa85f1f6163bc1
2024-08-17 13:00:07 -04:00
Stephen Kitt
e996fa7a55 Drop references to auth-path and kubernetes_auth
These are long gone, removed in 2016:
* AuthPath removal: https://github.com/kubernetes/kubernetes/pull/29216
* Flag removal: https://github.com/kubernetes/kubernetes/pull/40048

This removes the remnants from clientcmd, mostly in the comments
describing how the configuration is loaded.

Since getServerIdentificationPartialConfig can no longer fail (it
copies fields from one struct to another), this drops the error
return, along with the error handling in the caller.

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

Kubernetes-commit: 8a8238ba7f850241de9c5cc4b22fa1a6b6a19480
2024-07-05 14:55:44 +02:00
liyuerich
68d318f3aa drop deprecated json/yaml newSerializers, use json.NewSerializerWithOptions instead
Signed-off-by: liyuerich <yue.li@daocloud.io>

Kubernetes-commit: 3c9309db463679c348934429d8487d190ed5e64a
2024-05-29 19:00:00 +08:00
Stanislav Láznička
9dd4d6ed78 client-go: add the UID to the auth-proxy roundtripper
Kubernetes-commit: 2cc0370169ea1fcf45429f9586e0ffd4ab32ed26
2023-02-16 14:01:53 +01:00
Kubernetes Publisher
4fca7081f8 Merge pull request #127011 from jpbetz/format-only-imports
gengo performance: Speed up update-codegen.sh by switching to FormatOnly in gengo

Kubernetes-commit: 95956671d8da7783a726133709b8085f56dda052
2024-09-04 01:17:35 +01:00
Joe Betz
2b735405b2 generate
Kubernetes-commit: 2595aa13098355414a558b2d97c58d505ca7b6c2
2024-09-03 14:25:56 -04:00
Kubernetes Publisher
bc8a8ba48a Merge pull request #127035 from alvaroaleman/rename-TypedNewDelayingQueue
Rename TypedNewDelayingQueue to NewTypedDelayingQueue

Kubernetes-commit: df577d7fbc4c76b4b660007565fae86b48a1086f
2024-08-31 19:33:10 +00:00
Alvaro Aleman
c311da2251 Rename TypedNewDelayingQueue to NewTypedDelayingQueue
This change renames NewTypedDelayingQueue to NewTypedDelayingQueue to
stay consistent with the naming scheme in the package. A
NewTypedDelayingQueue constructor is kept for backwards compatibility
but marked as deprecated.

Kubernetes-commit: 45da5dc30ecf0ba4c4b44befd96b8617278c496b
2024-08-31 12:11:20 -04:00
Kubernetes Publisher
388eba62e1 Merge pull request #127023 from aimuz/fix-lead
leaderelection: replace deprecated wait.PollImmediateUntil with wait.PollUntilContextTimeout

Kubernetes-commit: 4cfdad0935cfb796d4219dbabe8eba669614df39
2024-08-30 23:33:14 +00:00
Kubernetes Publisher
6c241d51b1 Merge pull request #127001 from skitt/applyconfiguration-gen-ambiguous
Handle ambiguous fields in applyconfiguration-gen

Kubernetes-commit: ed75e55c44f7bfbcf93757b86ae57eaceb06245a
2024-08-30 19:33:15 +00:00
Kubernetes Publisher
d50e2a9641 Merge pull request #126265 from tnqn/fix-watch-error
Enrich the error returned from Request.Watch method

Kubernetes-commit: fd58143ed2569c7eb86f46649803d1d13abc9583
2024-08-30 15:33:12 +00:00
aimuz
4379fade33 leaderelection: replace deprecated wait.PollImmediateUntil with wait.PollUntilContextTimeout
This commit refactors the `renew` function in the leader election package to replace
the deprecated `wait.PollImmediateUntil` with `wait.PollUntilContextTimeout`.
This change simplifies the context handling by removing the need for an additional
timeout context and its cancellation.

The previous implementation created a timeout context for each retry period,
which added unnecessary complexity. The new implementation directly passes the parent
context to the retry function, ensuring that the timeout is handled within `PollUntilContextTimeout`.

This change also ensures that the context passed to `tryAcquireOrRenew` and
`tryCoordinatedRenew` is consistent, improving the readability and maintainability of the code.

Kubernetes-commit: 3d2f498aa31cb2e90bcfc372b7930aed0604fbef
2024-08-30 19:25:45 +08:00
Kubernetes Publisher
9db830e3b0 Merge pull request #126727 from jpbetz/fix-fake-apply-name
Stamp fake client apply reuqests with name from action

Kubernetes-commit: 45804907d2025747452ac2573a60d330cc930a49
2024-08-29 19:33:50 +00:00
Stephen Kitt
d7a6826d37 Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 689d6ef7a3a44405909f6007b3a91eff458b95a2
2024-08-29 18:16:41 +02:00
Kubernetes Publisher
c7951255f6 Merge pull request #126954 from deads2k/retry-http2
automatically retry GET requests when http2 connection lost

Kubernetes-commit: aa4515344794526547b8344513f7785e1c46841d
2024-08-28 23:39:23 +00:00
Kubernetes Publisher
0b9a7d2f21 Merge pull request #124747 from l-technicore/update_event_spam_key
Enhance Event Spam Key to Preserve Important Events During Reconciliations

Kubernetes-commit: ad879205486a669dbaa5f5c49c247db7ea33fd33
2024-08-28 07:36:19 +00:00
Kubernetes Publisher
dec9eaa92f Merge pull request #126787 from Jefftree/update-kube-openapi
Bump k8s.io/kube-openapi and k8s.io/gengo

Kubernetes-commit: f1a922c8e6f951381450ee3c2922ca018f14a82e
2024-08-27 23:33:26 +00:00
David Eads
d69e298e04 automatically retry GET requests when http2 connection lost
Kubernetes-commit: 332a094e231942b8b6c2052d078241ddc698fe74
2024-08-27 16:32:32 -04:00
Jefftree
aa547ee1e5 re-vendor k8s.io/kube-openapi
Kubernetes-commit: ea2bdb6334ec1a2821a96163d83480d5fdb1861b
2024-08-27 01:58:39 +00:00
Kubernetes Publisher
46965213e4 Merge pull request #126716 from stlaz/tlscachekey_comparable
ensure tlsCacheKey is strictly comparable to avoid runtime panics

Kubernetes-commit: 4f10b245031193c1c1679573201810ffac9191a4
2024-08-20 03:33:19 +00:00
Kubernetes Publisher
79827ce1df Merge pull request #126038 from mprahl/retry-watcher-forbidden
Stop the RetryWatcher when failing due to permissions issue

Kubernetes-commit: e54c8ef2024e638d721242224f6f925b15ee43f5
2024-08-19 15:33:19 +00:00
Joe Betz
86c96117c6 Use Fatalf for non-recoverable errors in test
Kubernetes-commit: 5784e58446b7dd2aca0af0e84e43395c9391ae03
2024-08-19 11:18:04 -04:00
Kubernetes Publisher
78c1586020 Merge pull request #126655 from tklauser/log-spelling-fix
client-go: fix typo in leaderelection error log message

Kubernetes-commit: de521a91910e67ee3bcee006e75f694391b1271d
2024-08-18 22:25:33 +00:00
Joe Betz
908d899011 Stamp fake client apply reuqests with name from action
Kubernetes-commit: 5f1c7ae6346f9028fef77b76e5555aa37f1fc39a
2024-08-15 21:24:28 -04:00
Stanislav Láznička
d63a65fbe7 ensure tlsCacheKey is strictly comparable to avoid runtime panics
Kubernetes-commit: 12ae218bfe8c194786737220759cbb2e8e3e3a98
2024-08-15 15:50:22 +02:00
Kubernetes Publisher
690fd5274d Merge pull request #126545 from yangjunmyfm192085/updatepersistentVolumeClaimRetentionPolicy
Update incorrect description of persistentVolumeClaimRetentionPolicy

Kubernetes-commit: 6a478b4306ea9ae3b8f86bd1ef71072d9a03be22
2024-08-14 06:12:05 +00:00
Tobias Klauser
ae43527480 client-go: fix typo in leaderelection error log message
Kubernetes-commit: 99a90df3d0403315f26d643b90ab6339c22602c8
2024-08-13 11:21:57 +02:00
杨军10092085
1a951c2887 Updated incorrect description of persistentVolumeClaimRetentionPolicy
Kubernetes-commit: 56bbae4807989cd43eff17cf9fa93f7b54c087bd
2024-08-05 21:30:25 +08:00
Kubernetes Publisher
71959c526d Merge pull request #126405 from sttts/sttts-sync-informerfactory-start
Call non-blocking informerFactory.Start synchronously to avoid races

Kubernetes-commit: ba6141a1457cf8dad08fb08724b390f9dfd84489
2024-07-27 10:50:48 -07:00
Jefftree
b6f7bdf3b8 informers: add comment that Start does not block
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: cd69335542fd961b69b4e83b6433d1b40d2f4439
2024-07-27 15:47:24 +00:00
Dr. Stefan Schimanski
f71a5cc5d3 Call non-blocking informerFactory.Start synchronously to avoid races
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: c7a1fa432a87579895eac4b3873162d5f1dba7f5
2024-07-27 16:13:16 +02:00
Kubernetes Publisher
4536e5a391 Merge pull request #124012 from Jefftree/le-controller
Coordinated Leader Election

Kubernetes-commit: 5f5c02da51cd3146f30c6ee56013c983f4999d9c
2024-07-25 21:07:49 +00:00
Kubernetes Publisher
93c6a5bf50 Merge pull request #126353 from liggitt/fix-vendor
Fix verify-vendor script to check all go.mod and go.sum files

Kubernetes-commit: 9edabd617945cd23111fd46cfc9a09fe37ed194a
2024-07-25 17:07:42 +00:00
Sebastiaan van Stijn
6a9911a398 revendor dependencies
I was workinng on updating a dependency, and noticed that running
hack/update-vendor.sh resulted in a diff. Comitting the result
as a PR.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Kubernetes-commit: aeb607443dd9b8ee378ee10209e9b446256f3ee2
2024-07-25 08:52:23 +02:00
Kubernetes Publisher
fe54892e0c Merge pull request #126243 from SergeyKanzhelev/devicePluginFailures
Implement resource health in pod status (KEP 4680)

Kubernetes-commit: 5af1710d90d2396f6305c73fdf7df3a1be0c2fd0
2024-07-24 05:07:09 +00:00
Jefftree
825f52e194 Change PingTime to be persistent
Kubernetes-commit: 0c774d0b1f79b0b0a6d73102a78c84853220f036
2024-07-23 19:19:12 +00:00
Jefftree
f45c45195a fix ordering issue in candidates
Kubernetes-commit: e1ea24a171ca6ba2d0f184abbd019ab3cf4a93c4
2024-07-23 17:09:37 +00:00
Jefftree
18dd587a4b feedback: leasecandidate clients
Kubernetes-commit: fac758164029e278e9bda924090ed078bb6514c8
2024-07-23 14:28:08 +00:00
Dr. Stefan Schimanski
1f27757b2f Review feedback
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: 68226b0501996fc86c9c2bddb7d61e6a64c91304
2024-07-23 14:52:25 +02:00
Quan Tian
009514ecc1 Enrich the error returned from Request.Watch method
The Error method of the error returned from Request.Watch was "unknown"
even the server returned clear message in the Status struct. It was
because Request.Watch used the Result's err member directly, which is an
unstructured error from the response which the Result object may use if
the caller did not return a structured error.

The patch fixes it by calling the Result's Error method instead, which
returns the structured error when it's present.

It also removes the wrong expectation about events.

Kubernetes-commit: 596c5696c64023808af164284263647d795b0ac2
2024-07-22 17:13:43 +08:00
Sergey Kanzhelev
79fd7abf82 generated files
Kubernetes-commit: 2253b53b585e3405c5ce2dda2921db3a0afa02c9
2024-07-22 05:20:58 +00:00
Kubernetes Publisher
ac9204c619 Merge pull request #126145 from carlory/kep-3751-api
[KEP-3751] Promote VolumeAttributesClass to beta

Kubernetes-commit: c2fdeca4ab81336daf20c91b810c9685918c3d58
2024-07-24 01:07:04 +00:00
Kubernetes Publisher
dcfcc90795 Merge pull request #126125 from mprahl/stop-idempotent
Allow calling Stop multiple times on RetryWatcher

Kubernetes-commit: fc03f3e74c3d891e62b347c518b3197b62e9532c
2024-07-23 20:03:59 +00:00
Kubernetes Publisher
bad8f77ca6 Merge pull request #126091 from seans3/ws-err-extra-info
Adds extra error information from response to bad handshake error when possible

Kubernetes-commit: f753a444a5e0b245d2cf8433f7d8bb915c12363e
2024-07-23 02:36:42 +00:00
Jefftree
20993758b7 CLE controller and client changes
Kubernetes-commit: c47ff1e1a9aec44f262674eb6cdbabf80512d981
2024-07-21 20:06:03 +00:00
Jefftree
8a2bbd0393 Coordinated Leader Election Alpha API
Kubernetes-commit: 3999b98c8840e41acaa19d94e88f46d1fbb0c1b3
2024-07-21 20:02:00 +00:00
carlory
9dea255e12 Promote VolumeAttributesClass to beta
Kubernetes-commit: 0260c7d023551f85621049ca604a4fd5110ba0a9
2024-07-17 15:55:06 +08:00
mprahl
001900e4e9 Allow calling Stop multiple times on RetryWatcher
This makes the Stop method idempotent so that if Stop is called multiple
times, it does not cause a panic due to closing a closed channel.

Signed-off-by: mprahl <mprahl@users.noreply.github.com>

Kubernetes-commit: a54ba917be42c941edf1a0359dced04e1a5e1d6f
2024-07-16 10:55:26 -04:00
Sean Sullivan
3aff10e3cd Adds extra error information from response to bad handshake error when possible
Kubernetes-commit: f387f0b69acb34143f76275aacb955fabb555bd7
2024-07-14 19:46:16 -07:00
Kubernetes Publisher
a9affb4c9c Merge pull request #125488 from pohly/dra-1.31
DRA for 1.31

Kubernetes-commit: d21b17264e5a554724aa3ad032536630bcfd5b3f
2024-07-22 22:36:56 +00:00
mprahl
2176e80333 Stop the RetryWatcher when failing due to permissions issue
When the client does not have permission to watch a resource, the
RetryWatcher continuously retried. In this case, it's better to send an
error and stop retrying to let the caller handle this case since this is
not a transient error that can be recovered without user intervention.

This is particularly helpful in applications that leverage a user
provided service account and the application needs to notify the user to
set the correct permissions for the service account.

This also accounts for invalid credentials from the watch client.

Signed-off-by: mprahl <mprahl@users.noreply.github.com>

Kubernetes-commit: db2218d16e3fb2a30b21ffa0f307beb515d8394b
2024-07-11 13:50:52 -04:00
Patrick Ohly
a7db3ade62 DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key
differences:
- refocused on structured parameters and allocating devices
- support for constraints across devices
- support for allocating "all" or a fixed amount
  of similar devices in a single request
- no class for ResourceClaims, instead individual
  device requests are associated with a mandatory
  DeviceClass

For the sake of simplicity, optional basic types (ints, strings) where the null
value is the default are represented as values in the API types. This makes Go
code simpler because it doesn't have to check for nil (consumers) and values
can be set directly (producers). The effect is that in protobuf, these fields
always get encoded because `opt` only has an effect for pointers.

The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new
"request" field. This is considered acceptable because the entire `claims`
field in the pod spec is still alpha.

The implementation is complete enough to bring up the apiserver.
Adapting other components follows.

Kubernetes-commit: 91d7882e867da25ae8014f679db32b20e35e89b4
2024-06-18 17:47:29 +02:00
Patrick Ohly
e0bc24e153 DRA: remove "sharable" from claim allocation result
Now all claims are shareable up to the limit imposed by the size of the
"reserverFor" array.

This is one of the agreed simplifications for 1.31.

Kubernetes-commit: 8a629b9f150c1042e2918043e6012a4f22742b19
2024-06-13 18:43:17 +02:00
Patrick Ohly
a7f430b8bb DRA: remove immediate allocation
As agreed in https://github.com/kubernetes/enhancements/pull/4709, immediate
allocation is one of those features which can be removed because it makes no
sense for structured parameters and the justification for classic DRA is weak.

Kubernetes-commit: de5742ae83c8d77268a7caf5f3b1f418c4a13a84
2024-06-13 17:25:39 +02:00
Patrick Ohly
91ff2f6ea5 DRA: bump API v1alpha2 -> v1alpha3
This is in preparation for revamping the resource.k8s.io completely. Because
there will be no support for transitioning from v1alpha2 to v1alpha3, the
roundtrip test data for that API in 1.29 and 1.30 gets removed.

Repeating the version in the import name of the API packages is not really
required. It was done for a while to support simpler grepping for usage of
alpha APIs, but there are better ways for that now. So during this transition,
"resourceapi" gets used instead of "resourcev1alpha3" and the version gets
dropped from informer and lister imports. The advantage is that the next bump
to v1beta1 will affect fewer source code lines.

Only source code where the version really matters (like API registration)
retains the versioned import.

Kubernetes-commit: b51d68bb87ba4fa47eb760f8a5e0baf9cf7f5b53
2024-06-14 12:40:48 +02:00
Kubernetes Publisher
82af755eff Merge pull request #126231 from seans3/websocket-https-proxy-fix
Falls back to SPDY for gorilla/websocket https proxy error

Kubernetes-commit: 90a84704d6e103c0a7b5cdaa8f6626a134079147
2024-07-20 22:32:50 +00:00
Sean Sullivan
6e31289fcf moving for easier cherry-pick
Kubernetes-commit: bc526472515e1a01d41e5a94db2b74462545c984
2024-07-20 05:29:57 -07:00
Sean Sullivan
8108d4122f Falls back to SPDY for gorilla/websocket https proxy error
Kubernetes-commit: 9d560540c5268e0e2aebf5306907494cf522c260
2024-07-19 12:04:41 -07:00
Kubernetes Publisher
5130bd9e78 Merge pull request #126207 from thockin/ingress-backend-port-atomic
Make ServiceBackendPort an atomic struct

Kubernetes-commit: 77e12aeca92c3c0fe2c1fc6ce7f0e17ba796c6fd
2024-07-19 06:33:43 +00:00
Kubernetes Publisher
80707e5e44 Merge pull request #125660 from saschagrunert/oci-volumesource-api
[KEP-4639] Add `ImageVolumeSource` API

Kubernetes-commit: 595927da21da34f5fed62e237e7a73d9635ac621
2024-07-18 18:33:21 +00:00
Kubernetes Publisher
5742b23135 Merge pull request #124859 from morlay/master
Remove json:",omitempty" where json:",inline" specified.

Kubernetes-commit: 73198f893c74531005fe7284eee5a9dc0db34ff7
2024-07-18 18:33:19 +00:00
Tim Hockin
cd892da09f Make ServiceBackendPort an atomic struct
This allows different actors to force ownership of it without having to
explicitly unset the other field.

Kubernetes-commit: 7313990f61881c676c1f5d68365144a1d77cced3
2024-07-18 10:31:37 -07:00
Kubernetes Publisher
6dde7fe449 Merge pull request #126073 from a7i/fake-apply-scale-subresource
fix: fake clientset ApplyScale subresource from 'status' to 'scale'

Kubernetes-commit: d0545c8eb4ca5e8bb7704b5f51197b5082964e85
2024-07-18 02:33:01 +00:00
Kubernetes Publisher
37121f3f00 Merge pull request #125470 from everpeace/kep-3619-SupplementalGroupsPolicy-e2e
KEP-3619: Add NodeStatus.Features.SupplementalGroupsPolicy API and e2e

Kubernetes-commit: fc3abdaf2dbb11c84033635b1d26f12fe12ef001
2024-07-16 22:40:50 +00:00
Amir Alavi
eab51c4031 fix: fake clientset ApplyScale subresource from 'status' to 'scale'
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>

Kubernetes-commit: 872c3442501ca479f399d2f9060b72d228234b30
2024-07-13 12:23:02 -04:00
Morlay
9ab93c0777 Remove json:",omitempty" where json:",inline" specified.
Signed-off-by: Morlay <morlay.null@gmail.com>

Kubernetes-commit: f9b69ce10847a31626c364d3d86bf361b16456b2
2024-06-28 23:16:51 +08:00
Sascha Grunert
485ae13a58 Add ImageVolumeSource API
Adding the required Kubernetes API so that the kubelet can start using
it. This patch also adds the corresponding alpha feature gate as
outlined in KEP 4639.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Kubernetes-commit: f7ca3131e0922563a561134b4ed9eed8d2bdd2c4
2024-06-24 10:34:43 +02:00
Shingo Omura
1ea671aac4 KEP-3619: API: add NodeFeatures.SupplementalGroupsPolicy in NodeStatus
KEP-3619: don't capitalize comment in K8S API

KEP-3619: fix typos and grammatical ones in K8s API

KEP-3619: rephrase NodeFeatures, NodeHandlerFeatures in K8s API

Kubernetes-commit: 5d75660dc11ff443ebab2551aed8e56a54cc218d
2024-06-22 18:43:31 +09:00
Kubernetes Publisher
59ef8e11c6 Merge pull request #126034 from sohankunkerkar/add-usernamespaces
api: add user namespaces field to NodeRuntimeHandlerFeatures

Kubernetes-commit: f36a821de828372a5f99528d21f309f75e17d043
2024-07-16 02:32:45 +00:00
Peter Hunt
21b1828b05 api: add user namespaces field to NodeRuntimeHandlerFeatures
Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>

Kubernetes-commit: 86240aaca17e0bfbdbaec78bf2604f8623c73615
2024-05-31 13:30:45 -04:00
Kubernetes Publisher
0724a9928f Merge pull request #125305 from p0lyn0mial/upstream-dynamic-client-uses-watch-list
dynamic client: add support for API streaming

Kubernetes-commit: 06ec6ba05df1edef90de9a4a676ba31b03a770ce
2024-07-15 18:32:37 +00:00
Kubernetes Publisher
34751e103a Merge pull request #126018 from aroradaman/bump-k8s-utils
bump k8s.io/utils

Kubernetes-commit: 46aa8959a0659e22c924bb52b38385d441715b2b
2024-07-13 18:32:32 +00:00
Kubernetes Publisher
b6a1b42a24 Merge pull request #126057 from thockin/make-pod-ip-host-ip-required
make PodIP.IP and HostIP.IP required.

Kubernetes-commit: a87612b6676723b34a5b3d2d80ab4e04552221ae
2024-07-13 02:40:23 +00:00
Daman Arora
37c2760fd9 bump k8s.io/utils
Signed-off-by: Daman Arora <aroradaman@gmail.com>

Kubernetes-commit: c6a129b715646163ef83f94245c3756cbc191c42
2024-07-12 14:40:22 +05:30
Lukasz Szaszkiewicz
732dd289a0 dynamic client: add support for API streaming
Kubernetes-commit: d778356bc6a057ae41bee4577e568293a25fce9b
2024-07-11 13:49:29 +02:00
Lan Liang
fa8c68e986 make PodIP.IP and HostIP.IP required.
Fields used as map keys must be required or defaulted when used in a CRD schema.

see https://github.com/kubernetes/kubernetes/issues/124540

Signed-off-by: Lan Liang <gcslyp@gmail.com>

Kubernetes-commit: 73613b48c6472c71eb6cb6ff12a0d5acb1beadcc
2024-05-16 08:36:27 +00:00
Kubernetes Publisher
53b8be7cea Merge pull request #125802 from mmorel-35/testifylint/len+empty
fix: enable empty and len rules from testifylint on pkg and staging package

Kubernetes-commit: 2d4514e1690dc5babb144542da799f6b331afd1b
2024-07-12 06:32:46 +00:00
Kubernetes Publisher
7f36d816ee Merge pull request #125944 from timofurrer/fix/error-msg-type
Fix typo in type name of watch decode error

Kubernetes-commit: 6a45c8b7d1ea6e7ea8677e6fb7ee9394b21d808d
2024-07-10 18:32:46 +00:00
Timo Furrer
55c0e2c777 Fix typo in type name of watch decode error
Kubernetes-commit: fed49d06aac3f003f7b2df35ffed6b2f16ef2548
2024-07-08 07:52:38 +02:00
Kubernetes Publisher
354ed1bc9f Merge pull request #125922 from dims/update_otel_27
Update opentelemetry dependencies to the latest release (Take 2)

Kubernetes-commit: 07cc20a7509e7322e6ebb04e60d8274f27d6fdd7
2024-07-07 02:32:31 +00:00
Kubernetes Publisher
127e4c3902 Merge pull request #125887 from fxierh/fakediscovery-fix
[client-go] Enable FakeDiscovery client to simulate errors by fixing error handling

Kubernetes-commit: 40225a788c299352346db3751ecd48a333d98fd0
2024-07-07 02:32:27 +00:00
Davanum Srinivas
e57f162031 update OpenTelemetry dependencies and grpc
This update dropped the otelgrpc → cloud.google.com/go/compute dependency,
among others. This dropped out because genproto cleaned up it's dependencies
on google cloud libraries, and otel updated - details in #113366.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: David Ashpole <dashpole@google.com>

Kubernetes-commit: ff7942be83ed0c0aaa8c258e8e2b9965d383935c
2024-07-05 12:10:07 -04:00
Feilian Xie
c45bc431c3 Return the error returned by Invokes so the FakeDiscovery client is able to simulate any error with reactors.
Signed-off-by: Feilian Xie <fxie@redhat.com>

Kubernetes-commit: 33557a2f6c82d10fa6a459d2ebac56d6a2670492
2024-07-04 17:29:57 +08:00
Kubernetes Publisher
ab86e03da4 Merge pull request #125021 from aojea/servicecidrbeta
KEP-1880 Multiple Service CIDRs: Graduate to Beta (2/2)

Kubernetes-commit: 93d56511e684369479f23aae15617e483cda5719
2024-06-30 18:26:25 +00:00
Kubernetes Publisher
4dec662fe8 Merge pull request #125116 from pohly/dra-one-of-source
DRA: remove "source" indirection from v1 Pod API

Kubernetes-commit: ac9aec9f9b1229c1560d682475dc5c6f38f6beb3
2024-06-28 22:26:13 +00:00
Matthieu MOREL
acc5917341 fix: enable empty and len rules from testifylint on pkg package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>

Kubernetes-commit: f014b754fb5925dfbca6e27a44d0c3968b157e14
2024-06-28 21:20:13 +02:00
Kubernetes Publisher
ae071bc75f Merge pull request #125759 from dims/bump-prometheus/common-v0.55.0
Bump `prometheus/common` to v0.55.0

Kubernetes-commit: 4c44efe81c9a26d66cdf88e917aeee75dad12299
2024-06-28 06:26:03 +00:00
Kubernetes Publisher
4b5beb66d4 Merge pull request #124917 from vinayakankugoyal/kep4633
KEP-4633: Only allow anonymous auth for configured endpoints.

Kubernetes-commit: 522e2e50667f25b759a10183eec1bb7d4683ec27
2024-06-28 06:26:00 +00:00
Kubernetes Publisher
ef4b2f63d9 Merge pull request #125766 from dims/update-moby/spdystream-to-v0.4.0
Update moby/spdystream to v0.4.0

Kubernetes-commit: 742b2f70b9e5c1ec03682ad25dc76fdcc7109310
2024-06-27 22:25:47 +00:00
Kubernetes Publisher
96c49b6987 Merge pull request #125600 from thockin/plus_default_deprecated_volumes
Use +default for deprecated volume types

Kubernetes-commit: df20694c62c6b5e6d177dcd40936080d49f42865
2024-06-27 18:26:23 +00:00
Davanum Srinivas
a2665afaf6 Update moby/spdystream to v0.4.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 377a3f7ec4dc2b5e09e0aadb651999d400c31538
2024-06-27 13:07:47 -04:00
Davanum Srinivas
66473c1f2b Bump prometheus/common to v0.55.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 35ccdc8b35f1c4346071d4ff0efecdd7a6bcdecc
2024-06-27 07:58:24 -04:00
Kubernetes Publisher
b043b561b4 Merge pull request #125745 from BenTheElder/ping-ping
bump  github.com/moby/spdystream to v0.3.0

Kubernetes-commit: 11446a394fb851d3496d31d96a67f8fcba6348e3
2024-06-26 22:26:46 +00:00
Benjamin Elder
11d6807603 bump github.com/moby/spdystream to v0.3.0
picks up fix for data-race in Ping

Kubernetes-commit: c5aa8fdc711982dd589a9ac940b05297cc46b4a5
2024-06-26 12:27:14 -07:00
Kubernetes Publisher
88829a42b7 Merge pull request #125731 from dashpole/revert_otel
Revert "Update opentelemetry dependencies to the latest release."

Kubernetes-commit: a4b8d0faa8e7d3227cbdda39241998d38f1c294e
2024-06-26 18:26:23 +00:00
David Ashpole
0fbd594bc2 Revert "update OpenTelemetry dependencies"
This reverts commit 82e9ce79c763f1028f542b1246114082430e6b20.

Kubernetes-commit: e94047c9002c17a3b76513c3cde2d53aed39b7fb
2024-06-26 14:13:33 +00:00
Kubernetes Publisher
4e7651c220 Merge pull request #125706 from jpbetz/fix-fixture-test
Remove test dependency on swagger.json to fix client-go tests

Kubernetes-commit: 10e3ec8975735b4f6c5c7d09ec8041e71be26313
2024-06-26 06:28:57 +00:00
Kubernetes Publisher
8ffa531474 Merge pull request #125537 from seans3/rc-fallback-log
Adds logging during remote command executor fallback

Kubernetes-commit: d48a3036be80e54c07d2ae5ee30669f9dda393e5
2024-06-26 06:28:55 +00:00
Kubernetes Publisher
6090471cca Merge pull request #125669 from benluddy/cbor-bump-v2.7.0
KEP-4222: Bump github.com/fxamacker/cbor/v2 to v2.7.0.

Kubernetes-commit: beb48b7f5df83cd56275f471e52ef588ba845093
2024-06-26 06:28:54 +00:00
Joe Betz
dd940936ee Remove test dependency on swwagger.json to fix client-go repo
Kubernetes-commit: 1095af88e7d30198e13299ea90c5f81b95ec8a3b
2024-06-25 13:31:03 -04:00
Ben Luddy
91774658e7 Bump github.com/fxamacker/cbor/v2 to v2.7.0.
Kubernetes-commit: dbe4c093d9f5b85fa509042556edf61fb6503b22
2024-06-24 09:49:40 -04:00
Kubernetes Publisher
430e755e85 Merge pull request #125575 from dashpole/update_otel_27
Update opentelemetry dependencies to the latest release.

Kubernetes-commit: 535e833aef9718d1a19a8f71b3a4639fc92aa855
2024-06-26 06:28:52 +00:00
Kubernetes Publisher
2923011bfd Merge pull request #125560 from jpbetz/apply-gen-fake
Add field management support to fake client-go typed client

Kubernetes-commit: d236a9127fe36317bb35854d63b275d7efdb399e
2024-06-26 06:28:48 +00:00
Joe Betz
c4145a9c20 Generate code
Kubernetes-commit: 7772769d19a82a26aa91181e0804ff2ccbdd843c
2024-06-24 15:58:35 -04:00
Joe Betz
2c866525dd Add field tracker support to client fake fixtures
Kubernetes-commit: 75d6f024326dadc13807b8221bedd8da7924c2ba
2024-06-24 15:42:29 -04:00
Joe Betz
96f66e9159 Support options for all client fake actions
Kubernetes-commit: 599f03c72264d5149ae63b1c9eccb33e8b32e900
2024-06-24 15:41:38 -04:00
Kubernetes Publisher
b9309ac26b Merge pull request #125531 from pohly/klog-update
dependencies: klog v2.130.1

Kubernetes-commit: 44446e1c9c2e7f50061f2a998c76f6f55f3ca737
2024-06-20 18:10:25 +00:00
Tim Hockin
af26305389 Use +default for now deprecated ScaleIO volume
Kubernetes-commit: a074dd6f2e3ce394b767c109701045d13a56b6e2
2024-06-19 12:18:33 -07:00
Tim Hockin
f9b8f88e7d Use +default for now deprecated AzureDisk volume
Kubernetes-commit: 0f5ab4beec4d05138ed3fff5a5b2a7e42bf75d0c
2024-06-19 11:45:22 -07:00
Tim Hockin
90902b591f Use +default for now deprecated ISCSI volume
Kubernetes-commit: 333c02cf28baa02a234b977f62a9a51f41c98572
2024-06-19 11:28:55 -07:00
Tim Hockin
64e74f9623 Use +default for now deprecated RBD volume
THis leaves us less hand-written code and a better schema.

Kubernetes-commit: 03f0110b953a171bfc985fc65a40ffe6820a6007
2024-06-19 11:15:41 -07:00
David Ashpole
fd8492c66f update OpenTelemetry dependencies
Kubernetes-commit: 82e9ce79c763f1028f542b1246114082430e6b20
2024-06-19 00:43:16 +00:00
Sean Sullivan
0b664571bb Adds logging during remote command executor fallback
Kubernetes-commit: d8269e5a394dfa0116e8baeb7aac0a82eb430e5e
2024-06-16 13:51:09 -07:00
Patrick Ohly
db174bf2ff dependencies: klog v2.130.1
Kubernetes-commit: f98e5d1dfcaa37fee2c394436583038cf3ff1e72
2024-06-16 14:04:43 +02:00
Kubernetes Publisher
e1202c7e82 Merge pull request #121439 from skitt/generic-client-go
Use generics to share code in client-go implementations

Kubernetes-commit: 33829b68b5040f23e04ba5e68ed76792d68d698f
2024-06-19 22:10:21 +00:00
Patrick Ohly
fdffb523da DRA: remove "source" indirection from v1 Pod API
This makes the API nicer:

    resourceClaims:
    - name: with-template
      resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      resourceClaimName: test-shared-claim

Previously, this was:

    resourceClaims:
    - name: with-template
      source:
        resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      source:
        resourceClaimName: test-shared-claim

A more long-term benefit is that other, future alternatives
might not make sense under the "source" umbrella.

This is a breaking change. It's justified because DRA is still
alpha and will have several other API breaks in 1.31.

Kubernetes-commit: bde9b64cdfbbbb185593c20fea84cdced631ffd6
2024-05-24 15:24:24 +02:00
Antonio Ojea
a146a0f353 make update
Kubernetes-commit: bc8bce2ef98b85d642c7e805e8c6d1fd92cbcf53
2024-05-21 11:58:12 +00:00
Vinayak Goyal
1582c4c03d KEP-4633: Allow health-only anonymous auth mode.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>

Kubernetes-commit: 5e6a4937f5a3e20dd77238946220461332ecddff
2024-05-16 21:18:34 +00:00
Stephen Kitt
b31bc29ea1 Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 08dfd59305dbd1032b1afb49738259d688dda5e3
2024-05-10 16:56:52 +02:00
Lalit
aa6ed1bae1 Updating event spam key to allow recording of more unique events
Kubernetes-commit: 99d20307cfa41f9beefa97c5bec2ee00b2d8b620
2024-05-08 12:05:42 +05:30
Stephen Kitt
c834bcc257 Generify client-go
This adds a generic implementation of a clientset, and uses it to
replace the template code in generated clientsets for the default
methods. The templates are preserved as-is (or as close as they can
be) for use in extensions, whether for resources or subresources.

Clientsets with no extensions are reduced to their main getter, their
interface, their specific struct, and their constructor. All method
implementations are provided by the generic implementation. The
dedicated interface is preserved so that each clientset can have its
own set of methods, and the dedicated struct is preserved to allow
extensions and expansions to be defined where necessary.

Instead of handling the variants (with/without namespace, list, apply)
with a complex sequence of if statements, build up an index into an
array containing the various declarations.

The namespaced/non-namespaced distinction matters in the code
templates, but not in the methods themselves, so drop all the
non-namespaced variants and pass in "" explicitly.

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

Kubernetes-commit: 3734f5bf9b6ce1e9cf2385f4e4453b32d8f35ab1
2023-10-13 09:56:04 +02:00
Stephen Kitt
6a88f2da38 Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: c982ce1891eacd1bff135e9010df4fc17e3dbb23
2024-05-27 11:00:27 +02:00
Stephen Kitt
233a06528f Run codegen
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 55ea0a55358de787353c9c9c38280d483456475a
2024-05-27 10:55:47 +02:00
Kubernetes Publisher
d2f5fba1f8 Merge pull request #125528 from seans3/port-forward-beta
PortForward over Websockets Graduates to Beta

Kubernetes-commit: ef9965ebc66dafda37800bb04f5e284535bbba10
2024-06-16 13:59:32 -07:00
Sean Sullivan
6e4469285c Graduate PortForwardWebsockets to Beta
Kubernetes-commit: 3ae3b4ea551443d8ef695d31bf0c51963fe35ac3
2024-06-15 16:09:23 -07:00
Kubernetes Publisher
cea15394b3 Merge pull request #124509 from p0lyn0mial/upstream-watch-list-code-gen
client-go: add support for API streaming

Kubernetes-commit: 6ac60160c5729ade462b041b170ec8ac0f1eb3bc
2024-06-14 14:10:49 +00:00
Kubernetes Publisher
e4e31fd32c Merge pull request #125472 from karlkfi/karl-watch-comments
Add details to watch interface method comments

Kubernetes-commit: b498eb97406f780fbbeb39204f50bc473e64af56
2024-06-13 14:10:58 +00:00
Kubernetes Publisher
5f43af464b Merge pull request #125391 from karlkfi/karl-reflector-watch-stop
Refactor Reflector ListAndWatch

Kubernetes-commit: 08a8480558c7ace68a6ac3de10a21f8c02663077
2024-06-13 14:10:56 +00:00
Lukasz Szaszkiewicz
cc198ea39d make update
Kubernetes-commit: f62c80f965934eeeb2e028497bede7bcc632995d
2024-06-13 10:25:56 +02:00
Kubernetes Publisher
39cc8deb07 Merge pull request #125435 from p0lyn0mial/upstream-rm-reflector-data-consistency-detector-test
client-go/reflector: remove reflector_data_consistency_detector_test.go

Kubernetes-commit: 8db1402f3db163af73e54f1b4932ddf9971eb68e
2024-06-12 22:10:48 +00:00
Karl Isenberg
f29a36dfab Refactor Reflector ListAndWatch
- Extract watchWithResync to simplify ListAndWatch
- Wrap watchHandler with two variants, one for WatchList and one for
  just Watch.
- Replace a bool pointer arg with a bool arg and bool return, to
  improve readability.
- Use errors.Is to satisfy the linter
- Use %w to wrap the store.Replace error, to allow unwrapping.

Kubernetes-commit: 65fc1bb463c85a4c85e619bf7acac9503e23a253
2024-06-12 13:14:55 -07:00
Karl Isenberg
48d8fc7e2e Add details to watch interface method comments
The watch.Interface design is hard to change, because it would break
most client-go users that perform watches. So instead of changing the
interface to be more user friendly, this change updates the method
comments to explain the different responsibilities of the consumer
(client user) and the producer (interface implementer).

Kubernetes-commit: 1f35231a1d4f7b8586a7ec589c799729eeb4f7c4
2024-06-12 13:06:22 -07:00
Kubernetes Publisher
fb1003a7e4 Merge pull request #125440 from p0lyn0mial/upstream-client-go-watchlist-can-use-watchlist-for-list-rq
client-go/util/watchlist: intro CanUseWatchListForListRequest(

Kubernetes-commit: 813d3f35b42c0549619dfa54754fa62244af6c14
2024-06-12 10:04:30 -07:00
Lukasz Szaszkiewicz
5347b09f1d client-go/reflector: remove reflector_data_consistency_detector_test.go
Kubernetes-commit: 0c96a00217d6e2a4c9cb1cf6c0bc719d570678fc
2024-06-11 10:42:07 +02:00
Lukasz Szaszkiewicz
9a760efea1 client-go/util/watchlist: intro CanUseWatchListForListRequest
Kubernetes-commit: 38fae9b799393f6fe17d07fb8148f05b1110859b
2024-06-10 18:03:47 +02:00
Kubernetes Publisher
03443e7ede Merge pull request #125432 from p0lyn0mial/upstream-watch-list-data-consistency-detector
client-go/consistencydetector: add CheckWatchListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 27bdade27f9f4c2b60928a18579de369c9f8c2ef
2024-06-11 01:22:25 -07:00
Lukasz Szaszkiewicz
b681e77bec client-go/reflector: use consistencydetector.IsDataConsistencyDetectionForWatchListEnabled
Kubernetes-commit: f6c68908ba37dbb7af602b8f88b5f395025d2384
2024-06-10 23:01:04 +02:00
Lukasz Szaszkiewicz
14559c0fec client-go/consistencydetector: introduce CheckWatchListFromCacheDataConsistencyIfRequested
Kubernetes-commit: f7f3809c513cd051c2c45bbef0655cf5a3eceea2
2024-06-10 22:52:47 +02:00
Kubernetes Publisher
911684686f Merge pull request #125408 from benluddy/bump-cbor-v2.7.0
KEP-4222: Bump github.com/fxamacker/cbor/v2.

Kubernetes-commit: 6346b9d1327c4b8be2398d9715bdae5475e27569
2024-06-11 00:41:19 +00:00
Ben Luddy
4d57b6a340 Bump fxamacker/cbor/v2 to v2.7.0-beta.
This library release makes a number of behaviors configurable in ways that are required for CBOR
support in Kubernetes.

Kubernetes-commit: c4279660cad039bc15495311cf7863640b6308f9
2024-05-09 14:30:58 -04:00
Kubernetes Publisher
c415c7650f Merge pull request #125304 from p0lyn0mial/upstream-dynamic-client-uses-consistency-detector
dynamic-client: data consistency checker for list requests

Kubernetes-commit: e328c8fbf18f50e3d9dff430af482e703124147d
2024-06-09 16:40:52 +00:00
Kubernetes Publisher
8fc5a64651 Merge pull request #125383 from p0lyn0mial/upstream-unstructured-testchecklistconsistency
client-go/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data

Kubernetes-commit: 51f89c3b2d114fea99d3a0e8401c639f39e27877
2024-06-07 07:50:55 -07:00
Lukasz Szaszkiewicz
503a0905c0 client-go/util/consistencydetector: extend TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured list
Kubernetes-commit: a2a48a475b4c98daeea3f83b8a89aa070ea4082b
2024-06-07 10:55:01 +02:00
Lukasz Szaszkiewicz
2d885a2ed5 client-go/util/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data
Kubernetes-commit: c5904424b2b03cec1befaf16c55bb97df57669bc
2024-06-07 10:43:28 +02:00
Kubernetes Publisher
e8224736d3 Merge pull request #125379 from p0lyn0mial/upstream-unstructured-testdataconsistencychecker
client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data

Kubernetes-commit: 96815d6dc8de717579484ffef88f74063dfd40ca
2024-06-07 16:41:08 +00:00
Kubernetes Publisher
94cabc85d9 Merge pull request #125302 from karlkfi/karl-informer-watcher-test
Update TestNewInformerWatcher for WatchListClient

Kubernetes-commit: 169a952720ebd75fcbcb4f3f5cc64e82fdd3ec45
2024-06-07 12:40:56 +00:00
Kubernetes Publisher
1fc4f8ad34 Merge pull request #124963 from p0lyn0mial/upstream-data-consistency-checker-for-list-requests
client-go: data consistency checker for list requests

Kubernetes-commit: 3532601ad8c7249be13cd8187f8124fc68da4c4b
2024-06-07 08:40:44 +00:00
Lukasz Szaszkiewicz
20d0a8ee82 client-go/consistencydetector: extend TestDataConsistencyChecker to test unstructured data
Kubernetes-commit: c8971c456f23627a91dc79bb8bc840a32dea611f
2024-06-07 10:33:11 +02:00
Kubernetes Publisher
1c075dc88c Merge pull request #124642 from wojtek-t/resilient_watchcache_initialization
Implement ResilientWatchCacheInitialization

Kubernetes-commit: eef6c6082d4e34fc4a0675a36ec5cc575cd13696
2024-06-07 04:40:45 +00:00
Kubernetes Publisher
098e7c5a9b Merge pull request #125356 from p0lyn0mial/upstream-improve-testdrivechecklistfromcache-test
improve TestDriveCheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 4e2a6201a43f4c8bbb633ae8edc8cc47b1a39ee7
2024-06-06 16:44:40 +00:00
Lukasz Szaszkiewicz
82627741cb client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data
Kubernetes-commit: d535f55ef9dd391712db09ac69dd083089457366
2024-06-06 14:14:33 +02:00
Lukasz Szaszkiewicz
bbe85a4a80 fix TestDriveCheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 82794c4963144bf5298089030733f993a44f7c3b
2024-06-05 22:41:09 +02:00
Kubernetes Publisher
b03e5b8438 Merge pull request #125335 from p0lyn0mial/upstream-consistency-decector-handles-legacy-case
client-go/consistencydetector: handles the watch cache legacy case

Kubernetes-commit: dae37c21645c0fc04bbb0202ad1eba6ba4438d23
2024-06-05 05:37:20 -07:00
Lukasz Szaszkiewicz
c7d706847a client-go/consistencydetector: handles the watch cache legacy case
Kubernetes-commit: fe8a2d222cc4208ee8f89fd2912d35cf58ec5941
2024-06-04 18:37:37 +02:00
Lukasz Szaszkiewicz
5d84e91dbf client-go/dynamic: use CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 79370c6d676814758c60bbc1b71a882583be2214
2024-06-04 10:23:19 +02:00
Kubernetes Publisher
7c6e307a72 Merge pull request #125299 from karlkfi/karl-reflector-fix-2
Improve Reflector unit tests

Kubernetes-commit: 5bf1e95541d90e37f6c6637b5b45d8783e7907aa
2024-06-04 00:39:33 +00:00
Karl Isenberg
7c5e9038dd Update TestNewInformerWatcher for WatchListClient
- Switch to using the ProxyWatcher to validate the dance between
  closing the stop channel and closing the result channel.
- Use the new clientfeaturestesting.SetFeatureDuringTest to test with
  the WatchListClient enabled and disabled. These should result in
  almost the exact same output events from the informer
  (list ordering not garenteed), but with different input events
  recieved from the apiserver.

Kubernetes-commit: 28e3a728e5e6fe651d7a17839d33ce42204c0b4e
2024-06-03 17:31:59 -07:00
Karl Isenberg
8c9cb8838f Improve Reflector unit tests
- Add tests to confirm that Stop is always called.
- Add TODOs to show were Stop is not currently being called
  (to fix in a future PR)

Kubernetes-commit: ab5aa4762fd5206d0dbd8412d7c6f3b76533a122
2024-06-03 12:15:38 -07:00
Kubernetes Publisher
52e5651101 Merge pull request #122832 from benluddy/cbor-fuzz-native-to-unstructured-via
KEP-4222: Add roundtrip tests to Unstructured via CBOR and JSON.

Kubernetes-commit: f30a87d517c538f22e1d84b4d7c497f57f7b760a
2024-05-31 00:39:27 +00:00
Kubernetes Publisher
d81b8f6492 Merge pull request #123974 from p0lyn0mial/upstream-client-go-features-testing
client-go/features/testing: intro SetFeatureGatesDuringTest

Kubernetes-commit: 9a44f689167849e1251f801199e9517ee00fe6bd
2024-05-30 00:39:20 +00:00
Shingo Omura
7adab2f2f6 KEP-3619: Fine-grained SupplementalGroups control (#117842)
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api

* Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate

* Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields

* Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet

* Clarify `SupplementalGroupsPolicy` is an OS depdendent field.

* Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus

It is because, the process identity can be dynamic if the initially attached identity
has enough privilege calling setuid/setgid/setgroups syscalls in Linux.

* Rewording suggestion applied

* Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34

* Added validations for SupplementalGroupsPolicy and ContainerUser

* No need featuregate check in validation when adding new field with no default value

* fix typo: identitiy -> identity

Kubernetes-commit: 552fd7e85084b4cbd3ae8e81ff13433e28dc8327
2024-05-30 00:39:19 +00:00
Kubernetes Publisher
e8b54718d0 Merge pull request #123339 from skitt/canonical-json-patch
Update kustomize, use canonical json-patch v4 import

Kubernetes-commit: da02fdb2aef1b7102526963c91df4992ee5b6a05
2024-05-29 20:39:23 +00:00
Kubernetes Publisher
9c87eb0815 Merge pull request #125190 from pohly/record-event-panic
client-go record: avoid panic when watch creation failed

Kubernetes-commit: ea0ab06b6915945c20a86d1de588e4ac7a5b6d58
2024-05-29 06:20:33 -07:00
Patrick Ohly
b4e1cfcfab client-go record: avoid panic when watch creation failed
The previous attempt to fix this in
6aa779f4ed (diff-efa2cd1347df22ace5a516ea794152d00ef2a079db135c81787ed920ecb73658)
didn't address the root cause (or perhaps created it, not sure): the goroutine
must not be started if watch creation failed.

Instead, the error gets logged (as before) and an empty watch gets returned to
the caller (new). This is necessary because the function doesn't have an error
return value and changing that now would be disruptive. The empty watch is
valid and usable, so callers won't crash when they calls Stop.

This showed up recently in failed unit tests, probably because test
cancellation makes this error more likely:

   "Unable start event watcher (will not retry!)" err="broadcaster already
   stopped" logger="TestGarbageCollectorConstruction leaked goroutine"

The logger value and a preceding warning show that this occurs after test
completion.

Kubernetes-commit: 080432c46a7a49c3abf86d7fc5f2a5d7abc92239
2024-05-29 14:10:49 +02:00
Kubernetes Publisher
5d650114a5 Merge pull request #125159 from p0lyn0mial/upstream-add-data-consistency-checker-for-list-requests
client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 1d5589e4910ed859a69b3e57c25cbbd3439cd65f
2024-05-29 12:39:08 +00:00
Kubernetes Publisher
3f130bd830 Merge pull request #125166 from p0lyn0mial/upstream-improve-check-data-consistency
client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)

Kubernetes-commit: bc8ec4f9aaaeee7de285c0207bd8eb793ecf3307
2024-05-29 00:38:51 +00:00
Kubernetes Publisher
5f741a5d35 Merge pull request #125052 from p0lyn0mial/upstream-client-go-env-var-set
client-go/features: add Set method to the envvar impl

Kubernetes-commit: 8991e825d5f2affce16a05666c11d7a2a773a628
2024-05-28 16:39:07 +00:00
Kubernetes Publisher
b92b563c44 Merge pull request #124635 from pohly/event-broadcaster-shutdown-fix
client-go/tools/record: fix and test Broadcaster shutdown + logging

Kubernetes-commit: f4ea903712482c4a0021cc9c8d742673a213833e
2024-05-28 16:39:05 +00:00
Lukasz Szaszkiewicz
785fca481f client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)
Kubernetes-commit: 327ae9866bda463ae43bd133a2522d5beea5ed35
2024-05-28 12:22:59 +02:00
Kubernetes Publisher
f53839a9ad Merge pull request #125045 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.19.0, gomega v1.33.1

Kubernetes-commit: 1c84623028b496e22d8401100ef6f59325e092e0
2024-05-28 08:39:08 +00:00
Lukasz Szaszkiewicz
9f33e96b6a make update
Kubernetes-commit: 448180db60fc1d62174a18d1dd995d8deb081428
2024-05-27 15:31:15 +02:00
Kubernetes Publisher
c559583d36 Merge pull request #125146 from p0lyn0mial/upstream-client-go-consistency-detector-move-to-new-package
client-go: move data consistency detector to a new package

Kubernetes-commit: 9d5db28f5f5d5a35012dd6162af374420e6e1f4c
2024-05-27 06:24:08 -07:00
Lukasz Szaszkiewicz
b7ea49a199 client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 48014bd7bdc331efea509a752694393ac929f270
2024-05-27 15:11:50 +02:00
Lukasz Szaszkiewicz
538b7809aa move checkWatchListDataConsistencyIfRequested back to client-go/tools/cache
Kubernetes-commit: cb44f83b3d500bb2ed29f7634095bc64c9b21729
2024-05-27 11:22:28 +02:00
Lukasz Szaszkiewicz
e6e45e172b client-go/util/consistencydetector: make the detector public
Kubernetes-commit: e421046f64c90b58577a79f92dd463ab03479d79
2024-05-27 11:16:17 +02:00
Lukasz Szaszkiewicz
92f0985ce1 client-go/util/consistencydetector: update after moving to the new package
Kubernetes-commit: faf5110c8a2394f9d098da6e5097ce6deed1b18b
2024-05-27 11:13:18 +02:00
Lukasz Szaszkiewicz
e428fc295c move client-go/tools/cache/reflector_data_consistency_detector to client-go/util/consistencydetector
Kubernetes-commit: 272dfc9d7e61481dfcdc4d6a021385d9cd85ba5f
2024-05-27 11:10:43 +02:00
Kubernetes Publisher
fd6b8e6551 Merge pull request #125144 from p0lyn0mial/upstream-client-go-consistency-detector-refactor-units
client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests

Kubernetes-commit: 58fe98e2cc7f8efac886765af230a48285d7b9b6
2024-05-27 03:26:50 -07:00
Lukasz Szaszkiewicz
00036b79c4 client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests
Kubernetes-commit: 18837d60ae12ac70380ce5cf21cfd8e0d221263a
2024-05-27 11:10:00 +02:00
Kubernetes Publisher
0123e78ef6 Merge pull request #124446 from p0lyn0mial/watch-list-consistency-detector-more-generic
client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested

Kubernetes-commit: f5d62f738a686ddc6221a85374113af80790129e
2024-05-27 08:39:07 +00:00
Lukasz Szaszkiewicz
e89e40c187 client-go/rest: add TestWatchListWhenFeatureGateDisabled unit test
Kubernetes-commit: 8c0c1f720182f138c3151d3d67a80fa67b86a240
2024-05-23 16:33:43 +02:00
Lukasz Szaszkiewicz
e8eae94e45 client-go/features/testing: intro SetFeatureGatesDuringTest
Kubernetes-commit: 3d97808b95b355bb8e56d4d720342e9a7ab95ced
2024-05-23 14:44:11 +02:00
Lukasz Szaszkiewicz
98df4f79ac client-go/features: add Set method to envvar impl
Kubernetes-commit: a07654baa54d53d7649e981c0c65eb8d1210e4af
2024-05-22 15:42:47 +02:00
Patrick Ohly
2f2b800097 dependencies: ginkgo v2.19.0, gomega v1.33.1
Ginkgo v2.18.0 allows tweaking the output so that
it's easier to follow while a job runs in
Prow (https://github.com/onsi/ginkgo/issues/1347). Using this in
hack/ginkgo-e2e.sh will follow in a separate commit.

Gomega gets bumped to the latest release to keep it up-to-date.

Ginkgo v1.19.0 adds support for --label-filter with labels that represent
sets (like our Feature:<Foo>).

Kubernetes-commit: 37e2dd6857084a172ef5210caee1fefa8dd8159a
2024-05-22 10:22:09 +02:00
Ben Luddy
3aa51ce508 Update indirect dependencies with ./hack/update-vendor.sh.
Implementing custom marshaling on several API types for CBOR makes the upstream CBOR library an
indirect dependency of several staging modules.

Kubernetes-commit: d7cccf3e792ad08d9ab2e7aac394f8e6ddcf3466
2024-05-17 13:02:26 -04:00
Patrick Ohly
ebbf7d7dc3 client-go/tools/record: fix and test Broadcaster shutdown + logging
Constructing a Broadcaster already starts a watch which runs in the
background. Shutdown must be called to avoid leaking the goroutine.  Providing
a context was supposed to remove the need to call Shutdown, but that did not
actually work because the logic for "must check for cancellation" was
accidentally inverted.

While at it, structured log output also gets tested together with checking for
goroutine leaks.

Kubernetes-commit: ff779f1cb56cf896405e52f7923188b99b88bb00
2024-04-30 12:16:55 +02:00
Wojciech Tyczyński
b444e6c32e Implement ResilientWatchCacheInitialization
Kubernetes-commit: a8ef6e9f0104a44023162bb8229fb677ec80beb1
2024-04-29 14:19:46 +02:00
Lukasz Szaszkiewicz
6bdde7723e client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested
the signature of the method was tightly connected to the reflector,
making it difficult to use for anything other than a reflector.

this simple refactor makes the method more generic.

Kubernetes-commit: 83c7542abc8c542c01ecb67376f134b2071c5304
2024-04-22 14:01:22 +02:00
Kubernetes Publisher
c7396197f3 Merge pull request #122791 from p0lyn0mial/upstream-cleanup-watch-list-env-var
cleanup: replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate

Kubernetes-commit: 8c1983ffc0b6fe2293fc721cef8d961d79aafc53
2024-05-21 02:05:35 -07:00
Lukasz Szaszkiewicz
4a34196022 replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate
Kubernetes-commit: 9248cccc27fdd52a9a99fd9ad6e47ada9ee8b568
2024-04-30 08:24:53 +02:00
Kubernetes Publisher
86f83bc818 Merge pull request #124614 from p0lyn0mial/upstream-reflector-warn-no-bookmark-event
client-go/reflector: warns when the bookmark event for initial events hasn't been received

Kubernetes-commit: b10a141fd2c291feea78c4e36483933b25368224
2024-05-20 16:38:45 +00:00
Lukasz Szaszkiewicz
0280901a4d client-go/reflector: warns when the bookmark event for initial events hasn't been received
Kubernetes-commit: 93960f489069a744afda1be42f82349e25d7e4d7
2024-04-29 15:18:54 +02:00
Kubernetes Publisher
62f959700d Merge pull request #124588 from jiuker/patch-2
fix: Hang when canceling leader election information

Kubernetes-commit: 7a6931b31cf04d2a91ce8c0af09ad0f474927436
2024-05-09 04:33:13 +00:00
Kubernetes Publisher
8a8d0731de Merge pull request #124757 from dims/update-to-latest-golang.org/x/oauth2-v0.20.0
Update to latest golang.org/x/oauth2 v0.20.0

Kubernetes-commit: 22578c545ffc04a505a7a64c9b8f6c78fefa07ef
2024-05-09 00:31:52 +00:00
Davanum Srinivas
988ddc2b6c Update to latest golang.org/x/oauth2 v0.20.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 04c40ac96134d7f7bf697d0a58caf0f8b0380075
2024-05-08 11:04:34 -04:00
Kubernetes Publisher
4ebe42d8c9 Merge pull request #124600 from alvaroaleman/typed-wq
Use the generic/typed workqueue throughout

Kubernetes-commit: 1dc30bf90fd6a729d226b4e942118110b0a73e65
2024-05-07 00:31:06 +00:00
Kubernetes Publisher
d3682da14f Merge pull request #124519 from dims/drop-all-the-providery-things-take-2
Remove gcp in-tree cloud provider and credential providers

Kubernetes-commit: 4d17d30029aaddc2132d65c019e30d1c153bf4d1
2024-05-06 16:31:39 +00:00
Patryk Małek
35cab326ad fix(api): make LocalObjectReference.Name and HostAlias.IP required (#124553)
* fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required

* chore(api): add LocalObjectReference comment

* chore(api): add omitempty to LocalObjectReference's Name

* chore(api): add kubebuilder:default annotation

* chore(api): ./hack/update-codegen.sh

Kubernetes-commit: 8dbeaa5786bab14772873cc90af70ccb9b06b4c1
2024-05-04 00:30:57 +00:00
Davanum Srinivas
64ff14beda address comments during review
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 7187d9af81eb1dc2691e7faeb1aaa254d85cc860
2024-05-01 09:06:11 -04:00
Kubernetes Publisher
049f231649 Merge pull request #124562 from sbueringer/pr-bump-sigs-yaml
Bump sigs.k8s.io/yaml to v1.4.0

Kubernetes-commit: c1ef6c44f5d7b582bf19669c6dbf2ff9552b9d6c
2024-04-29 21:36:55 +00:00
Alvaro Aleman
9aa3aae99d Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.

Kubernetes-commit: 6d0ac8c561a7ac66c21e4ee7bd1976c2ecedbf32
2024-04-28 18:26:18 +02:00
jiuker
f9eba8e8c3 fix: Hang when canceling leader election information
Hang when canceling leader election information.
Occasionally, two leaders may run simultaneously.

Kubernetes-commit: b6b46a0e00682517d2ca7b7e9c2706b8e407e52e
2024-04-28 15:06:51 +08:00
Stefan Bueringer
ea434dfecf Bump sigs.k8s.io/yaml to v1.4.0
Kubernetes-commit: 04cc45b4adda1b19d5067d45ed246c0f84fed966
2024-04-26 15:28:17 +02:00
Kubernetes Publisher
6b47d7dcbe Merge pull request #124344 from wojtek-t/fix_transformer
Fix race in informer transformers

Kubernetes-commit: 0b15f8cbfc611889f703495ee845b3c54bdd759d
2024-04-24 21:36:39 +00:00
Kubernetes Publisher
178bcf2846 Merge pull request #124469 from serathius/etcd-3.5.13
Upgrade etcd libraries to v3.5.13

Kubernetes-commit: 0f063280964b09e0e21c8cc457a181c20c68da61
2024-04-24 17:36:36 +00:00
Kubernetes Publisher
f3332a08cc Merge pull request #124263 from alvaroaleman/typed
Workqueue: Add generic versions that are properly typed

Kubernetes-commit: b3f5c5722352af8a4c9434d9ff6ba55baee16d36
2024-04-24 17:36:33 +00:00
Kubernetes Publisher
9433226579 Merge pull request #124075 from pohly/dra-api-comments
DRA: API cleanup + fix

Kubernetes-commit: 62895895094cbb59fe39176afd484ce3d2505b61
2024-04-24 01:36:42 +00:00
Kubernetes Publisher
4a5f039360 Merge pull request #122657 from p0lyn0mial/upstream-client-go-rest-client-watch-list
add watchlist to client-go rest client

Kubernetes-commit: 78533415e06199d13f81e78acf9ff2e0f7460801
2024-04-23 13:36:38 +00:00
Marek Siarkowicz
e4f9b83713 Upgrade etcd libraries to v3.5.13
Add otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents, otelgrpc.SentEvents) to tracing options due to https://github.com/open-telemetry/opentelemetry-go-contrib/pull/3964

Kubernetes-commit: 3e5b03eb433ee359782f5aa6e9368ab2a0d0370c
2024-04-23 11:10:37 +02:00
Kubernetes Publisher
47f558294c Merge pull request #124328 from jiahuif-forks/deps/cel-go
bump cel-go to v0.20.1 and refit CEL libraries

Kubernetes-commit: 16a594f907d0d4a6224dab2d0704793d5e7898f6
2024-04-23 01:36:50 +00:00
Kubernetes Publisher
66b378aea8 Merge pull request #124340 from benluddy/dynamic-client-golden-request-test
Add test to detect unintentional changes in dynamic client requests.

Kubernetes-commit: 80134bcc85fb753c5809b341bb5e34e422ca4b37
2024-04-23 01:36:48 +00:00
Kubernetes Publisher
02e371e437 Merge pull request #121574 from skitt/generic-lister-gen
Generify lister-gen

Kubernetes-commit: 6b260382a1b5e461c39289892b1d3a3b335ecc67
2024-04-23 01:36:47 +00:00
Jiahui Feng
d071c08540 generated: ./hack/update-vendor.sh
Kubernetes-commit: 350fcf957e90501f0b224b7ccf771b29d4d5c6b6
2024-04-22 10:54:32 -07:00
Kubernetes Publisher
5b2b83af72 Merge pull request #124346 from jwcesign/master
upgrade: upgrade dependencies github.com/prometheus/common to the newest version

Kubernetes-commit: 76de052680da0b7a59b35fb79db7ab322faf2854
2024-04-22 17:36:45 +00:00
Stephen Kitt
841e997e33 Improve the lister function documentation
In particular, document that ListAllByNamespace delegates to ListAll
if no namespace is specified.

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

Kubernetes-commit: 54e899317ef46e3b70827cacee244717022db0ad
2024-04-19 17:58:02 +02:00
jwcesign
5db05eb767 upgrade: upgrade dependencies github.com/prometheus/common to the newest version
Signed-off-by: jwcesign <jwcesign@gmail.com>

Kubernetes-commit: f0aa62bc96d6e734249adfa3e094a52e45c8fb6d
2024-04-17 18:15:27 +08:00
Kubernetes Publisher
b1c1c0345d Merge pull request #122892 from danwinship/codegen-nil
Fix generated fake clients to have same semantics as real clients on error

Kubernetes-commit: 573832a42f03af912a5611eb4e81a0e812a5ddf2
2024-04-18 17:36:39 +00:00
Kubernetes Publisher
506bc538e6 Merge pull request #113257 from claudiubelu/path-filepath-update-staging
Replaces path.Operation with filepath.Operation (staging)

Kubernetes-commit: 80542ca2e318f6f82429822b267497570b7ecca5
2024-04-18 17:36:38 +00:00
Kubernetes Publisher
3407442ff2 Merge pull request #124245 from wojtek-t/informer_options
Allow for configuring MinWatchTimeout in reflector

Kubernetes-commit: 32a3cbc51dd1d572ba3d6eba66df333e1454dd58
2024-04-18 13:36:35 +00:00
Kubernetes Publisher
9990b0b122 Merge pull request #123969 from liangyuanpeng/cleanup_rand
cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.

Kubernetes-commit: 7f67cb5960d8f93e6f005821d2c1b12dcde3dece
2024-04-18 09:36:51 +00:00
Kubernetes Publisher
a82df61b84 Merge pull request #123937 from p0lyn0mial/upstream-use-initial-events-annotation-key-const
use metav1.InitialEventsAnnotationKey const

Kubernetes-commit: c016b0b9a8ca63dbec1fade0910c2a06017cc4ab
2024-04-18 09:36:50 +00:00
Kubernetes Publisher
79491afc36 Merge pull request #123347 from zhouhaibing089/abstract-queue
workqueue: make queue as configurable

Kubernetes-commit: 301eb8d47a794393a85a9449ab6b29d902ed06bd
2024-04-18 09:36:49 +00:00
Wojciech Tyczyński
2fe05741c1 Fix race in informer transformers
Kubernetes-commit: e9f74597a8e7104b26640614e952d4453654453b
2024-04-17 11:19:08 +02:00
Ben Luddy
4cd6b756be Generate HTTP request fixtures for dynamic client tests.
Kubernetes-commit: e335b8e81b467c70f0f8a485f69e5664adbbc687
2024-04-16 12:49:15 -04:00
Ben Luddy
b17c363481 Add test to detect unintentional changes in dynamic client requests.
Kubernetes-commit: a803c8034d60a81b0da71ea8631e27888a607476
2024-04-16 12:48:12 -04:00
Jiahui Feng
34d780971c generated: ./hack/pin-dependency.sh github.com/google/cel-go v0.20.1
Kubernetes-commit: 94997c6fefa2791192d0a7ab68b02bf5d8b6c2c5
2024-04-15 13:33:10 -07:00
Alvaro Aleman
d67dddfe90 Workqueue: Add generic versions that are properly typed
This change adds a generic version of the various workqueue types while
retaining compatibility for the existing exported symbols and constructors.
The generic variants are prefixed with `Typed` and the existing ones are
marked as deprecated to nudge people to transition without breaking
them.

Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc
2024-04-11 18:11:41 -04:00
Wojciech Tyczyński
b9e952f4d7 Allow for configuring MinWatchTimeout in Reflector and Informer.
Kubernetes-commit: 29e38c19b853b6cc3950541b1727395acf5eb4d3
2024-04-09 09:12:54 +02:00
Wojciech Tyczyński
7da319745b Refactor informer constructors
Kubernetes-commit: 4da185a601e1f657a873dfd7e51efcc8a3b94c37
2024-04-09 09:06:38 +02:00
Kubernetes Publisher
aa7909e7d7 Merge pull request #124174 from dims/update-x/net-for-CVE-2023-45288
Update x/net for CVE-2023-45288

Kubernetes-commit: d9c54f69d4bb7ae1bb655e1a2a50297d615025b5
2024-04-04 03:56:29 +00:00
Davanum Srinivas
a2cc490854 Update x/net for CVE-2023-45288
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 99fac38d2864e6bc9bb7cd1743d658caa1360c0c
2024-04-03 16:37:18 -04:00
Patrick Ohly
a457c5ed68 DRA api: ResourceHandle.DriverName is required
It was already required via validation, but not declared as such by the
OpenAPI.

Kubernetes-commit: 1a13b0aa3333d04ae67a6fcdd21c8e2a042dc0c2
2024-03-27 11:22:35 +01:00
Kubernetes Publisher
1518fca9f0 sync: update go.mod 2024-03-18 11:59:16 +00:00
Lan Liang
fa185a21db cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
see https://tip.golang.org/doc/go1.20

Signed-off-by: Lan Liang <gcslyp@gmail.com>

Kubernetes-commit: dc992adad385ab631e4a528ee6a342ea71e7a379
2024-03-18 08:10:12 +00:00
Kubernetes Publisher
eea636f8f4 Merge pull request #123932 from pohly/dra-api-resource-model-rename
dra api: NodeResourceModel -> ResourceModel

Kubernetes-commit: d194e6d06c4f1004cebe00f2c539a564f77276ec
2024-03-14 20:57:49 +00:00
Kubernetes Publisher
4467b1e437 Merge pull request #123909 from AkihiroSuda/fix-123906
kubelet: fix mixing up runtime classes with runtime handlers

Kubernetes-commit: 6ef2fec0dfef0c1fc456fac90d028b5c9431b6a0
2024-03-14 20:57:47 +00:00
Patrick Ohly
650f39267a dra api: NodeResourceModel -> ResourceModel
When renaming NodeResourceSlice to ResourceSlice, the embedded
[Node]ResourceModel also should have been renamed.

Kubernetes-commit: a0add8d2c7578cd9f94fc302d6212f9f7d16175b
2024-03-14 14:08:17 +01:00
Akihiro Suda
00e4609774 api: NodeStatus: rename RuntimeClasses to RuntimeHandlers
The runtime classes are apiserver's concept, while the handlers are kubelet's concept.
For NodeStatus, it makes more sense to return the latter ones here.

This commit modifies the following files:

- pkg/apis/core/types.go
- staging/src/k8s.io/api/core/v1/types.go
- pkg/kubelet/nodestatus/setters.go
- pkg/kubelet/kubelet_node_status.go
- pkg/registry/core/node/strategy.go
- test/e2e_node/mount_rro_linux_test.go

Other changes were auto-generated by running `make update`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

Kubernetes-commit: 1dc05009fe7f4e1d139b0c8394683edb54f8d082
2024-03-14 07:21:47 +09:00
Lukasz Szaszkiewicz
45e17fede0 client-go/cache/reflector: use metav1.InitialEventsAnnotationKey
Kubernetes-commit: a953539fb57b2ee18337f323ef15425a4d6207ed
2024-03-11 12:56:40 +01:00
Kubernetes Publisher
7ebe0ea60e Merge pull request #123180 from AkihiroSuda/rro
KEP-3857: Recursive Read-only (RRO) mounts

Kubernetes-commit: eafd2897e24b5b069bcdf83ac7a9b2c0b894dbb8
2024-03-09 20:04:20 +00:00
Akihiro Suda
3be09aa8db api: KEP-3857: Recursive Read-only (RRO) mounts
This commit modifies the following files:

- pkg/apis/core/types.go
- staging/src/k8s.io/api/core/v1/types.go

Other changes were auto-generated by running `make update`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

Kubernetes-commit: d940886d0a4ee9aa8a7ca075fee175b002baf883
2024-03-09 09:48:12 +09:00
Kubernetes Publisher
110b75b14e Merge pull request #123344 from nilekhc/svm-controller
[Storage Version Migration] feat: implements Storage Version Migration

Kubernetes-commit: 28c4d00c7dcc9a72853a4da0885e6fac09a2f40e
2024-03-09 00:05:04 +00:00
Haibing Zhou
9c3db8681d workqueue: make queue as configurable
The default queue implementation is mostly FIFO and it is not
exchangeable unless we implement the whole `workqueue.Interface` which
is less desirable as we have to duplicate a lot of code. There was one
attempt done in [kubernetes/kubernetes#109349][1] which tried to
implement a priority queue. That is really useful and [knative/pkg][2]
implemented something called two-lane-queue. While two lane queue is
great, but isn't perfect since a full slow queue can still slow down
items in fast queue.

This change proposes a swappable queue implementation while not adding
extra maintenance effort in kubernetes community. We are happy to
maintain our own queue implementation (similar to two-lane-queue) in
downstream.

[1]: https://github.com/kubernetes/kubernetes/pull/109349
[2]: https://github.com/knative/pkg/blob/main/controller/two_lane_queue.go

Kubernetes-commit: 87b4279e07349b3c68f16f69a349a02bddd12f25
2024-02-16 12:09:37 -08:00
Stephen Kitt
16552d4656 Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

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

Kubernetes-commit: 5300466a5c8988b479a151ceb77f49dd00065c83
2024-02-16 13:57:24 +01:00
Stephen Kitt
ffda3468aa Update kubectl kustomize to kyaml/v0.17.1, cmd/config/v0.14.1, api/v0.17.2, kustomize/v5.4.2
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 33c6f6bc65395aa514c9cf17115a1c63564c22e7
2024-05-27 17:42:29 +02:00
Davanum Srinivas
af62623c06 Remove gcp in-tree cloud provider and credential provider
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: bf268f02a3567c1af29199c27a7cf61cca494b2d
2024-01-25 08:47:20 -05:00
Dan Winship
3d4f98db0e Regenerate fake clients
Kubernetes-commit: 17ab25b121d05355700f39628d5d45ab3da446f8
2024-01-20 10:20:43 -05:00
Lukasz Szaszkiewicz
a1be94abc3 client-go/rest: introduce watchlist
Kubernetes-commit: ad3d138cda76fc0267da5131fa3ff7906e2ddf76
2024-01-08 16:43:26 +01:00
Nilekh Chaudhari
02f21344ac feat: implements svm controller
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

Kubernetes-commit: 9161302e7fd3a5fb055b2f2572c6e1228240bb51
2024-01-04 19:34:05 +00:00
Stephen Kitt
9d701d3504 Regenerate all listers
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: e6f44957cdb961d1ada2ae570d331c6bc0ecc8e2
2023-11-09 17:39:39 +01:00
Stephen Kitt
05ff4bb2fd Generify lister-gen
This adds a generic implementation of a lister, and uses it to replace
the template code in generated listers. The corresponding templates
are no longer used and are removed.

Listers are reduced to their interfaces (non-namespaced and namespaced
if appropriate), their specific structs, and their constructors. All
method implementations are provided by the generic implementation. The
dedicated interface is preserved so that each lister can have its own
set of methods (e.g. the method returning the namespaced lister if
appropriate), and the dedicated struct is preserved to allow
expansions to be defined where necessary.

The external interface is unchanged and doesn't expose generics.

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

Kubernetes-commit: 2e9adcd14aae27394238291fa08fb603bf2f3e77
2023-10-27 16:57:01 +02:00
Nilekh Chaudhari
b0efa42e52 feat: implements Storage Version Migration API in-tree
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

Kubernetes-commit: 91a7708cdcea8cdb1d7db2cc8a27c57741e0cddc
2023-10-10 20:23:08 +00:00
Kubernetes Publisher
84dfaee610 Merge pull request #123516 from pohly/dra-structured-parameters
DRA: structured parameters

Kubernetes-commit: 7ea3d0245a63fbbba698f1cb939831fe8143db3e
2024-03-08 04:03:59 +00:00
Kubernetes Publisher
d2c6177154 Merge pull request #123412 from tenzen-y/add-new-jobsuccesspolicy-api
Job: Support for the SuccessPolicy

Kubernetes-commit: 364ef335dbd49bfa3d66dbc606c642481d283851
2024-03-08 00:04:09 +00:00
Patrick Ohly
fee411cff2 dra api: rename NodeResourceSlice -> ResourceSlice
While currently those objects only get published by the kubelet for node-local
resources, this could change once we also support network-attached
resources. Dropping the "Node" prefix enables such a future extension.

The NodeName in ResourceSlice and StructuredResourceHandle then becomes
optional. The kubelet still needs to provide one and it must match its own node
name, otherwise it doesn't have permission to access ResourceSlice objects.

Kubernetes-commit: 0b6a0d686a060b5d5ff92cea931aacd4eba85adb
2024-03-07 10:14:11 +01:00
Patrick Ohly
4c32855540 dra api: implement semver attribute value type
This adds support for semantic version comparison to the CEL support in the
"named resources" structured parameter model. For example, it can be used to
check that an instance supports a certain API level.

To minimize the risk, the new "semver" type is only defined in the CEL
environment for DRA expressions, not in the base library. See
https://github.com/kubernetes/kubernetes/pull/123664 for a PR which
adds it to the base library.

Validation of semver strings is done with the regular expression from
semver.org. The actual evaluation at runtime then uses semver/v4.

Kubernetes-commit: 42ee56f093133402ed860d4c5f54b049041386c9
2024-03-04 09:13:19 +01:00
Patrick Ohly
95cf817801 dra: add "named resources" structured parameter model
Like the current device plugin interface, a DRA driver using this model
announces a list of resource instances. In contrast to device plugins, this
list is made available to the scheduler together with attributes that can be
used to select suitable instances when they are not all alike.

Because this is the first structured parameter model, some checks that
previously were not possible, in particular "is one structured parameter field
set", now gets enabled. Adding another structured parameter model will be
similar.

The applyconfigs code generator assumes that all types in an API are defined in
a single package. If it wasn't for that, it would be possible to place the
"named resources" types in separate packages, which makes their names in the Go
code more natural and provides an indication of their stability level because
the package name could include a version.

Kubernetes-commit: d4d5ade7f5be047472f8d9572c7f01f142951a2d
2024-02-23 15:22:02 +01:00
Yuki Iwai
49bc97e518 Job: Support for the JobSuccessPolicy (alpha)
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

Kubernetes-commit: e216742672aa1bfd10b5cc84fa9191eddadeac72
2024-02-21 15:49:35 +09:00
Kubernetes Publisher
47abbe0251 Merge pull request #123435 from tallclair/apparmor-ga
AppArmor fields API

Kubernetes-commit: bd25605619cbfb46b075002a6db58b4e489fc8cb
2024-03-07 05:05:16 +00:00
Kubernetes Publisher
0cdc0ce850 Merge pull request #123758 from liggitt/protobump
[CVE-2024-24786] Bump github.com/golang/protobuf v1.5.4, google.golang.org/protobuf v1.33.0

Kubernetes-commit: a5f5f44157c49fdfb6384862c7cb34c2ddbd4cce
2024-03-06 17:05:15 +00:00
Jordan Liggitt
8b11b2fa6b Bump github.com/golang/protobuf v1.5.4, google.golang.org/protobuf v1.33.0
Kubernetes-commit: c6673d2346c814ddb4629c569bdc659ffa0c583f
2024-03-06 09:47:28 -05:00
Kubernetes Publisher
e34b66436f Merge pull request #123405 from cici37/vapGA
[KEP-3488]Promote ValidatingAdmissionPolicy to GA

Kubernetes-commit: 2b521e5f8e6b99e84d464d8fa35658aed35bd13c
2024-03-06 05:02:50 +00:00
Kubernetes Publisher
8c60342479 Merge pull request #123729 from seans3/streaming-owners
Adds OWNERS files to client-go streaming dirs

Kubernetes-commit: 262399065dab3c5aa04fff83f04c2c4d3f3e444b
2024-03-06 00:51:29 +00:00
Kubernetes Publisher
82506389a2 Merge pull request #122998 from MikeSpreitzer/add-deletion-handling
Add DeletionHandlingObjectToName

Kubernetes-commit: 6efef796f6f3ee4825359ec4f77d2c2ee936e363
2024-03-05 21:05:35 +00:00
Michał Woźniak
d1672351e4 Support for the Job managedBy field (alpha) (#123273)
* support for the managed-by label in Job

* Use managedBy field instead of managed-by label

* Additional review remarks

* Review remarks 2

* review remarks 3

* Skip cleanup of finalizers for job with custom managedBy

* Drop the performance optimization

* imrpove logs

Kubernetes-commit: e568a77a931a1cf4239a4a5fa43e2b05bad3abdf
2024-03-05 21:05:30 +00:00
Sean Sullivan
62aace94ab Adds OWNERS files to client-go streaming dirs
Kubernetes-commit: 855bc74023900b31095de72ae49c79d5d391aad5
2024-03-05 20:21:48 +00:00
Kubernetes Publisher
64334495a6 Merge pull request #123487 from gauravkghildiyal/kep-4444
Introduce trafficDistribution field for Kubernetes Services

Kubernetes-commit: a76a3e031fc950a9c2429e611fd0bb00a117b1fc
2024-03-05 04:51:58 +00:00
Kubernetes Publisher
6810f4fa0d Merge pull request #123679 from seans3/remotecommand-extend-deadlines
Extend deadlines to one minute

Kubernetes-commit: 0bcf6e3ddee25621428017e135ce04879b32e659
2024-03-05 04:51:52 +00:00
Kubernetes Publisher
f323801a34 Merge pull request #123413 from seans3/tunneling-spdy-websockets
PortForward: Tunnel SPDY through WebSockets

Kubernetes-commit: f745503112e06d6ff199e929d536c6a29825c01a
2024-03-05 04:51:50 +00:00
Sean Sullivan
ae38726e6e extend deadlines to one minute
Kubernetes-commit: b04d1177efb0cfc84b76732848eef8f0ea89b25b
2024-03-04 11:31:56 -08:00
Sean Sullivan
4b03fda005 re-write fallback dialer unit test
Kubernetes-commit: 33af937b4a5f4eb5c5005bddb483317f042da515
2024-03-04 10:52:59 -08:00
Sean Sullivan
79f21dcaa8 removes extra upgrade aware proxy logging; returns tunneling connection close error
Kubernetes-commit: e8bbb221d36f1adf4116752990c0c4f17a9e5deb
2024-03-02 16:10:39 -08:00
Gaurav Ghildiyal
64b46766f1 Run 'make update'
Kubernetes-commit: 646fd200b8532b0df95df300a8351379315f3ac9
2024-02-23 12:23:32 -08:00
Sean Sullivan
271d034e86 portforward: tunnel spdy through websockets
Kubernetes-commit: 8b447d8c97e8823b4308eb91cf7d75693e867c61
2024-02-21 08:56:07 +00:00
Kubernetes Publisher
08128e0dfa Merge pull request #123635 from seans3/remotecommand-write-deadline
Increase client-side websocket write deadline

Kubernetes-commit: 0a31504ee114e363df9d69158c2e639858b8273b
2024-03-02 08:51:54 +00:00
Kubernetes Publisher
1002c2f9bd Merge pull request #123484 from erikgb/csa-upgrade-subresource
Add option to upgrade subresource from CSA to SSA

Kubernetes-commit: 65d75501f7d7348db1610e755e654b67c6639897
2024-03-02 05:12:54 +00:00
Sean Sullivan
f759d2e976 increases client-side websocket write deadline to 30 seconds
Kubernetes-commit: 1d4be7527f8b2d2c4eb6dcc7ef58b4c3133f6f19
2024-03-01 18:16:44 -08:00
Kubernetes Publisher
d48adf87e6 Merge pull request #122882 from Jefftree/agg-discovery-v2-usage
Use Aggregated Discovery v2 types and promote to GA

Kubernetes-commit: 3f25211d69b4412e3e926835067918f86f629f3e
2024-03-01 14:41:02 -08:00
Erik Godding Boye
0b7086f721 feat: add csaupgrade option to upgrade subresource
Kubernetes-commit: 9633e25579dfa5449450875b9a238acc7cfac3e8
2024-02-24 15:44:21 +01:00
Tim Allclair
db79dcf23b Generated code
Kubernetes-commit: b7f620c12b7f2dbd7907ccad1ca63811a5c5766b
2024-02-20 20:04:35 -08:00
Patrick Ohly
c3231901f2 dra api: add structured parameters
NodeResourceSlice will be used by kubelet to publish resource information on
behalf of DRA drivers on the node. NodeName and DriverName in
NodeResourceSlice must be immutable. This simplifies tracking the different
objects because what they are for cannot change after creation.

The new field in ResourceClass tells scheduler and autoscaler that they are
expected to handle allocation.

ResourceClaimParameters and ResourceClassParameters are new types for telling
in-tree components how to handle claims.

Kubernetes-commit: 39bbcedbcae84bf716923b3f9464968ca70b42e7
2024-02-14 14:38:42 +01:00
cici37
4ceeb096c4 Auto updates
Kubernetes-commit: 5d83282823d5ee728d610befb389e3732b4503c3
2024-02-01 01:00:24 +00:00
Mike Spreitzer
61be9f118e Add DeletionHandlingObjectToName
Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>

Kubernetes-commit: d60a25b2db52d7e180b0962e23cc06e71f36fb29
2024-01-26 13:28:06 -05:00
Jefftree
4bf7f9496e Use v2 types with agg discovery
Kubernetes-commit: 462dd326c2e98d937a96d49002883000efe4b2d6
2024-01-19 16:13:47 -05:00
Kubernetes Publisher
1bed3f14c1 Merge pull request #123529 from thockin/go-workspaces
Go workspaces for k/k and k/staging/*

Kubernetes-commit: df366107d16aa2e2cdd620be41e592184f379da4
2024-03-01 20:51:36 +00:00
Kubernetes Publisher
1047f6396b Merge pull request #123598 from liggitt/remotecommand-cleanup
Remotecommand test flake cleanup

Kubernetes-commit: 0d50a398df50b2b7c21ed45c5e186906bc548c7a
2024-02-29 23:59:35 +00:00
Jordan Liggitt
27b1407865 Keep streams from being set up after closeAllStreamReaders is called
Kubernetes-commit: 6c1a935da2df8e6ccf1ea6afcf51cb288f355356
2024-02-29 15:31:55 -05:00
Jordan Liggitt
36a771f98c Make websocket heartbeat test timing less flaky
Kubernetes-commit: 26484df2108eff8ad6e06dfc960eae3bdfbf4663
2024-02-29 15:10:28 -05:00
Tim Hockin
b40bb27cf2 Fix up go.mod files after reviews
Because of how the previous 100+ commits were done, so changes snuck
thru that properly belong in earlier commits but it's not really
possible to do that without a lot of effort.

We agreed it was OK to "spackle" these cracks with a final commit.

Kubernetes-commit: 21715e6bbd19c932576ff268843d8ead3edb05e4
2024-02-28 16:50:55 -08:00
Kubernetes Publisher
d99a76c51e Merge pull request #123542 from liggitt/websocket-round-tripper-protocol
Use the websocket protocol header, verify selected protocol

Kubernetes-commit: e21a2f5d4f010e49cea1b954bd9b31d94e712c5b
2024-02-28 23:01:57 +00:00
Kubernetes Publisher
2f00261364 Merge pull request #123281 from seans3/remote-command-websocket-beta
RemoteCommand over WebSockets to Beta

Kubernetes-commit: f7ca532472f035db2aedc8a1f86639dfd1dc596f
2024-02-28 10:59:48 +00:00
Jordan Liggitt
e8b5ff9ea3 Use the websocket protocol header, verify selected protocol
Kubernetes-commit: b394aac4ce36457bd37459a58b4c3536d2f43d86
2024-02-27 18:00:45 -05:00
Tim Hockin
2c68d64279 Remove old gengo detritus
Kubernetes-commit: 812d5fff4011df4693dcdace516feec30ebff8ba
2024-02-26 23:31:41 -08:00
Sean Sullivan
7eae79e001 remote command turn on feature gates
Kubernetes-commit: a147693deb2e7f040cf367aae4a7ae5d1cb3e7aa
2024-02-13 14:10:40 -08:00
Kubernetes Publisher
8c4efe8d07 Merge pull request #123348 from hoskeri/update-go-x-crypto-19
Update x/crypto to 0.19.

Kubernetes-commit: 9a9028983806af26e7b48223f3a92922e94725df
2024-02-21 20:26:51 +00:00
Kubernetes Publisher
e88f4481f2 Merge pull request #123392 from thockin/depreciate
Cleanup: s/depreciated/deprecated/g

Kubernetes-commit: 11785bb815d58eb553be3a1fa305464c35d860cc
2024-02-21 12:27:26 +00:00
Tim Hockin
7087b65a74 Cleanup: s/depreciated/deprecated/g
Kubernetes-commit: 9f4b82bf3b079fe868effbd2498b61464db6d459
2024-02-18 14:50:55 -08:00
Abhijit Hoskeri
bb04dc47e3 Update x/crypto to 0.19.
Main reason is to pick up updated CA roots.

Full diff: https://github.com/golang/crypto/compare/v0.16.0...v0.19.0

Kubernetes-commit: d3a0e296defbb0b55e591e273004e79e7ebfb1fd
2024-02-16 20:18:14 +00:00
Kubernetes Publisher
306b201a2d Merge pull request #123250 from benluddy/dep-bump-cbor-v2.6.0
Bump github.com/fxamacker/cbor/v2 to v2.6.0.

Kubernetes-commit: e305e773bbfe8c5bdf9c57881a875e168b004b8c
2024-02-15 01:24:42 +00:00
Ben Luddy
d23a110967 Bump github.com/fxamacker/cbor/v2 to v2.6.0.
Kubernetes-commit: aac43dc96f2b679f0ab030fd3512c7e03b0f2df4
2024-02-12 15:46:17 -05:00
Kubernetes Prow Robot
dc532e7975 Merge pull request #1294 from dnwe/compatibility-matrix
chore(docs): refresh compatibility matrix
2024-02-13 10:38:36 -08:00
Kubernetes Publisher
5fb8d886b5 Merge pull request #122152 from pohly/client-go-event-context-fix
client-go events: support context.Background() as context

Kubernetes-commit: e51e3c74f720cd299e10a5e0c500a749bb36c251
2024-02-12 17:23:58 +00:00
Kubernetes Publisher
790cfadf62 Merge pull request #121486 from benluddy/cbor-stub
KEP-4222: Add stub CBOR serializer.

Kubernetes-commit: 48228bf9dbac308f43abd59a53fdc069fbddee0f
2024-02-10 01:28:08 +00:00
José Carlos Chávez
76174b8af8 chore: adds consistent vanity import to files and provides tooling for verifying and updating them. (#120642)
* chore: drops update vanity imports from script.

* chore: changes copyright year to 2024.

* chore: makes lint happy.

Kubernetes-commit: 6d6398ef9266abce3518a4c9a3d4e4d8feeffdc1
2024-02-08 13:38:07 +00:00
Dominic Evans
3d92ad924f chore(docs): refresh compatibility matrix
Bring the compatibility matrix up-to-date with more recent versions of
Kubernetes

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
2024-01-24 18:28:43 +00:00
Kubernetes Publisher
8092c71d36 Merge pull request #119398 from IvoGoman/feat/clientconfig-override-raw
k8s.io/client-go: add ClientConfig option to override raw config

Kubernetes-commit: a1ffdedf782edf1472102b0b99c1467d4ed39753
2024-01-24 02:12:19 +01:00
Tim Hockin
6458380755 Remove defunct references to "vendor"
Kubernetes-commit: d772f7719dc55ebfec2e9461b6e14bf17f5301df
2024-01-15 15:56:21 -08:00
Tim Hockin
b0062217a2 Get rid of most references to GOPATH
Kubernetes-commit: 10c32b3e2f4345dab582270b1a202dcd92dabd34
2024-01-03 17:14:38 -08:00
Tim Hockin
f1ec2cd017 Make update-codegen conversion work on gengo/v2
Kubernetes-commit: 5475797f4330dfd059773dd83e63f09f9b4f617a
2023-12-29 15:08:57 -08:00
Tim Hockin
94320f8765 Re-vendor latest kube-openapi and gengo/v2
./hack/pin-dependency.sh k8s.io/kube-openapi latest
./hack/pin-dependency.sh k8s.io/gengo/v2 latest
./hack/update-vendor.sh

Kubernetes-commit: 6f2f3735e04df5e4822176a2784069634c3c74a3
2024-02-26 17:02:22 -08:00
Patrick Ohly
2231ff5ae4 client-go events: support context.Background() as context
If, for whatever reason, the context was context.Background(), the additional
goroutine was started and then got stuck forever because
context.Background().Done() is a nil channel. Found when indirectly
instantiating a broadcaster with such a context:

    found unexpected goroutines:
    [Goroutine 9106 in state chan receive (nil chan), with k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster.func1 on top of the stack:
	goroutine 9106 [chan receive (nil chan)]:
	k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster.func1()
		/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record/event.go:206 +0x2c
	created by k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record.NewBroadcaster in goroutine 8957
		/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/record/event.go:205 +0x1a5

This can be fixed by checking for a nil channel.

Another problem also gets addressed: if Shutdown was called without canceling
the context, the goroutine also didn't stop. Now it waits for the cancelation
context and thus terminates in both cases.

Kubernetes-commit: eed6e29a5b8cfaa20fbc426541d9c74105d430ee
2023-12-01 18:35:28 +01:00
Ben Luddy
dc967a1ca9 Update vendoring to take new CBOR library dependency.
Kubernetes-commit: 09a1abda998fc37e2e29a120a82be7c6271656e0
2023-10-17 16:51:52 -04:00
Ivo Gosemann
89528c43be k8s.io/client-go: add OverridingClientConfig overriding RawConfig
Kubernetes-commit: 740b4c456d731922196f8231df9ab585198696d6
2023-07-18 13:40:12 +02:00
Ivo Gosemann
17b5405ddb k8s.io/client-go: add ClientConfig option to override raw config
Kubernetes-commit: db80aa56ed8bcf4115e30fc62d27c8a8d8ec7f92
2023-07-18 13:40:12 +02:00
Kubernetes Publisher
657d7be98b Merge pull request #122873 from p0lyn0mial/upstream-reflector-usewatchlist-pointer
client-go/reflector: make UseWatchList a pointer

Kubernetes-commit: 445869a59bdbd1c587b72b52c5da94c1d1c316a1
2024-01-22 18:20:58 +01:00
Lukasz Szaszkiewicz
202c415847 client-go/reflector: make UseWatchList a pointer
until #115478(use streaming against the etcd storage)
is resolved the cacher need a way to disable the streaming.

Kubernetes-commit: 41e706600aea7468f486150d951d3b8948ce89d5
2024-01-19 13:48:29 +01:00
Kubernetes Publisher
ffe7bf60eb Merge pull request #122842 from pohly/klog-update
dependencies: klog v2.120.1

Kubernetes-commit: b27b56a46c4c1e6be0dc2b1a0230d86223a7e903
2024-01-18 21:21:59 +00:00
Kubernetes Publisher
7e651e598d Merge pull request #122839 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.15.0, gomega v1.31.0

Kubernetes-commit: c82da711b0e2184f851675aac4596bbd0f74763f
2024-01-18 21:21:57 +00:00
Patrick Ohly
b2c0677f40 dependencies: klog v2.120.1
Kubernetes-commit: e2222f1e304831cbbc57b61afa373612297055fb
2024-01-18 16:58:40 +01:00
Patrick Ohly
eab7383fd8 dependencies: ginkgo v2.15.0, gomega v1.31.0
The main reason for updating is support for reporting the cause of context
cancellation: Ginkgo provides that information when canceling a context and
Gomega polling code includes that when generating a failure message.

Kubernetes-commit: 18f0af1f000f95749ca1ea075d62ca89e86bb7da
2024-01-18 12:45:55 +01:00
Kubernetes Publisher
aa81cb55f0 Merge pull request #122142 from pohly/client-go-events-adapter-context
client-go events: also support context for NewEventBroadcasterAdapter

Kubernetes-commit: a02a00ecd76fb99ed43a054ed6eb6698426b01f9
2024-01-18 09:21:31 +00:00
Kubernetes Publisher
b13c4f4b00 Merge pull request #122571 from p0lyn0mial/upstream-client-go-watch-list-fg
client-go/features: introduce WatchListClient feature gate

Kubernetes-commit: 026a27e5eb431c553d1204817cbf09f1005eca9b
2024-01-15 21:21:53 +00:00
Kubernetes Publisher
fb1e77b992 Merge pull request #122706 from pacoxu/klog-upgrade
bump klog to  v2.120.0

Kubernetes-commit: 823ecb58f68fbe0a4b37b32e11e75c6f2e0f467c
2024-01-11 21:21:47 +00:00
Paco Xu
a3cbf5a7be bump klog to v2.120.0
Kubernetes-commit: 3c86d21316c25b52a1cf3f9703a0bc2cbe97131c
2024-01-11 17:35:07 +08:00
Kubernetes Publisher
b0cf21f3e8 Merge pull request #122555 from p0lyn0mial/upstream-client-go-fg-provider-with-types
client-go/features: introduce feature gates

Kubernetes-commit: 0341e8294abffdfbdd4a038e0fd49d7f35ddc30a
2024-01-10 20:49:12 +01:00
Lukasz Szaszkiewicz
e8a81a3a43 client-go/features: warn when ordering initialization issue
ReplaceFeatureGates logs a warning when the default env var
implementation has been already used.
Such a situation indicates a potential ordering issue and usually is unwanted.

Kubernetes-commit: 04bbd3481f70825eea54b4b154a04d2496dcf652
2024-01-10 17:15:01 +01:00
Lukasz Szaszkiewicz
49ba51431a client-go/features: introduce WatchListClient feature gate
Kubernetes-commit: 7773b0f53fd5003c1e018321efb791e8980cd02f
2024-01-03 13:32:02 +01:00
Lukasz Szaszkiewicz
9f8ed7bc90 client-go/features: move the defaultKubernetesFeatureGates variable to the new file
Kubernetes-commit: 57ec7d20e89990d62ef85835cd37cc32ea6a418e
2024-01-03 13:24:35 +01:00
Lukasz Szaszkiewicz
ca4f3a73f7 client-go/features: introduce feature gates
This PR add a feature gates mechanisim to client-go
as described in https://docs.google.com/document/d/1g9BGCRw-7ucUxO6OtCWbb3lfzUGA_uU9178wLdXAIfs

In particular:
  - Adds a default feature gate implementation based on environment variables.
  - Adds a set of methods for reading, overwriting the default implementation, and adding features to an external registry.

Co-authored-by: deads2k <deads@redhat.com>
Co-authored-by: Ben Luddy <bluddy@redhat.com>

Kubernetes-commit: d74c57d4f592d20a992afb54b1ee64f56215210e
2024-01-02 12:46:15 +01:00
Kubernetes Publisher
5a0a424792 Merge pull request #122412 from MadhavJivrajani/bump-go-tools
[go1.22] .*: bump golang.org/x/tools to v0.16.1

Kubernetes-commit: 8a4403a9e5127d2ec3f596c4ce75663e5392cb18
2023-12-20 17:30:06 +00:00
Madhav Jivrajani
4106282f90 .*: bump golang.org/x/tools to v0.16.1
Bumping tools to include the fix for a nil pointer
deref error in go/types. See golang/go#64812
for more details.

This fix is needed for when we bump to go1.22.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: a8da4202c0ac785d57b545e6e310fd754888b50e
2023-12-20 14:31:31 +05:30
Kubernetes Publisher
96e9c8d6f1 Merge pull request #122395 from pohly/ginkgo-gomega-update
dependencies: gomega v1.30.0 + ginkgo v2.13.2

Kubernetes-commit: 7897910469aa091ebf6576740d055a7137fa147c
2023-12-20 09:21:10 +00:00
Patrick Ohly
abce78fd54 dependencies: gomega v1.30.0 + ginkgo v2.13.2
The new gomega.BeTrueBecause and gomega.BeFalseBecause are going to be useful
for https://github.com/kubernetes/kubernetes/issues/105678.

Kubernetes-commit: c8f9ebfb72b6569b4e2ec9733f6998afc6602135
2023-12-19 16:16:02 +01:00
Kubernetes Publisher
0a514be22c Merge pull request #122310 from weilaaa/use_buildin_max_min_instead
use build-in max and min func to instead of k8s.io/utils/integer funcs

Kubernetes-commit: 2b5c0c281d7d3b75ed7df683f09339147c4a17e9
2023-12-18 21:19:57 +00:00
weilaaa
c609c97b33 use build-in max and min func to instead of k8s.io/utils/integer funcs
Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4
2023-12-15 15:09:11 +08:00
Ricardo Lopes
12b0e099db Migrate client-go/metadata to contextual logging (#122225)
* client-go: migrate metadata to contextual logging

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* client-go: test for metadata contextual logs

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* refactor: extract context for table driven testing

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

* refactor: pass context as first parameter

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

---------

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>

Kubernetes-commit: 86ab185fa1e98e249fe3e380217099832fe22a4e
2023-12-14 06:26:45 +00:00
Kubernetes Publisher
e3d7e06bd6 Merge pull request #122069 from linxiulei/le_opt0
Optimistically update leader lock

Kubernetes-commit: 583a79a4569b5cbbff12131ebcc612d5cf659ae1
2023-12-14 05:20:06 +00:00
Kubernetes Publisher
feecac4b44 Merge pull request #121759 from thockin/fix_api_violations
Fix "list_type_missing" API violations in meta/v1

Kubernetes-commit: 8a22571ebb7628b2dd2c2faf453293040b7efaef
2023-12-14 01:20:15 +00:00
Kubernetes Publisher
9434e7539b Merge pull request #117046 from howardjohn/client/add-indexer-after-start
client-go: allow adding indexes after informer starts

Kubernetes-commit: db82260c65df9cedaf93e924a2401b4e55a8a2a0
2023-12-13 21:20:02 +00:00
Patrick Ohly
8468c261bc client-go events: also support context for NewEventBroadcasterAdapter
27a68aee3a4834 introduced context support. In order to use that
also with NewEventBroadcasterAdapter, a variant of the call is needed to allow
the caller to specify the context.

The `logcheck:context` comment ensures that code which is meant to be
contextual uses the new call.

Kubernetes-commit: f8e25eff926c640c86daa46222bfaf8d625e75d7
2023-12-01 09:00:59 +01:00
Eric Lin
2a48f1ee02 leaderelection: Instrument for when slowpath is exercised
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 1e54c050936be1a1e3e5758718ebca86096dbaea
2023-11-27 13:10:24 +00:00
Eric Lin
3c7c00d2d6 leaderelection: optimistically update leader lock
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 1d9f7fd516b4787f5ef32692711d5ae3031e794e
2023-11-25 22:04:32 +00:00
Tim Hockin
e9d1484a8e Re-vendor k8s.io/kube-openapi
./hack/pin-dependency.sh k8s.io/kube-openapi 778a5567bc1edaed92a4de9c07f90199c67953fa

./hack/update-vendor.sh

Kubernetes-commit: 1f55357d9937f076f532a2c1aa104593b9f6c49a
2023-11-13 10:59:57 -08:00
Kubernetes Publisher
84a6fe7e40 Merge pull request #121808 from cpanato/go-update-main
[go] Bump images, dependencies and versions to go 1.21.4

Kubernetes-commit: 6ba7258a0f3f73629560fc30016b2e35c8e7ae9c
2023-11-13 17:17:42 +00:00
cpanato
7f07a956f8 update go.mod
Signed-off-by: cpanato <ctadeu@gmail.com>

Kubernetes-commit: 9e5b8402bb95eb82541099e77c3a8b0ccd31297f
2023-11-08 08:46:15 -06:00
Kubernetes Publisher
86d49e7265 Merge pull request #113374 from ahmedtd/kep-3257-projected-types
Implement ClusterTrustBundlePEM projected volume

Kubernetes-commit: 9f319c32064f8b72d368df65fde4e37e250f8230
2023-11-04 01:16:34 +00:00
John Howard
785e19661f client-go: allow adding indexes after informer starts
Kubernetes-commit: d96a9858d396d7f418d24ea47bdc92ef8429f707
2023-03-31 15:57:18 -07:00
Taahir Ahmed
59c256a926 Regenerate for ClusterTrustBundlePEM projected volume API
Kubernetes-commit: 599fdb7adde5658dadb6a149c40624b4342fc909
2023-01-24 21:19:59 -08:00
Taahir Ahmed
ac369c3042 Define ClusterTrustBundlePEM projected volume
This commit defines the ClusterTrustBundlePEM projected volume types.
These types have been renamed from the KEP (PEMTrustAnchors) in order to
leave open the possibility of a similar projection drawing from a
yet-to-exist namespaced-scoped TrustBundle object, which came up during
KEP discussion.

* Add the projection field to internal and v1 APIs.
* Add validation to ensure that usages of the project must specify a
  name and path.
* Add TODO covering admission control to forbid mirror pods from using
  the projection.

Part of KEP-3257.

Kubernetes-commit: ecfdc8fda55923c18708488ec1561a4fcf9f3e33
2022-10-21 19:50:01 -07:00
Kubernetes Publisher
66e57f7675 Merge pull request #121552 from pohly/klog-update
klog v2.110.1 update

Kubernetes-commit: da61382068671c3e16782a9b45e7f2159ac0feb9
2023-11-01 17:16:20 +00:00
Patrick Ohly
8b96b9b888 dependencies: klog v2.110.1
Dropping a newline at the end of the message when using klog calls is an
intentional improvement (https://github.com/kubernetes/klog/pull/378)

Kubernetes-commit: 878d037d3ba8fc4f11bf45a6cf5a66301ba89d82
2023-10-16 10:03:54 +02:00
Kubernetes Publisher
c13269dd6b Merge pull request #116516 from aojea/servicecidr
KEP-1880 Multiple ServiceCIDR ( and IPAddress allocation)

Kubernetes-commit: 6abff7457e3a722fd217a0a58d1992b4002d496d
2023-11-01 05:16:07 +00:00
Kubernetes Publisher
7523a344f7 Merge pull request #121575 from apelisse/update-smd
Update sigs.k8s.io/structured-merge-diff to v4.4.0

Kubernetes-commit: 593a17d3b6381bfdbf3bc3b36f56cad30d1531df
2023-11-01 01:17:35 +00:00
Kubernetes Publisher
965bc8db9d Merge pull request #121104 from carlory/kep-3751-api-changes
[KEP-3571] introduce the VolumeAttributesClass API

Kubernetes-commit: dba565193c2d59e9d5bf08fb29b8662616afe087
2023-10-31 21:16:17 +00:00
carlory
6278c99b77 generated changes
Kubernetes-commit: 56ab6c5942171cd1e598fc7c25a21f5aa457f36f
2023-10-31 10:13:04 +08:00
Kubernetes Publisher
477cb782cf Merge pull request #121089 from tkashem/apf-v1
Promote APF API to v1

Kubernetes-commit: f5a5d83d7c027aba86e18c52da8ec4cd14179be3
2023-10-31 05:16:14 +00:00
Antonio Ojea
60aa89a1ab make update with the new API with arrays
Kubernetes-commit: fee07ad6080ccd6e0e8241e10b1b0330f57c64be
2023-10-29 19:01:10 +00:00
Abu Kashem
5a34ab53bd apiserver: add generated files for flowcontrol api change
Kubernetes-commit: 730d10a8fb918e75c22d57267adf34a8fbb5cee1
2023-10-27 19:27:07 -04:00
Antoine Pelisse
ce4f256a25 Update sigs.k8s.io/structured-merge-diff to v4.4.1
Kubernetes-commit: dec443b305a0240f2a9d7726c6a0c46beec19a1a
2023-10-27 10:21:06 -07:00
Antonio Ojea
824910b3a9 make update
Change-Id: I4007d4f6dda24b5c74f602d35191556f315de222

Kubernetes-commit: 8182c4d9ec8c254d7291f7b451bfe47aadc1c691
2023-10-18 00:37:58 +00:00
Abu Kashem
20fd67fa15 apiserver: generate code for apf flowcontrol v1 API
run:
- hack/update-codegen.sh
- hack/update-openapi-spec.sh

Kubernetes-commit: 5972037ffd6c1aea0f1c99ed430d1d78204a48a0
2023-10-10 13:49:38 -04:00
Kubernetes Publisher
30eba26adb Merge pull request #121524 from carlory/gomega
bump gomega to 1.29.0

Kubernetes-commit: ec297aa13a03f53f04023cd897af50dbfed31e0f
2023-10-27 17:30:27 +00:00
carlory
8ec95e1869 bump gomega to 1.29.0
Kubernetes-commit: 760abc2a82130d45607eeead4011afa8b0f81e6d
2023-10-26 09:47:49 +08:00
Kubernetes Publisher
4028f5ba6e Merge pull request #121338 from dims/working-otel-bump
Bump otel and other dependencies for CVE-2023-45142

Kubernetes-commit: d0084356b3cabdafcfc140d19ad8d544b2fc9b5d
2023-10-26 09:15:29 +00:00
Davanum Srinivas
08f1ffe578 working-config-otel
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 702d911e22604aa69b42f77804c27caaab7e4def
2023-10-18 18:47:37 -04:00
Kubernetes Publisher
e2e59f3539 Merge pull request #119186 from seans3/stream-translator-proxy
Stream Translator Proxy and FallbackExecutor for WebSockets

Kubernetes-commit: 87981480f33790225628824943217bd6bb7564bb
2023-10-24 17:15:43 +00:00
Kubernetes Publisher
c92537416a Merge pull request #120397 from ty-dc/StaticCheck
cleanup: omit comparison with bool constants

Kubernetes-commit: 441d4b54aec4eebbe55d9c3519691eb9833fa486
2023-10-24 03:51:50 +00:00
Kubernetes Publisher
b0036672f5 Merge pull request #116065 from sanposhiho/match-label-key-alternative
feature(scheduler): implement matchLabelKeys in PodAffinity and PodAntiAffinity

Kubernetes-commit: 581552eaf0b4a6689f2a02012804f2780ff7efdf
2023-10-23 19:48:20 +00:00
Kubernetes Publisher
5f697abdfd Merge pull request #121363 from p0lyn0mial/upstream-reflector-consistency-check
client-go/reflector: introduce a data consistency check for the watch-list feature.

Kubernetes-commit: 0dc900cebe079efaf2087adc6fee6eb88d176020
2023-10-23 15:59:07 +00:00
Kubernetes Publisher
33d14001db Merge pull request #120757 from alexzielenski/apiserver/openapi/invalid-default
Update `kube-openapi` to Remove invalid defaults from fields with custom marshalling

Kubernetes-commit: 31c679f65cbf62efec7597133e6d8e78d8473c4d
2023-10-20 23:24:14 +00:00
Alexander Zielenski
b5925219d4 update generated code and openapi
Kubernetes-commit: 0a6d9531f40f63543591d1515deb2ac05b4c62f3
2023-10-17 17:09:48 -07:00
Alexander Zielenski
30f741e67c pin openapi
Kubernetes-commit: 4d21a23be35a03852e0e7b188de11d9f8dc6bc57
2023-10-17 16:48:10 -07:00
Kubernetes Publisher
435ce6f2a8 Merge pull request #121010 from Jefftree/decouple-openapi-v2v3-config
Decouple openapi v2v3 config

Kubernetes-commit: ac66f3d466caee27bcc0f66a04ceec9bf63750bd
2023-10-16 23:13:08 +00:00
Kubernetes Publisher
9f0ec66a5d Merge pull request #119802 from takirala/tga/update-ErrGroupDiscoveryFailed
client-go: chore: implement `Is` interface for `ErrGroupDiscoveryFailed`

Kubernetes-commit: b5cc6aab484ef048a84a0965f288d035f0e5f298
2023-10-16 23:13:06 +00:00
Kubernetes Publisher
17c66cc83d Merge pull request #119026 from AxeZhan/sleepAction
Introducing Sleep Action for PreStop Hook

Kubernetes-commit: f6ba25fdbda1f6159ad63dcbb16f394b98d3a2c8
2023-10-16 23:13:05 +00:00
AxeZhan
5cf64182aa codegen
Kubernetes-commit: 5c0618b848d9e0d7fbcb2d7a5c41e85735c173fd
2023-10-16 19:50:28 +08:00
Kubernetes Publisher
52c50bf6c0 Merge pull request #121229 from aojea/remove_cluster_cidr
remove ClusterCIDR alpha API

Kubernetes-commit: 4d8a51acacaf0df9bfbaee8cd43f15dbdc85b146
2023-10-15 03:12:51 +00:00
Kubernetes Publisher
46e82c57b2 Merge pull request #120248 from pacoxu/grpc-container-probe
remove feature gate GRPCContainerProbe

Kubernetes-commit: 43e617f2521e9f52156aba9822245a2b5eb773f1
2023-10-14 23:13:14 +00:00
Antonio Ojea
656ec39ea1 remove ClusterCIDR
KEP-2593 proposed to expand the existing node-ipam controller
to be configurable via a ClusterCIDR objects, however, there
were reasonable doubts on the SIG about the feature and after
several months of dicussions we decided to not move forward
with the KEP intree, hence, we are going to remove the existing
code, that is still in alpha.

https://groups.google.com/g/kubernetes-sig-network/c/nts1xEZ--gQ/m/2aTOUNFFAAAJ

Change-Id: Ieaf2007b0b23c296cde333247bfb672441fe6dfc

Kubernetes-commit: c2d473f0d438cedab2f1831d23457d24961e0f4e
2023-10-13 21:31:29 +00:00
Kubernetes Publisher
bc7002f524 Merge pull request #120735 from Jefftree/request-body
Bump kube-openapi with v3 marshal and requestBody required marking

Kubernetes-commit: e93e8eac0ef1b26384e5481b67c7d04fe211a243
2023-10-12 23:17:34 +00:00
Jefftree
f68660d6a7 bump kube-openapi
Kubernetes-commit: e3098225eaf7b5bb9d5de1f259c2dbdc2062faa8
2023-10-12 18:22:05 -04:00
Kubernetes Publisher
d02858f519 Merge pull request #121106 from aojea/ipaddress_uid
Remove Ipaddress uid

Kubernetes-commit: f9d987c7c8dfa36f096c38454c1ae672bb0eb56c
2023-10-12 03:13:00 +00:00
Arda Güçlü
57d597c1d6 Add shortname ambiguity warning in shortcut expander (#117668)
* Add warning handler callback function in shortcut expander

Currently, errors in client-go are propagated back to the callers via
function returns. However, there is no elegant way for just warning users.
For example, when user wants to get a resource with it's short name format
and if there are multiple resources belonging to this short name, we need to
warn user about this ambugity which one is picked and which ones are discarded.

Not only to overcome this particular case mentioned above, but also propose a
way for the possible warnings in the future, this commit adds a warningHandler
callback function in shortcutExpander.

* Add warningPrinter functionality in ConfigFlags

ConfigFlags has neither warning user in a standardized
format functionality nor passing warning callback functions to other upper level
libraries such as client-go.

This commit adds an ability that user can set warningPrinters
according to their IOStreams and this warningPrinters will be used
to raise possible warnings happening not only in cli-runtime but
also in client-go.

* Pass warning callback function in ConfigFlags to shortcutExpander

This commit passes warning callback function to print possible
warnings happened in shortcut expander to warn user in a
standardized format.

* Add integration test for CRDs having ambiguous short names

This commit adds integration test to assure that warning message
related to this ambiguity is printed when resources are being retrieved via their short name
representations in cases where multiple resources have same
short names.

This integration test also ensures that the logic behind which resource
will be selected hasn't been changed which may cause disperancies in
clusters.

* Remove defaultConfigFlag global variable

* Move default config flags initialization into function

* Skip warning for versions of same group/resource

* Run update-vendor

* Warn only once when there are multiple versions registered for ambiguous resource

* Apply gocritic review

* Add multi-resource multi-version ambiguity unit test

Kubernetes-commit: a504aed54d028dbc8ea2508142c94d309f5f1ec6
2023-10-11 18:04:11 +03:00
Kubernetes Publisher
cf4002bbbf Merge pull request #121111 from dashpole/update_otel_deps
Update OpenTelemetry Dependencies

Kubernetes-commit: eafebcc9e368d6aeaab0ce5ec4fd56b94174d0c4
2023-10-11 07:12:43 +00:00
Antonio Ojea
55f8f3ffa2 make update
Change-Id: I61be34cff942264acb2f45fe7e1c8538f807cb4e

Kubernetes-commit: e9957d79aae244d3a956d9f7634ad45a9a3364b4
2023-10-10 11:01:56 +00:00
Lukasz Szaszkiewicz
0f984dc7fc client-go/reflector: introduce a data consistency mechanism for the watch-list feature.
checkWatchListConsistencyIfRequested performs a data consistency check only when
the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup.

The consistency check is meant to be enforced only in the CI, not in production.
The check ensures that data retrieved by the watch-list api call
is exactly the same as data received by the standard list api call.

Note that this function will panic when data inconsistency is detected.
This is intentional because we want to catch it in the CI.

Kubernetes-commit: b31e7793d0d873a71c90caf8455556aa905cf88d
2023-10-06 14:26:47 +02:00
John Howard
0b5d6dfee7 dependencies: update otel-go dependencies
Kubernetes-commit: dc334b953d99f233b56ec2cd78bff218a00152a0
2023-10-05 12:52:33 -07:00
Kubernetes Publisher
b4ee45cc0a Merge pull request #121117 from MadhavJivrajani/bump-x-net
[CVE-2023-39325] .: bump golang.org/x/net to v0.17.0

Kubernetes-commit: 7ee2af5cc5fee6a6f837975a70a35ce681a8e9d4
2023-10-10 19:13:10 +00:00
Madhav Jivrajani
9f19d0f211 .: bump golang.org/x/net to v0.17.0
Bumping golang.org/x/net in light of CVE-2023-39325 and CVE-2023-44487.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: fc7c951d5a5b8b75dfa105e3bea7bbddaf4c792e
2023-10-10 23:07:19 +05:30
Kubernetes Publisher
9518c802be Merge pull request #121082 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.13.0, gomega v1.28.0

Kubernetes-commit: 755644a169ad495a34bc5e1db502962fc6dd3750
2023-10-10 15:12:51 +00:00
Patrick Ohly
fa053c26e6 dependencies: ginkgo v2.13.0, gomega v1.28.0
Besides simply staying up-to-date, ginkgo v2.13.0 adds a `PreviewSpecs` which
will be used for introspection of the E2E test suites.

Kubernetes-commit: 79355caa565cc34e8726c427562c9f109ebe0e34
2023-10-09 19:27:06 +02:00
Kubernetes Publisher
5b14e64aff Merge pull request #120975 from ardaguclu/close-heartbeat-explicitly
Close websocket heartbeat explicitly when unexpected closure received

Kubernetes-commit: d0dfe6433444fb114fc119a8b1066e1601f049fe
2023-10-06 11:11:50 +00:00
Arda Güçlü
583e50d008 Use timeout function to detect transient errors
Kubernetes-commit: a888fef242fd59bc3871c67099c7f5e9449873c2
2023-10-06 08:55:22 +03:00
Arda Güçlü
9a88950e38 revert back to IsUnexpectedCloseError check
Kubernetes-commit: 914210ee9a6df6927019f200e90534edd1460fea
2023-10-05 12:04:06 +03:00
Kubernetes Publisher
0a782d6adb Merge pull request #120729 from pohly/events-context
k8s.io/client-go/tools/[events|record]: support context

Kubernetes-commit: f936f69cf994146650c287a95fa436d1d7352835
2023-10-05 03:18:13 +00:00
Kubernetes Publisher
ca718630c6 Merge pull request #120984 from p0lyn0mial/upstream-reflector-always-fallback-to-listwatch
reflector: fallback to the previous mode on any error

Kubernetes-commit: c9bd841cdf1310a2110267197b9db9432617582b
2023-10-04 10:22:44 +00:00
Lukasz Szaszkiewicz
1e0855a7ac reflector: fallback to the previous mode on any error
originally we honored only apierrors.IsInvalid
but decided to fallback on every error
because it is better to make progress than deadlocking

Kubernetes-commit: 4b3915017950a114124a88c5d308bd8bfb9ec48e
2023-10-04 08:17:10 +02:00
Kubernetes Publisher
fbb1575728 Merge pull request #120980 from p0lyn0mial/upstream-client-go-close-watcher
reflector: close an established watcher when the StopCh was closed

Kubernetes-commit: 389e60fb2e43e7c13d67e4d9d3a95ed4f088917a
2023-10-03 14:56:06 +02:00
Lukasz Szaszkiewicz
2c9d749027 reflector: close an established watcher when the StopCh was closed
Kubernetes-commit: 26f113be2fc71c7a41a59145eee5d4da9d062b9e
2023-10-03 13:49:21 +02:00
Arda Güçlü
e95d92dbc6 Close websocket heartbeat explicitly when unexpected closure received
Kubernetes-commit: e1ae906048003145441fb1d4ecce4c13acf5cb19
2023-10-03 12:05:26 +03:00
Kubernetes Publisher
d6dc079df2 Merge pull request #120716 from xrstf/fix-typos
Fix typos

Kubernetes-commit: 622509830c1038535e539f7d364f5cd7c3b38791
2023-09-30 10:21:56 +00:00
Kubernetes Publisher
6b97f71afc Merge pull request #119865 from charles-chenzz/bump_deps
bump github.com/emicklei/go-restful/v3 to v3.11.0

Kubernetes-commit: bf1fa0c6691bb3bc6c5c03f900c53ed609e580a4
2023-09-28 14:31:46 +00:00
Jefftree
c0416e6354 bump kube-openapi
Kubernetes-commit: 555c1b8091c2312e7b3f9002fc8a4787e759ef31
2023-09-27 14:02:53 -04:00
Kubernetes Publisher
52cc500823 Merge pull request #120865 from aojea/remotecmd_flake
deflake TestWebSocketClient_HeartbeatSucceeds

Kubernetes-commit: e602e9e03cd744c23dde9fee09396812dd7bdd93
2023-09-26 06:50:14 -07:00
Antonio Ojea
011db228a8 deflake TestWebSocketClient_HeartbeatSucceeds
Change-Id: I1f3331255ed81183b25ec24084c00d0cf7dfb510

Kubernetes-commit: 4a74958b2df7ecd9e6a4867f7b10f1402cb2e215
2023-09-25 10:31:46 +00:00
Kubernetes Publisher
34d1b64e67 Merge pull request #120799 from aojea/workqueue_test
workqueue unit tests to assert collapsing behaviors

Kubernetes-commit: cde6a46a483a0cc7d3f2404db506e1c24ecd4e9d
2023-09-21 18:21:40 +00:00
Antonio Ojea
374e3638f2 workqueue unit tests to assert collapsing behaviors
Change-Id: If4bf54c3af603c17de49055960f9a76e7d38aab3

Kubernetes-commit: 8a31bb6786c2d3600bade49de7a64a026802bd6d
2023-09-21 10:48:01 +00:00
Kubernetes Publisher
657ffa5263 Merge pull request #120752 from p0lyn0mial/upstream-client-go-initial-events-value
cache/reflector: check the value of the initial-events-end annotation

Kubernetes-commit: 09200e9c92784f6fb9210e6287e306649a731673
2023-09-20 06:21:27 +00:00
Lukasz Szaszkiewicz
d0ea06d597 cache/reflector: check the value of the initial-events-end annotation
Kubernetes-commit: 04668c00432cbd552b08eb94f829643facbd2061
2023-09-19 12:59:23 +02:00
Kubernetes Publisher
b5b9332330 Merge pull request #120694 from aojea/ws_healthchec
add loging and bump timers to avoid races

Kubernetes-commit: 10d487313d602da61def2869c7066ecc754a591d
2023-09-18 10:38:13 +00:00
Patrick Ohly
cf07629bfe k8s.io/client-go/tools/events: pass context into EventSink methods
Because the EventBroadcaster code now has a a context, changing the EventSink
interface so that the methods accepts a context instead of using context.TODO
becomes possible.

Kubernetes-commit: 5dc540ff57eed5d0e6bc8476f95fe03b7a983cf5
2023-09-18 12:17:14 +02:00
Patrick Ohly
3595e5242a k8s.io/client-go/tools: support context for event recording
Using StartRecordingToSinkWithContext instead of StartRecordingToSink and
StartLogging instead of StartStructuredLogging has several advantages:

- Spawned goroutines no longer get stuck for extended periods of
  time during shutdown when passing in a context that gets canceled.
- Log output can be directed towards a specific logger instead of the global
  default, for example one which writes to a testing.T instance.
- The new methods return an error when something went wrong instead of
  merely recording the error.

That last point is the reason for deprecating the old methods instead of merely
adding new alternatives.

Setting a context when constructing an EventBroadcaster makes calling Shutdown
optional. It can also be used to specify the logger.

Both EventRecorder interfaces in tools/events and tools/record now have a
WithLogger helper. Using that method is optional, but recommended to support
contextual logging properly. Without it, errors that occur while emitting an
event are not associated with the caller.

Kubernetes-commit: 27a68aee3a48340f7c14235f7fc24aa69aaeb8f6
2023-09-18 09:13:22 +02:00
Christoph Mewes
0d1af04557 fix typo dervied => derived
Kubernetes-commit: 62275e3cc8c7de6f852bb04ba6cf521d36443580
2023-09-17 11:26:19 +02:00
Kubernetes Publisher
08f892964c Merge pull request #119526 from sttts/sttts-idiomatic-cached
kube-openapi/cached: bump and adapt to more go-idiomatic caching library

Kubernetes-commit: f551940626532e790c05094293e0d8bb5b76e3d5
2023-09-15 22:22:46 +00:00
Antonio Ojea
ea6e035481 add loging and bump timers to avoid races
Change-Id: I6da35b6fb33c939f3f92f8ebf4c6a18bdf1644e4

Kubernetes-commit: 40618b765ccb1a0e75f7063534f9645d1df57f7a
2023-09-15 08:23:58 +00:00
Dr. Stefan Schimanski
278669d869 hack/update-vendor.sh
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: 6c59e8be5e2bc97c8e850070ffb3025199c05df2
2023-09-13 08:23:06 +02:00
Kubernetes Publisher
908cc0a333 Merge pull request #120513 from devincd/fix-typo
fix typo in client-go package

Kubernetes-commit: 10f9d5ce6d4e65a1f0d3ad91ec9ff47150b749e6
2023-09-12 22:21:12 +00:00
Kubernetes Publisher
44a68eea8f Merge pull request #120508 from aojea/aojea_owner
add aojea as client-go approver

Kubernetes-commit: b7e3b9f7d9f8784cfb0cf0bb48794162527ccb44
2023-09-11 22:22:53 +00:00
Kubernetes Publisher
a73949f10a Merge pull request #120008 from skitt/drop-intstr-ptr-wrappers
Use ptr.To to retrieve intstr addresses

Kubernetes-commit: 33c5bd631d990f907f89f66cdf8088d252ab251b
2023-09-09 18:21:34 +00:00
Kubernetes Publisher
a52e8a122e Merge pull request #120499 from tukwila/gorilla/websocket_v1.5.0
bump: upgrade gorilla/websocket from v1.4.2 to v1.5.0

Kubernetes-commit: f6a87aebe6f83336b1dc7d4ca6e69b19ca55cd94
2023-09-08 18:23:38 +00:00
devincd
f242a563ef fix typo in client-go package
Signed-off-by: devincd <505259926@qq.com>

Kubernetes-commit: 975da2fb2393350db504e50652b17c70206e1407
2023-09-08 10:31:07 +08:00
Antonio Ojea
5ac9cf819f add aojea as client-go approver
After 12 months as reviewer, constantly reviewing and contributing
to client-go, I think is fair to move to the next ladder.

Change-Id: I49e579dcefcd39c6f0b29400c90467df00719cca

Kubernetes-commit: cc77b97c5e9cc9f778016b9d260c66bf7b277448
2023-09-07 21:16:19 +00:00
guangli.bao
951672fc13 bump: upgrade gorilla/websocket from v1.4.2 to v1.5.0
Kubernetes-commit: 93d93258b19ff3d2e85b5dc60e89df1ebdc689ca
2023-09-07 22:27:58 +08:00
Kubernetes Publisher
53c02afd1b Merge pull request #119334 from kmala/serverapply
update the dependency sigs.k8s.io/structured-merge-diff/v4 to latest tag

Kubernetes-commit: cf8f9a8d07770352ec0e976ebac77dffa92f0b04
2023-09-07 02:40:14 +00:00
Kubernetes Publisher
f5a7a42bbc Merge pull request #119157 from seans3/websocket-executor
WebSocket Client and V5 RemoteCommand Subprotocol

Kubernetes-commit: 6013381508d2d37961c95fd49d91642bfeffaf74
2023-09-06 02:20:41 +00:00
tao.yang
0447e1f9ce cleanup: omit comparison with bool constants
Signed-off-by: tao.yang <tao.yang@daocloud.io>

Kubernetes-commit: b35357b6c08f21ba0fd312536051394c2567ec79
2023-09-04 16:59:23 +08:00
Paco Xu
92c5c93353 remove GAed FG GRPCContainerProbe
Kubernetes-commit: 7e7b67f2ccd38380120b6da2ccb10ae74970a7a6
2023-08-30 10:29:37 +08:00
Stephen Kitt
f0c65afe82 Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

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

Kubernetes-commit: aa89e6dc978bf88653d893284248039b776aed54
2023-08-17 12:12:12 +02:00
Tarun Gupta Akirala
5a38750180 fix: add code comments
Kubernetes-commit: 1863a808b2082ddd8d116e6b31fd41de412e8a20
2023-08-10 10:50:01 -07:00
charles-chenzz
bf89966e2c bump github.com/emicklei/go-restful/v3 to v3.11.0.
Kubernetes-commit: 409b46576ff7848bf51b9d70165b693018173ebc
2023-08-09 23:31:06 +08:00
Tarun Gupta Akirala
f93655277b client-go: chore: implement Is interface for ErrGroupDiscoveryFailed
Signed-off-by: Tarun Gupta Akirala <takirala@users.noreply.github.com>

Kubernetes-commit: 6aad00ff73d10378d33d615505239c5373a1108b
2023-08-07 12:08:09 -07:00
Keerthan Reddy Mala
77918e1951 update the dependency sigs.k8s.io/structured-merge-diff/v4 to latest tag
Kubernetes-commit: d2df65ba6c91c1337e07373c254c2118aec3700a
2023-07-14 09:47:59 -07:00
Sean Sullivan
b7d73dd18c StreamTranslator and FallbackExecutor for WebSockets
Kubernetes-commit: 168998e87bfd49a1b0bc6402761fafd5ace3bb3b
2023-07-06 21:22:07 -07:00
Sean Sullivan
fd1e22bd8f WebSocket Client and V5 RemoteCommand Subprotocol
Kubernetes-commit: a0d6a815fcc02cbfea1bb22d13a8e896ecbe116c
2023-07-06 21:22:07 -07:00
Kubernetes Publisher
4783d28359 Merge pull request #119410 from Jefftree/kubectl-cleanup
Cleanup kubectl legacy server fallback

Kubernetes-commit: ea3353dd6b8c3ba52516230a5e70b1af0ff9192b
2023-09-03 18:00:04 +00:00
Kubernetes Publisher
5e052e4835 Merge pull request #119870 from Jefftree/agg-discovery-406
Fallback to legacy discovery on a wider range of conditions

Kubernetes-commit: 42275daaaa96aac0d5191f1f5bf5d4ce6d1c474d
2023-09-01 18:00:31 +00:00
Kubernetes Publisher
f28f485cb4 Merge pull request #120259 from SataQiu/clean-apf-20230830
apf: remove v1alpha1 API

Kubernetes-commit: efadb94a74d64cb821e990700c5bd05a805857ac
2023-09-01 04:47:30 +00:00
Kubernetes Publisher
5e5ba6b91d Merge pull request #120327 from liggitt/json-patch
Revert to json-patch 4.12.0

Kubernetes-commit: 34aaf2b972c95c7a3591d8d49c798dba348ee5c9
2023-09-01 04:47:24 +00:00
Jordan Liggitt
f6f4d3c7eb Revert to json-patch 4.12.0
Kubernetes-commit: 741f1461571007fcf4cf3edbd121d6ef0c596c72
2023-08-31 19:01:37 -04:00
SataQiu
def2075eac apf: remove v1alpha1 API
Kubernetes-commit: 2825519da2c176ac81d2ec6b1500ef8e68377db1
2023-08-30 17:20:29 +08:00
Kubernetes Publisher
fb2e668965 Merge pull request #120218 from rakshitgondwal/feat/protobuf-version-update
feat: update google.golang.org/protobuf to v1.31.0

Kubernetes-commit: 8b4f5bb54b3c2f0e671e87f5038bf3257109edd4
2023-08-29 15:55:12 +00:00
Rakshit Gondwal
5af0bb9dfd feat: update google.golang.org/protobuf to v1.31.0
Signed-off-by: Rakshit Gondwal <rakshitgondwal3@gmail.com>

Kubernetes-commit: 709721e0df1940f0316f6b81e8ceaeb493634400
2023-08-28 23:38:32 +05:30
Kubernetes Publisher
4dd144a93b Merge pull request #119962 from pohly/dra-api-list-type
api: change list type for node lists in PodSchedulingContext

Kubernetes-commit: 3f705b6ab857b20b792f092b05f61ab0c8c54fd4
2023-08-23 20:32:07 +00:00
Kubernetes Publisher
e8815ff156 Merge pull request #118653 from pohly/volume-resource-requirements
Volume resource requirements

Kubernetes-commit: f852d7fead3446112d4dc8acd29869a860a11ff5
2023-08-22 00:05:18 +00:00
Kubernetes Publisher
3fe9aa4466 Merge pull request #119790 from seantywork/added-comment
added comment for clarifying steps related to kubernetes mutual (2-wa…

Kubernetes-commit: 55c86d6ad930d437931079318d740bdf8dac34f0
2023-08-21 20:07:06 +00:00
Kubernetes Publisher
c1466acf62 Merge pull request #119883 from ls-2018/json
Fix: null jsonpath serialization

Kubernetes-commit: c5a8015bbae1e1095813d8e0719f017477dc7112
2023-08-19 03:51:34 +00:00
seantywork
ff3618ffb3 kubernetes mutual (2-way) x509 comment
Kubernetes-commit: 48260b4a77b423b178ec5e262ac67be52d49f455
2023-08-18 01:31:22 +00:00
Kubernetes Publisher
9c6b659a97 Merge pull request #119937 from RyanAoh/kep-1860-dev
Make Kubernetes aware of the LoadBalancer behaviour

Kubernetes-commit: ee265c92fec40cd69d1de010b477717e4c142492
2023-08-17 23:57:38 +00:00
Kubernetes Publisher
d124e52fa8 Merge pull request #119806 from enj/enj/i/delete_psp_api
Delete PSP API types and generated clients

Kubernetes-commit: 012e61a860d978bed4e72222da756d0c7b7832ba
2023-08-17 20:03:37 +00:00
Kubernetes Publisher
edce1de719 Merge pull request #119728 from pohly/ssa-forbid-extract-calls
SSA: prevent usage of Extract calls via forbidigo

Kubernetes-commit: f563910656ad325a7e1f8ab5848746bc2eba4d7f
2023-08-17 12:11:49 +00:00
Kubernetes Publisher
9a5370b1ef Merge pull request #119907 from Hii-Arpit/Hii-Arpit-Fixing-Broken-Link
Fixing the "Service Account Token" link in the readme

Kubernetes-commit: a38dca01aaf0d20d274a648efc158d8bfee2b4a4
2023-08-16 07:56:47 +00:00
Kubernetes Publisher
54237a55bc Merge pull request #119796 from sttts/sttts-caches-populated
client-go: log proper 'caches populated' message, with type and source and only once

Kubernetes-commit: 03e845f882b2ab1f1a34deee36f06945cfa259d2
2023-08-16 07:56:46 +00:00
Kubernetes Publisher
b97d8af093 Merge pull request #119554 from davidmccormick/prevent-race-client-go-workqueue-shutdown
client-go workqueue: fix shutdown race / test flake

Kubernetes-commit: f234aa52cdcd996d00cd14b94902b3a3752595ea
2023-08-16 04:03:48 +00:00
Kubernetes Publisher
856e847bb7 Merge pull request #118455 from linxiulei/managedFields
Trim managedFields in controller-manager

Kubernetes-commit: 1acd489dca47a4be0301330cbfcf4e8f9d98f7c0
2023-08-16 00:07:58 +00:00
Kubernetes Publisher
08b51e9785 Merge pull request #118399 from skitt/ioutil-sig-api-machinery
api-machinery: stop using deprecated io/ioutil

Kubernetes-commit: 10beda334e360b6b2988d5d2d30c011cc50d4aa8
2023-08-16 00:07:55 +00:00
Kubernetes Publisher
41d4a164f9 Merge pull request #117992 from liggitt/gc-discovery-flutter
Fix duplicate GC event handlers getting added if discovery flutters

Kubernetes-commit: 7407f36b4b8937f982def35dd99b5647fc5245c5
2023-08-16 00:07:52 +00:00
Patrick Ohly
cb120b63f7 api: change list type for node lists in PodSchedulingContext
The "set" list type was chosen because it seemed appropriate (no duplicates!)
but that made tracking of managed fields more expensive (each entry in the list
is tracked, not the entire field) and for no good reason (one client is
responsible for the entire list).

Therefore the type gets changed to "atomic". Server-side-apply has not been
used in the past and PodSchedulingContext objects are short-lived and still in
alpha, so the any potential compatibility issues should be minor.

The scheduling throughput in scheduler_perf increases:

    name                                                                      old SchedulingThroughput/Average     new SchedulingThroughput/Average
    PerfScheduling/SchedulingWithResourceClaimTemplate/2000pods_100nodes-36   18.8 ± 8%                            24.0 ±37%
    PerfScheduling/SchedulingWithMultipleResourceClaims/2000pods_100nodes-36  13.7 ±81%                            18.5 ±40%

Kubernetes-commit: 5567f288e745db05d88fc60e15915f8b0d1f6c4b
2023-08-15 09:55:57 +02:00
Aohan Yang
4a487f61f6 Generated code for IP mode field
Kubernetes-commit: 29a6705dabc875b0f19b73016df16c50744ce99b
2023-08-14 12:32:25 +08:00
Arpit Agrawal
f4a635a743 Update README.md
The Service Account Token link in the readme is broken and refers to a page that no longer exists.
In this PR I updated the correct link in the readme

Kubernetes-commit: 279a663f948337da156f544b74e41928ad66f9ef
2023-08-11 17:46:28 +05:30
acejilam
a8fc969a34 Fix: null jsonpath serialization
Signed-off-by: acejilam <acejilam@gmail.com>

Kubernetes-commit: 9646ae5a9efb0eee7ac15577d113699700233017
2023-08-10 19:32:47 +08:00
Kubernetes Publisher
b8a03ab933 Merge pull request #119876 from marosset/revert-118895
Revert "Merge pull request #118895 from RyanAoh/kep-1860"

Kubernetes-commit: e6218f3d3bede036b2d67a4349dd761aac06ae97
2023-08-10 04:38:32 +00:00
Kubernetes Publisher
04dcae2ee3 Merge pull request #119835 from liggitt/mitigate-aggregated-discovery-npe
Avoid returning nil responseKind in v1beta1 aggregated discovery

Kubernetes-commit: 3d941afece97b284c764e5320cc8c80b0e88cba8
2023-08-10 00:49:21 +00:00
Mark Rossetti
32bbd73dd1 Revert "Merge pull request #118895 from RyanAoh/kep-1860"
This reverts commit 890a6c8f70d2e0f45b3692d34a6df1ecb6d8335b, reversing
changes made to 4f60a8d493ab9571eb328b9d98da477a50bc7446.

Kubernetes-commit: 0d90d1ffa5e87dfc4d3098da7f281351c7ff1972
2023-08-09 15:51:20 -07:00
Jefftree
c4ed5da76e Fallback to legacy discovery on a wider range of conditions in aggregator
Kubernetes-commit: 57b27fd3cd11cb5f2515c7ac5f67f612998fb368
2023-08-09 18:22:30 +00:00
Jordan Liggitt
bf44ac9180 Avoid returning nil responseKind in v1beta1 aggregated discovery
Kubernetes-commit: 1876ddf71497bad349f7c4df24c2e22356d3bad9
2023-08-08 14:25:56 -04:00
Kubernetes Publisher
49410bfbbc Merge pull request #119725 from MadhavJivrajani/bump-net-dep
[CVE-2023-3978] .*: bump golang.org/x/net to v0.13.0

Kubernetes-commit: 1620473a9a01dd6bbef3398c0acb2e581d0a13c3
2023-08-07 20:42:04 +00:00
Monis Khan
1e11b3a8ca Delete PSP API types and generated clients
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 10fe3da87dbc354ea528d65f1e544614ee980987
2023-08-07 16:15:13 -04:00
Dr. Stefan Schimanski
00f8b3aa35 client-go: log proper 'caches populated' message, with type and source and only once
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: a1809ffae377f3abbae12b137073ca4c473743cd
2023-08-07 12:56:32 +02:00
Patrick Ohly
ed2b4f0fcb SSA: prevent usage of Extract calls via forbidigo
Client-side extract calls depend on `managedFields`, which might not be
available. Therefore they should not be used in production code.

They are okay in test files (because the API has to be tested), in the
generated code (because the various type specific APIs still need to be
provided) and in unstructured.go (same reason).

Kubernetes-commit: 4bc9434f99d9a87dd5b63e738b6b1b16693f10e4
2023-08-02 10:57:51 +02:00
Madhav Jivrajani
7d2c3dfa0e .*: bump golang.org/x/net to v0.13.0
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 1b90dff5276f3cb37236b446f1821175dad802c4
2023-08-02 11:11:22 +05:30
Dave McCormick
e9b0103a41 Fix a race where a call to Shutdown was happening after ShutDownWithDrain() had performed the check q.isProcessing() && q.shouldDrain() and before waitForProcessing() has reached its Wait(). This is because waitForProcessing() is only checking the length part of the condition instead of both the length and whether we still need to drain.
It turned out that there were lots of unnecessary accessor functions being called locking and unlocking the cond which are not needed because Wait() automatically unlocks and locks the cond for us and best practice says we should run it in a for checking for the condition (so this is what I have done).

Kubernetes-commit: 2b12df56b0be93bc2cac7c5a66342c0ffaa72311
2023-07-24 22:40:54 +01:00
Kubernetes Publisher
c5b1c13ccb Merge pull request #118644 from alexzielenski/apiserver/policy/namespaceParamRef
KEP-3488: Promote ValidatingAdmissionPolicy to Beta

Kubernetes-commit: 18f8cb83989ff64beb0c7f47cdd3ad9df7bdbbeb
2023-07-22 03:07:43 +00:00
Kubernetes Publisher
a98e74a6eb Merge pull request #116469 from RomanBednar/pv-phase-transition-time
PersistentVolume last phase transition time

Kubernetes-commit: f3a070f9c684d9335b6df91ef2f3ce207629882c
2023-07-22 03:07:39 +00:00
Roman Bednar
dcfedbe450 make update
Kubernetes-commit: 294f5c9a42fead4a4cc75340a6b9171c9c657b3e
2023-07-21 17:16:05 +02:00
Kubernetes Publisher
605aac15d7 Merge pull request #119215 from alexzielenski/apiserver/policy/namespaceParamRef-alpha
KEP-3488: Per namespace policy params

Kubernetes-commit: 8a053c700a3abc30717860e0b6a13243a7250743
2023-07-20 22:53:21 +00:00
Kubernetes Publisher
64a35f6a46 Merge pull request #119301 from kannon92/pod-replacement-policy-job-api-only
add podReplacementPolicy and terminating field to job api

Kubernetes-commit: 9892b5370450ff0b3d86f67e8e82d1545299c785
2023-07-20 02:55:28 +00:00
Alexander Zielenski
d7acd85d1b update codegen
Kubernetes-commit: d6479587445a5a6fa736ee7fb3012a29f4e6e5e7
2023-07-19 16:21:22 -07:00
Jefftree
f02c594955 Cleanup kubectl legacy server fallback
Kubernetes-commit: d1946392528fe6e26886810e8240568fa19e82fe
2023-07-18 18:24:56 +00:00
kannon92
70917217ee add podReplacementPolicy and terminating field to job api
Kubernetes-commit: ce929520376417a9358067ad8576b10e734cb7a9
2023-07-18 17:25:15 +00:00
Kubernetes Publisher
8d42d15550 Merge pull request #119294 from mimowo/backoff-limit-per-index-api
Extend the Job API for BackoffLimitPerIndex

Kubernetes-commit: f3f5dd99ac7bdc61c61c3d587575090c3473ab5a
2023-07-18 17:44:59 +00:00
Michal Wozniak
ad08d15b30 Extend the Job API for BackoffLimitPerIndex
Kubernetes-commit: fcbfdc1710676ffd77ba4bbda384240293339db4
2023-07-13 09:36:07 +02:00
Kubernetes Publisher
74c18d3a40 Merge pull request #118204 from sttts/sttts-openapi-v2-parameter-refs
openapi: reference shared parameters

Kubernetes-commit: f42ff8687026f8e12fb3d3b0da0760525d8d8ab2
2023-07-18 05:56:20 +00:00
Kubernetes Publisher
efe741a289 Merge pull request #119312 from pacoxu/prometheus/common-v0.44
upgrade prometheus common to v0.44.0

Kubernetes-commit: d627c4b41cdd9ef08b13604ce1c460eca26684f8
2023-07-18 01:59:24 +00:00
Kubernetes Publisher
64339c0aa9 Merge pull request #116335 from gnufied/update-api-recovery-apis
Update api recovery apis

Kubernetes-commit: a776bf046286b578bc6259cca7e5bc0d0fb14e59
2023-07-18 01:59:19 +00:00
Paco Xu
251884f570 upgrade prometheus common to v0.44.0
Kubernetes-commit: 9b6af80a631f5659ea62d552d595b3dd137525a0
2023-07-14 11:05:46 +08:00
Alexander Zielenski
84505f7088 update-codegen
Kubernetes-commit: 9a595209bd28d6456f5f8cf5effe74944daf2105
2023-07-10 13:06:26 -07:00
Hemant Kumar
fe95890e7f Update generated data
Kubernetes-commit: 6a780f57ce5e64002d96200be59dea881aad977c
2023-07-10 12:19:57 -04:00
Kubernetes Publisher
5360d05de9 Merge pull request #118895 from RyanAoh/kep-1860
Make Kubernetes aware of the LoadBalancer behaviour

Kubernetes-commit: 890a6c8f70d2e0f45b3692d34a6df1ecb6d8335b
2023-07-17 21:52:50 +00:00
Aohan Yang
950fa167a0 Generated code for IP mode field
Kubernetes-commit: 7c6e399b228199bed94219dcaf36cd3cb5eb68e5
2023-07-17 16:00:57 +08:00
Kubernetes Publisher
162ee91898 Merge pull request #109616 from wzshiming/feat/pod-host-ips
Field `status.hostIPs` added for Pod

Kubernetes-commit: 8a0ea1bd587895a328f6587064c936022b16335d
2023-07-15 09:18:53 +00:00
Kubernetes Publisher
f19b40cda9 Merge pull request #119330 from bertinatto/fix-conn-reuse-test
Proactively bump golang.org/x/net to v0.12.0

Kubernetes-commit: c79be34fba3ad20532c9648216924afaa8434e06
2023-07-14 21:24:36 +00:00
Kubernetes Publisher
0f514c8c6b Merge pull request #118782 from MikeSpreitzer/exempt-borrowing-impl
Exempt borrowing implementation

Kubernetes-commit: 2a91bd1dfdd2e293b9ec017ea3a976ecc2ecd545
2023-07-14 17:25:41 +00:00
Fabio Bertinatto
1c4976d2f6 Proactively bump golang.org/x/net to v0.12.0
Proactively bump to v0.12.0 to avoid v0.10.0 and v0.11.0, which contain
a regression added by commit
82780d606d.
This commit was later reverted in v0.12.0.

Generated with:

hack/pin-dependency.sh golang.org/x/net v0.12.0 && hack/update-vendor.sh

Kubernetes-commit: d9bd413f991958492602c4bf51c43d6edca0e5cd
2023-07-14 10:25:23 -03:00
Mike Spreitzer
4c1cb3cb29 Update generated code for APF borrowing by exempt
Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com>

Kubernetes-commit: f78d6062eb8c4565e570f4c8657856a0bd082cf9
2023-07-14 01:00:06 +00:00
Jiahui Feng
0c7c900fd5 ValidatingAdmissionPolicy: Variable Composition (#118642)
* [API REVIEW] Variable Composition

* lazy map.

* variable composition implementation.

* check variables during VAP validation.

* generated: ./hack/update-vendor.sh

* generated: UPDATE_COMPATIBILITY_FIXTURE_DATA

(cd staging/src/k8s.io/api/ && env UPDATE_COMPATIBILITY_FIXTURE_DATA=true go test)

* cost calucation.

* tests for cost calculations.

* e2e test for variables.

* fix doc for Validation.Expression.

* generated: ./hack/update-codegen.sh

* fix missing utilruntime import.

* generated: ./hack/update-openapi-spec.sh

Kubernetes-commit: b635f2a401fd03715f6a33c4a19f11c509c0ce03
2023-07-14 01:12:10 +00:00
Shiming Zhang
8c4503becd Regenerate
Kubernetes-commit: 3e2a1a7b9ce860dbe39a03014707c9bcdd333960
2023-07-12 15:02:44 +08:00
Kubernetes Publisher
560efb3b89 Merge pull request #117351 from pohly/dra-generated-resource-claim-names
DRA: generated resource claim names

Kubernetes-commit: e0dafe57a3858b798f4137223e7fdc70bd15b617
2023-07-11 21:08:44 +00:00
Patrick Ohly
86ae84acb9 generated files
Kubernetes-commit: c1eb18c00caaffa127ef554f3c0f693848a28d4a
2023-07-10 17:51:23 +02:00
Dr. Stefan Schimanski
05b412c425 Bump kube-openapi
Kubernetes-commit: 961c1503b5bd2b0f83d6b6b98e0c8f29525ca9cb
2023-06-26 13:09:30 +02:00
Eric Lin
411a1189f8 Run hack/update-codegen.sh informers subprojects
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: c86f562f29b6b7498ea962d2ac596e6d26ecd723
2023-06-04 20:33:01 +00:00
Eric Lin
da4a4e2e16 Add 'WithTransform' SharedInformerOption
Also add support for metadata informer factory to use SharedInformerOption

Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 9c4651bd0479b84f5e5913649207476717f3f13e
2023-06-04 12:26:58 +00:00
Jordan Liggitt
daed746fdc Add GroupDiscoveryFailedErrorGroups helper method
Kubernetes-commit: 733f63c6c423565b8cecf3f3db8e9d81e48b1311
2023-05-15 09:23:54 -04:00
Stephen Kitt
caded3c2dc api-machinery: stop using deprecated io/ioutil
This replaces deprecated ioutil functions as follows:

* ioutil.ReadAll -> io.ReadAll
* ioutil.ReadFile -> os.ReadFile
* ioutil.TempDir -> os.MkdirTemp
* ioutil.TempFile -> os.CreateTemp
* ioutil.WriteFile -> os.WriteFile

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

Kubernetes-commit: b60a3a58df2791ae67764f6325be31aea5eca5a0
2023-05-02 15:08:18 +02:00
Patrick Ohly
4ddde4e3b5 dra: generated files
Kubernetes-commit: 0fc62d5ded07b01c6ffe9110f5c4991c34efb205
2023-04-14 09:51:07 +02:00
Kubernetes Publisher
aed71fa5cf Merge pull request #116429 from SergeyKanzhelev/sidecar
Add SidecarContainers feature

Kubernetes-commit: 0e1409833360adf6b46ca5ae3ba355169d065285
2023-07-11 06:29:00 +00:00
Gunju Kim
d63727d2cb Sidecar: Generated code
Kubernetes-commit: c187b38117379777b77656526a4f12da311c8341
2023-05-10 01:39:38 +09:00
Kubernetes Publisher
d31edad7e2 Merge pull request #118010 from aimuz/cleanup
cleanup: duplicate request_test TestRequestAbsPathPreservesTrailingSlash

Kubernetes-commit: 823e0f77e8a736718bd88bfaa87226186dcaae25
2023-07-06 19:32:17 +00:00
Kubernetes Publisher
5d8fd6bf0a Merge pull request #118386 from Richabanker/enhance-storage-version
Add servedVersions info in StorageVersion API

Kubernetes-commit: cd32adebd9d52ae46827054350c17de085a4eb23
2023-07-06 06:37:06 +00:00
Richa Banker
61c0de83db Add servedVersions info in StorageVersion API
Kubernetes-commit: 1c48b7ec144785b4b2493a01d82e40d6d34ce578
2023-06-01 18:07:56 -07:00
Michal Fojtik
0cde78477a client-go: add DNS resolver latency metrics (#115357)
* client-go: add DNS resolver latency metrics

* client-go: add locking to DNS latency metrics

* client-go: add locking for whole DNSStart and DNSDone

Signed-off-by: Vu Dinh <vudinh@outlook.com>

* Fix a mismatched ctx on the request

Signed-off-by: Vu Dinh <vudinh@outlook.com>

* Clean up request code and fix comments

Signed-off-by: Vu Dinh <vudinh@outlook.com>

---------

Signed-off-by: Vu Dinh <vudinh@outlook.com>
Co-authored-by: Vu Dinh <vudinh@outlook.com>

Kubernetes-commit: 1c7e87cff27aa009488a9d55342220e223d5c146
2023-06-28 22:56:45 +02:00
Kubernetes Publisher
bb755c8cba Merge pull request #118922 from champtar/kubeadm-backdate-ca
kubeadm: backdate generated CAs

Kubernetes-commit: 4036b6fb41b36d76a6076e4f430f74423efe04f3
2023-06-28 22:17:23 +00:00
Etienne Champetier
089cdcdf71 client-go: allow to set NotBefore in NewSelfSignedCACert()
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>

Kubernetes-commit: 44692a486f96bda80ffd2a2a132a651b47457391
2023-06-28 00:01:34 -04:00
Kubernetes Publisher
4308ca3a0e Merge pull request #118903 from champtar/revert-118631-ca-not-before
Revert "Make CA valid 1 hour in the past"

Kubernetes-commit: b82240cfb02c282b3765920ca0d28ff754dafe9a
2023-06-27 18:35:02 +00:00
Etienne Champetier
d19c2b99a8 Revert "Make CA valid 1 hour in the past"
Kubernetes-commit: 56c5c8f7eef25748389987a416d272bf8db2431d
2023-06-27 08:57:59 -04:00
Kubernetes Publisher
9186f40b18 Merge pull request #114849 from padlar/handle-terminating-namespaces
handle event errors caused due to terminating namespaces

Kubernetes-commit: 2e93c65eff5979e21178d9d7117916e49af29838
2023-06-20 13:08:39 +00:00
Kubernetes Publisher
808ebc843b Merge pull request #118689 from bzsuni/clean
[dependencies] update prometheus/client_golang v1.14.0 to v1.16.0

Kubernetes-commit: 0004ce8684bd9c6be0af4ad8fc9b076f4a04e23e
2023-06-19 01:09:03 +00:00
Kubernetes Publisher
ebad5fbb0d Merge pull request #118631 from champtar/ca-not-before
Make CA valid 1 hour in the past

Kubernetes-commit: 604584d1d3cc230948498040281b2862f789c7c3
2023-06-15 11:22:30 -07:00
bzsuni
afed8d3bbe update prometheus/client_golang v1.14.0 to v1.16.0
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>

Kubernetes-commit: 5aa5f1abc9c9d83ccc34382ae2a8e0241ec1d866
2023-06-15 11:24:32 +00:00
Etienne Champetier
d606148375 Make CA valid 1 hour in the past
When running kubeadm / installing k8s early during boot,
the CA certificate can be generated before time is synchronised
and time is jumped backward.
Make notBefore 1 hour in the past to accept small clock jump.

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>

Kubernetes-commit: e1735b9863777ff11ac35434e047c38dcce4b4f3
2023-06-13 01:04:28 -04:00
Kubernetes Publisher
92512ee2b8 Merge pull request #118055 from timofurrer/export-default-server-url-for-func
Export DefaultServerUrlFor utility function

Kubernetes-commit: cc60a9348536a85978946de3001dc6a3737cf516
2023-06-12 21:08:41 +00:00
Kubernetes Publisher
aa1fae7565 Merge pull request #118481 from cbandy/client-go-testing-setenv
Replace os.Setenv with testing.T.Setenv in tests

Kubernetes-commit: a4e6367bb60b0b0bdaf0007248c2c5cd990fcecd
2023-06-12 21:08:40 +00:00
Kubernetes Publisher
5a01920212 Merge pull request #118507 from jeremyrickard/go1205
[go] Bump images, versions and deps to use Go 1.20.5

Kubernetes-commit: c042d6956f70566a81bc29c9af6896fefbf89aae
2023-06-07 18:21:36 +00:00
Jeremy Rickard
5b9e822e45 Update vendor with hack/update-vendor.sh
Signed-off-by: Jeremy Rickard <jeremyrrickard@gmail.com>

Kubernetes-commit: b1da721bdd711d9f75a57d782c5a33eea7ac35a4
2023-06-07 08:26:14 -06:00
Chris Bandy
3ffcfabea2 Replace os.Setenv with testing.T.Setenv in tests
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.

Kubernetes-commit: ac5ce5cbce7ddb6ffeff755d1cf670afadb8e1fb
2023-06-05 21:03:21 -05:00
Kubernetes Publisher
fe81cbee2b Merge pull request #118384 from Jefftree/gnostic-models-branch
Update gnostic library to point to gnostic-models

Kubernetes-commit: bd0ac4cba33f40195b4ffab5463f2b5397216400
2023-06-02 18:20:34 +00:00
Kubernetes Publisher
4485c4ecbb Merge pull request #117870 from howardjohn/client/run-errorhandler-race
informer: fix race against Run and SetTransform/SetWatchErrorHandler

Kubernetes-commit: decf1e1a9b53a4f4b24bb780d6433e2d5e959d83
2023-06-02 02:20:29 +00:00
Jefftree
2bd3f49236 Update gnostic references
Kubernetes-commit: 2111e79f56acdfa6a8dab56780c52e3abc608758
2023-06-01 18:25:39 +00:00
Jefftree
90e15d42fa vendor
Kubernetes-commit: 1993a4cb3798d818ff05db0e0c7c9c87d8b41dd2
2023-06-01 18:25:30 +00:00
Kubernetes Publisher
cf830e3cb3 Merge pull request #113362 from sxllwx/ftr/extract_listobject_use_copy
Faster ExtractList. Add ExtractListWithAlloc variant.

Kubernetes-commit: fe9ef26af5d90de9610153c73f47ce75805ee9d5
2023-05-29 18:20:30 +00:00
Kubernetes Publisher
f21df6e02d Merge pull request #118132 from marseel/improve_reflector_retries
Improve backoff policy in reflector.

Kubernetes-commit: 7f2a1e8cd3363b04d970c619daf9f9d5ee5d50c0
2023-05-29 18:20:28 +00:00
scott
6c7d1bc996 Add WithAlloc interface and stub implementations with base benchmarks
Kubernetes-commit: b8a3bd673dc61b4d7a0ad0f54fa423e0160078cf
2023-05-27 17:57:35 -04:00
Kubernetes Publisher
c670796be1 Merge pull request #118269 from liggitt/genproto
Update google.golang.org/genproto

Kubernetes-commit: d05b79c836c9db35ef0a60f0175b3a6bbeedfa7e
2023-05-26 22:20:21 +00:00
Jordan Liggitt
260c0c5584 Update google.golang.org/genproto
Kubernetes-commit: a045fedd025c08ad6cb116a9beb3042b6be39fd1
2023-05-25 21:10:02 -04:00
Kubernetes Publisher
7a7ea20936 Merge pull request #118054 from johanoskarsson/johan_leader_election_lock_id_validate
Validate lock identity

Kubernetes-commit: 36d81a5818665b55c2b0f307c15572626d84b07a
2023-05-25 18:20:05 +00:00
Kubernetes Publisher
151a5919db Merge pull request #118235 from kkkkun/set_watchlist_env
Lookup ENABLE_CLIENT_GO_WATCH_LIST_ALPHA in NewReflectorWithOptions

Kubernetes-commit: 6911d3b2b8a498c570d58827277347b2bb8c4100
2023-05-25 10:19:57 +00:00
Kubernetes Publisher
6fbb0bd42d Merge pull request #116656 from HirazawaUi/fik-fd-leaks
Cleanup fd leaks and file removal cleanup

Kubernetes-commit: 03ebd4b7ef3fc5d2ec5b407b36488c6324a058b6
2023-05-25 06:19:52 +00:00
Kubernetes Publisher
328d0fb9ee Merge pull request #118240 from Jefftree/bump-kube-openapi
Bump kube openapi

Kubernetes-commit: f99589b4f52a39a73a0a15449f9adb817a8865b8
2023-05-24 22:20:11 +00:00
Jefftree
17a70dc433 Update vendor
Kubernetes-commit: 4373ae05f345b5d85672bdeefe26e1f69d185086
2023-05-24 18:55:36 +00:00
Arda Güçlü
4cb373f7ca Add warning log callback in client-go loading rules (#117233)
* Add warning log callback in client-go loading rules

This provides a way to consumers use their own custom warning
mechanisms instead default klog warning.

* Use typed error instead plain string

* Fix interface change in unit test

Kubernetes-commit: 2ea6896f90c8b757d8a247d393b9a13fff2dab58
2023-05-24 18:20:07 +00:00
kkkkun
3195e36899 Should get ENABLE_CLIENT_GO_WATCH_LIST_ALPHA when new reflector
Signed-off-by: kkkkun <scuzk373x@gmail.com>

Kubernetes-commit: 2eed9b4143a9009b3327003ae50dbbebb44d2841
2023-05-24 21:09:53 +08:00
Marcel Zieba
bae10246dd Improve backoff policy in reflector.
Before, we've used two separate backoff managers for List and Watch
calls, now they share single backoff manager.

Kubernetes-commit: 337728b02559dec8a613fdef174f732da9cae310
2023-05-19 14:28:31 +02:00
Kubernetes Publisher
2a5f18df73 Merge pull request #116973 from apelisse/add-client-to-typeconverter
managedfields: A few improvements which will make testing easier

Kubernetes-commit: addf9d477840abd7555e9a7b2568f88e53644ed0
2023-05-17 01:00:17 +00:00
Timo Furrer
d11d5308d6 Export DefaultServerUrlFor utility function
Signed-off-by: Timo Furrer <tuxtimo@gmail.com>

Kubernetes-commit: ebaf49dbd709a94e0c44aa75b4c32b50898a05e3
2023-05-16 19:20:07 +02:00
Johan Oskarsson
0011bf6b0b Validate lock identity
Ensure that the lock identity is not empty. This can cause unexpected issues during leader election.

Kubernetes-commit: 5519b89a28eeea5a5b134092242aff770fcc07eb
2023-05-16 09:41:18 -07:00
aimuz
39f724a06e cleanup: duplicate request_test TestRequestAbsPathPreservesTrailingSlash
Signed-off-by: aimuz <mr.imuz@gmail.com>

Kubernetes-commit: 7da7468a3fc3f914c7b032c25c3e35097fd85449
2023-05-15 23:14:30 +08:00
John Howard
702d7378b6 informer: fix race against Run and SetTransform/SetWatchErrorHandler
`SetWatchErrorHandler` claims it will fail if Run() has already started.
But if they are called concurrently, it will actually trigger a data
race.

With this PR:
```
62702 runs so far, 0 failures (100.00% pass rate). 59.152682ms avg, 189.068387ms max, 26.623785ms min
```

Without this PR:
```
5012 runs so far, 38 failures (99.25% pass rate). 58.675502ms avg, 186.018084ms max, 29.468104ms min
```

Kubernetes-commit: 35d2431b3a89c5bd693846952e9d27ce4e3a0754
2023-05-08 10:11:54 -07:00
HirazawaUi
84dc0417b2 fix fd leaks and failed file removing for pkg client-go
Kubernetes-commit: 73aeed8766c2c42a6cb4fc8632b1b974f4508dde
2023-05-03 01:35:16 +08:00
HirazawaUi
a9b2f9e9eb add remove_file in client-go util directory
Kubernetes-commit: f49cc5eb113b839a5f5c6121ff0b89f82a483011
2023-05-03 01:33:28 +08:00
Antoine Pelisse
f454763642 openapi: Create client -> TypeConverter function
Allows creating a typeconverter from a client (i.e. by taking the data
of the client and formatting it so that one can create a type
converter).

Kubernetes-commit: 45853e20ae5c33d144939495650bb5cc49e1134c
2023-03-28 14:15:43 -07:00
Kubernetes Publisher
9e63bf0275 Merge pull request #117985 from howardjohn/patch-2
Fix comments on InformerFor

Kubernetes-commit: 54d2ced4d6e6e03f6e411f3c77f33bcc9ff809e1
2023-05-16 17:10:27 +00:00
Kubernetes Publisher
c2105c1815 Merge pull request #118014 from liggitt/mapstructure
Update kube-openapi, drop mapstructure

Kubernetes-commit: ea4cc84cf7c47d2bc45730ea2563bc320dfe5ff1
2023-05-16 01:12:09 +00:00
Jordan Liggitt
9cbecd3bd0 Update kube-openapi, drop mapstructure
Kubernetes-commit: d6d1dbdd82a412a06cdf458ca40836a018670131
2023-05-15 16:42:00 -04:00
John Howard
73d5348976 codegen
Kubernetes-commit: 3867569ae275b056e7f25b2228a5887dd9fa422b
2023-05-15 10:16:18 -07:00
Kubernetes Publisher
578f82a568 Merge pull request #117982 from jpbetz/sig-roles-jpbetz
Add api-machinery TL owners permissions for jpbetz

Kubernetes-commit: 1487fc762ff9b23952a75b69ca2b152efd3f7238
2023-05-15 17:04:28 +00:00
Kubernetes Publisher
435f839a9e Merge pull request #117645 from humblec/etcd-2
dependencies: update etcd dependencies to v3.5.9

Kubernetes-commit: 3a65b989e3db450029e796b370d103fe2c43006b
2023-05-15 17:04:27 +00:00
Kubernetes Publisher
79d967dc52 Merge pull request #117139 from pohly/test-integration-race-detection-update-utils
dependencies: bump k8s.io/utils

Kubernetes-commit: 87d8c4ed0ab58c5d19a4f2513fb49b920fdef346
2023-05-15 17:04:25 +00:00
Joe Betz
2c19e72cd0 Add api-machinery TL owners permissions for jpbetz
Kubernetes-commit: f0f92853ad82cba33c95803d9f869eaeba6cc3a7
2023-05-12 13:06:12 -04:00
Humble Chirammal
d400a4ae88 update vendor dependencies for the change
Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>

Kubernetes-commit: dcefc42b35acb229fcf95a172bfd635ee615d1be
2023-05-11 21:58:39 +05:30
Humble Chirammal
81fe15039a etcd depdencies are updated to v3.5.9
Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>

Kubernetes-commit: ae749238786f0c7b32a5291dd52ca31ea7c4fd18
2023-05-11 21:25:46 +05:30
Patrick Ohly
c1b43e3ea9 dependencies: bump k8s.io/utils
This includes a fix for a race condition.

Kubernetes-commit: 83fb5a50bc97cb58705084c0750f5a6b16fdf219
2023-04-06 13:11:47 +02:00
Kubernetes Publisher
2b18fa2c7a Merge pull request #117946 from lavalamp/lavalamp-taking-a-break
lavalamp is taking a long break

Kubernetes-commit: 8479db5876e95de535d9a8a361b6a2bff8251ea3
2023-05-13 01:08:23 +00:00
Kubernetes Publisher
f5cc996aa0 Merge pull request #117961 from humblec/ginkgo
ginkgo update to v2.9.4 and gomega to 1.27.6

Kubernetes-commit: 84c8abfb8bf900ce36f7ebfbc52794bad972d8cc
2023-05-12 17:14:55 +00:00
Kubernetes Publisher
54dbcc99c2 Merge pull request #116761 from iancoolidge/devel-cpuset-revendor
Complete cpuset export to k/utils by revendoring

Kubernetes-commit: 8f9c18569616eb65666a9271c3dd4d87b46ccece
2023-05-12 17:14:52 +00:00
Humble Chirammal
719a53871d ginkgo update to v2.9.4 and gomega to 1.27.6
https://github.com/onsi/ginkgo/v2/compare/v2.9.1...v2.9.4
 https://github.com/onsi/gomega/compare/v1.27.4...v1.27.6

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

Kubernetes-commit: cbe825b2b6cde3ae6e13b75e459227c71ea7e1f7
2023-05-12 09:33:31 +05:30
Kubernetes Publisher
23a9e82799 Merge pull request #117295 from aojea/transport_cache_metrics
add new metric for the internal client-go cache size

Kubernetes-commit: 64af2d93e5b97e41bb078e2fa81923fda6681154
2023-05-11 18:40:35 +00:00
Daniel Smith
aa75d3bd59 lavalamp is taking a long break
Kubernetes-commit: 1ffe3f467e8b8033312b7c68943d58125fd27663
2023-05-11 16:43:38 +00:00
Antonio Ojea
7cf3125431 add new metrics for the internal client-go transport generator
Add two new metrics to monitor the client-go logic that
generate http.Transports for the clients.

- rest_client_transport_cache_entries is a gauge metrics
with the number of existin entries in the internal cache

- rest_client_transport_create_calls_total is a counter
that increments each time a new transport is created, storing
the result of the operation needed to generate it: hit, miss
or uncacheable

Change-Id: I2d8bde25281153d8f8e8faa249385edde3c1cb39

Kubernetes-commit: 3f3e1d507d081528ce8081f0daf4446d8a3b9bc0
2023-05-10 22:40:13 +00:00
Kubernetes Publisher
783d0d3362 Merge pull request #116506 from HirazawaUi/fix-events-field
generate ReportingInstance and ReportingController in Event

Kubernetes-commit: b277afdf469c959955a2818b85fb1e4333ba3c11
2023-05-09 21:25:18 +00:00
Min Ni
a3b4cd32e5 update serial number to a valid non-zero number in ca certificate (#117791)
* update serial number to a valid non-zero number in ca certificate

* fix the existing problem (0 SerialNumber in all certificate) as part of this PR in a separate commit

Kubernetes-commit: e865b30abd0a862697ff1d2526ea8897ee98a523
2023-05-09 17:07:46 +00:00
Kubernetes Publisher
bbdc95deee Merge pull request #117422 from cbandy/client-go-testing-setenv
Replace os.Setenv with testing.T.Setenv in tests

Kubernetes-commit: 940101e07e1fbf45747ef67bca43b645b2a67065
2023-05-05 09:05:44 +00:00
Kubernetes Publisher
383ccb06d0 Merge pull request #117713 from flant/ssr-ga
KEP-3325: Promote SelfSubjectReview to GA

Kubernetes-commit: 78833e1b3385ea3485d38aa46586d39195377ec9
2023-05-03 18:02:28 +00:00
Kubernetes Publisher
bea472626f Merge pull request #117687 from pohly/klog-update
dependencies: klog v2.100.1

Kubernetes-commit: a6825c8542ee1e5e9d570ba1c267458a09287015
2023-05-03 18:02:26 +00:00
Kubernetes Publisher
d8abacd71f Merge pull request #117716 from thockin/validation_test_whitespace
Clean up brace whitespace in **/validation_test.go

Kubernetes-commit: 2e78e07ee56e4c7a6e764af39735a36454768ab4
2023-05-02 17:45:21 +00:00
Kubernetes Publisher
1513f87e7a Merge pull request #94021 from timoreimann/support-specifying-custom-lb-retry-period-from-cloud-provider
Support specifying custom LB retry period from cloud provider

Kubernetes-commit: f51dad586ddc1a02b4fcc4e3974092ad78b630a7
2023-05-02 09:44:08 +00:00
Tim Hockin
54190dfee5 Clean up brace whitespace in **/validation_test.go
This was making my eyes bleed as I read over code.

I used the following in vim.  I made them up on the fly, but they seemed
to pass manual inspection.

:g/},\n\s*{$/s//}, {/
:w
:g/{$\n\s*{$/s//{{/
:w
:g/^\(\s*\)},\n\1},$/s//}},/
:w
:g/^\(\s*\)},$\n\1}$/s//}}/
:w

Kubernetes-commit: d55b67b349021b6c46fc6ce78f2a36bd4217145f
2023-05-02 00:36:15 -07:00
Kubernetes Publisher
71d8553562 Merge pull request #115843 from rikatz/remote-netpol-status
Remove/Withdraw  NetworkPolicy Status

Kubernetes-commit: d6471d01a43d575351ec505f95a3691c977caccd
2023-05-02 05:34:53 +00:00
m.nabokikh
8009187f26 KEP-3325: Promote SelfSubjectReview to GA
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: 40de26dcff80f29380a4ba90a93ce3ece7482b78
2023-05-02 01:26:20 +02:00
Patrick Ohly
a4fdfdae72 dependencies: klog v2.100.1
Kubernetes-commit: 5fff8cae749cefbac63173f176831ea007b95b3a
2023-04-29 20:47:44 +02:00
Chris Bandy
18ffb5c67f Replace os.Setenv with testing.T.Setenv in tests
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.

Kubernetes-commit: 89467ad3e9b051515fa9632a7373d6ef01723256
2023-04-15 10:09:47 -05:00
HirazawaUi
0a0ddf8b6b generate ReportingInstance and ReportingController in Event
Kubernetes-commit: df0a25382053bb6c0f04fc4d807be6e059b552c1
2023-03-27 22:23:45 +08:00
Ian K. Coolidge
f4ef3f8afe Update k8s.io/utils version to v0.0.0-20230313181309-38a27ef9d749
Steps:
1) Manualy update go.mod with new version string
2) ./hack/update-vendor.sh
3) Fixup go.sum with new package hash
4) ./hack/update-vendor.sh

Kubernetes-commit: 9f46cbc6fa475c420af3ccd654d4e59606375836
2023-03-18 14:52:37 +00:00
Kensei Nakada
a46288252b feature(scheduler): implement matchLabelKeys in PodAffinity and PodAntiAffinity
Kubernetes-commit: d5d3c26337af418555fe6f62f86b9aaf38dc59d3
2023-02-26 04:25:59 +00:00
Ricardo Katz
224050a5b5 Generated files for NetworkPolicyStatus removal
Kubernetes-commit: ec997d5433afc09e79376e35936a027dc2ba8713
2023-02-16 14:31:49 -03:00
Kubernetes Publisher
10f4062eb6 Merge pull request #117705 from Jefftree/update-openapi-fix-race
Update kube-openapi to fix race

Kubernetes-commit: 3f8c4794eadf8aadd8a5bcb0b875bf0af5c2020b
2023-05-01 21:41:35 +00:00
Kubernetes Publisher
757bbef10a Merge pull request #117623 from skitt/intstr-fromint32-api-machinery
API machinery: use new intstr functions

Kubernetes-commit: 32703dec0faa19762f3cde83cfefae981de62027
2023-05-01 21:41:33 +00:00
Kubernetes Publisher
337feac705 Merge pull request #117576 from wzshiming/fix/clientcmd-localtion-of-origin
Fix LocationOfOrigin shows up unexpectedly

Kubernetes-commit: 34d6b92a8ceaf0b2243dd62b1f3517878fc75e35
2023-05-01 17:50:53 +00:00
Kubernetes Publisher
741627a2eb Merge pull request #117253 from akhilerm/update-containerd-dependencies
dependencies: update cgroups, ttrpc, ebpf versions

Kubernetes-commit: d33853edcfdb521c80cd9a659ed02b7fe52b40f4
2023-05-01 17:50:51 +00:00
Jefftree
fa6d692ff2 Update kube-openapi to fix race
Kubernetes-commit: de34540248a6cd4335a6aedd3f1d24c608d59c86
2023-05-01 17:19:03 +00:00
Shiming Zhang
3b78b11d95 Add json tag
Kubernetes-commit: d0677f528c03ff5556830bc2e9b9c40824b160ee
2023-05-01 23:05:32 +08:00
Arda Güçlü
fc96cec338 Use absolute path instead requestURI in openapiv3 discovery (#117495)
Currently, openapiv3 discovery uses requestURI to discover resources.
However, that does not work when the rest endpoint contains prefixes
(e.g. `http://localhost/test-endpoint/`).
Because requestURI overwrites prefixes also in rest endpoint
(e.g. `http://localhost/openapiv3/apis/apps/v1`).

Since `absPath` keeps the prefixes in the rest endpoint,
this PR changes to absPath instead requestURI.

Kubernetes-commit: d94c733ee2bfaedd9a1c45d58fbd56c99403c94d
2023-04-29 18:28:27 +03:00
Kubernetes Publisher
f775857c5d Merge pull request #117534 from Mskxn/fix_watcher
stop watcher when error occurs

Kubernetes-commit: 041bb9a56cb56ebf4ff9305f435a71c135bfc19c
2023-04-27 13:49:25 +00:00
Kubernetes Publisher
68394bf465 Merge pull request #117571 from seans3/agg-discovery-fix
Fixes bug when extra params added to discovery content-type

Kubernetes-commit: c5c2806e233b9c5ff49ac4ad0c6d734b530771de
2023-04-26 21:42:58 +00:00
Kubernetes Publisher
6aab78468d Merge pull request #116191 from aojea/spdy_passthrugh
improve remotecommand testing fuzzing the data stream

Kubernetes-commit: 928adb27abf755b402be7594844e3c248b0b7670
2023-04-26 17:48:31 +00:00
Msk233
5d5619d392 stop watcher when error occurs
Kubernetes-commit: da3e7e3781650024e4cc7cb65082908c531e8efa
2023-04-26 09:04:33 +08:00
Kubernetes Publisher
6c514ab3ff Merge pull request #117558 from wojtek-t/remove_multi_lock
Remove support for EndpointsLeases and ConfigMapsLeases lock from leader election

Kubernetes-commit: ff1e3ee26e94597f386b75fb60c5e2af6535a5be
2023-04-25 11:06:16 -07:00
Shiming Zhang
1ec6a37b5c Fix LocationOfOrigin shows up unexpectedly
Kubernetes-commit: 4d9261c7567a7498d16754b7c5bf3b9ea834e5a6
2023-04-25 10:58:07 +08:00
Sean Sullivan
5c4e72cc66 Refactors discovery content-type and helper functions
Kubernetes-commit: 2af662b05fe591083a029520e6da5b077cad8e31
2023-04-24 17:40:07 -07:00
Wojciech Tyczyński
27bbe76535 Remove support for EndpointsLeases and ConfigMapsLeases lock from leader election
Kubernetes-commit: 2bd42061b6e8035c3def54545ccc4baf95bd6586
2023-04-24 15:08:10 +02:00
Kubernetes Publisher
b26f379fe1 Merge pull request #117350 from mohitsharma-in/update/google-golang-protobuf
Dependencies: Update google.golang.org/protobuf v1.30.0

Kubernetes-commit: b925ce244638187dbf0f502ecb6e02db149970aa
2023-04-25 17:51:11 +00:00
Kubernetes Publisher
d2b87849d5 Merge pull request #117483 from ArkaSaha30/bump-gofuzz
dependencies:update `github.com/google/gofuzz` to v1.2.0

Kubernetes-commit: 7fbe3cba41915cad69f376eb6b3d3a326d51cd11
2023-04-24 21:58:24 +00:00
Kubernetes Publisher
e846cbee0d Merge pull request #117482 from ArkaSaha30/bump-go-logr
dependencies:update `github.com/go-logr/logr` to v1.2.4

Kubernetes-commit: f77e570fbadbf91c05840a1f6f9b6aec860de400
2023-04-24 21:58:15 +00:00
Akhil Mohan
a9d165e169 chore: update cgroups and ttrpc versions
- update github.com/containerd/cgroups to v1.1.0
- update github.com/containerd/ttrpc to v1.2.1

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>

Kubernetes-commit: 76fe41a996ec78d9774e1f1ca9d1d7ec40522f98
2023-04-23 22:23:42 -07:00
Kubernetes Publisher
bc930747ec Merge pull request #116972 from apelisse/update-openapi-file-client
openapi: Make file client more easy to re-use

Kubernetes-commit: 065428befa06c1d99deb4160b4490a8bf1a377ee
2023-04-21 05:44:30 +00:00
Kubernetes Publisher
861f50a667 Merge pull request #117352 from mohitsharma-in/update/golang_x_tools
dependencies: Update golang.org/x/tools to v0.8.0

Kubernetes-commit: bda7e8979088614c60ee21fd2602d00786e2ea78
2023-04-20 09:58:09 +00:00
ArkaSaha30
e367d8e4c2 update gofuzz dependency
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>

Kubernetes-commit: 1d15354ccb56b2e367cc403777255125ef65b7df
2023-04-19 21:08:16 +05:30
ArkaSaha30
061a00296e Update go-logr dependencies
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>

Kubernetes-commit: 2cd23c8b17c93f75a30cf3f651369d7a932aef2d
2023-04-19 21:01:55 +05:30
Mohit Sharma
23557e107c Dependencies Update golang.org/x/tools v0.7.0 to v0.8.0
Kubernetes-commit: 6f90c5363301c9417a3a806cac69f3e79e66a66c
2023-04-14 04:39:43 -07:00
Kubernetes Publisher
c84a3771c0 Merge pull request #117399 from mohitsharma-in/update/golang_time
dependencies : Update golang.org/x/time v0.3.0

Kubernetes-commit: cf89189ca3a3e5d280ba1cb09998c4b88dc1e127
2023-04-19 13:48:47 +00:00
Mohit Sharma
34d738fb5d Dependencies Update golang.org/x/timet 90d013bbcef8 to v0.3.0
Kubernetes-commit: 4d73864026cde02f4a1cdf9e889a124174d38e38
2023-04-16 22:18:35 -07:00
Mohit Sharma
1aeffb0799 Dependencies Update google.golang.org/protobuf v1.28.1 to v1.30.0
Kubernetes-commit: 8efeb5afcfd006a48d6e1263a5cf8de3284797df
2023-04-14 04:28:47 -07:00
Kubernetes Publisher
1dc92da663 Merge pull request #117278 from haoruan/cleanup/replace-spew-with-dump
replace spew methods with dump methods

Kubernetes-commit: d060d487dcd74bc1a557f9378035696db40c64c2
2023-04-14 05:53:56 +00:00
Kubernetes Publisher
4e89310f6e Merge pull request #117285 from humblec/azure-go-autorest
dependencies: update gh/Azure/auto-test/{adal,validation}

Kubernetes-commit: ba0a8f9cceb513bc36bd803e9bf8f9a8c3912ff2
2023-04-13 21:52:00 +00:00
Humble Chirammal
8b888b0027 dependencies: update gh/Azure/auto-test/{adal,validation}
Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>

Kubernetes-commit: 6d13cad2cf56d0bad77a6410a0c36b2cf8f0df57
2023-04-13 23:25:48 +05:30
Kubernetes Publisher
46f963913c Merge pull request #116896 from thockin/apimachinery_util_diff_cleanup
apimachinery util/diff cleanups

Kubernetes-commit: c3e3ff989ac9abfb0dc3b958fcb698fcce952f8c
2023-04-13 12:51:58 +00:00
Hao Ruan
ef522cc423 replace spew methods with dump methods
Kubernetes-commit: c4e1b01416ec05e6a520a181d4ce3b4333adb4e4
2023-04-13 09:41:07 +08:00
Antoine Pelisse
12beb34ceb openapi: Make file client more easy to re-use
A few notes about the change:
1. I need to initialize the fileclient once, in an init function, so I
don't have access to `testing.T` yet.
2. I want to be able to configure the openapi files that I use
3. We already have a "cache" client that wraps another client, we don't
need to re-implement caching here, one can just do:
`cache.NewClient(openapitest.NewFileClient("some/path"))` to do a cached
client. Or initialize it in an init/global var.

Since there is still some value to use the embedded file, make an
alternative constructor while using fs.FS interface to be able to
manipulate both virtual and disk-based filesystems.

Kubernetes-commit: 29503fd8d45bc2c9438e92936bf4111162529b40
2023-03-28 13:40:28 -07:00
Tim Hockin
12553015e2 Replace uses of ObjectReflectDiff with cmp.Diff
ObjectReflectDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: bc302fa4144d21a338683cd83701661f97be4aba
2023-03-23 11:34:03 -07:00
Tim Hockin
c4339eeca9 Replace uses of ObjectGoPrintDiff with cmp.Diff
ObjectGoPrintDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: 9627c50ef37f3b5274486e6f5ad37b73b1b69bf0
2023-03-23 11:31:25 -07:00
Tim Hockin
7114041b4f Replace uses of diff.ObjectDiff with cmp.Diff
ObjectDiff is already a shim over cmp.Diff, so no actual output or
behavior changes

Kubernetes-commit: 29c0b73d640b6e50c4f2dfeee7b07ca66a530dbd
2023-03-23 11:29:01 -07:00
Kubernetes Publisher
8005e0d28b Merge pull request #116869 from MikeSpreitzer/add-structure
Add structured alternatives to strings in client-go/tools/cache

Kubernetes-commit: 5052d31d6582c58cd82ccba084b11590fc82ba47
2023-04-12 04:02:58 +00:00
Kubernetes Publisher
20bcfef42d Merge pull request #114800 from haoruan/feature-8976-spew-sprintf-refactor
Capture spew.Sprintf() with all our favorite config into a util func

Kubernetes-commit: d0fc9d16ce1c8ac523e9dc90e14af542b09cd3b3
2023-04-12 00:07:19 +00:00
Kubernetes Publisher
04ef61f72b Merge pull request #116948 from MadhavJivrajani/fix-verify-vendor
.*: update vendor dir and cleanup

Kubernetes-commit: 3a46f2611503b4d8a8ab557bf2541ac9c1be695a
2023-03-27 18:23:04 +00:00
Madhav Jivrajani
012beed4e0 .*: update vendor dir and cleanup
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 63b5ca69f1f481b2b4b2ee967f5b8b7b58937211
2023-03-27 19:18:05 +05:30
Mike Spreitzer
8301a60862 Added conversions to/from NamespacedName
Also renamed file to something more on-point.

Kubernetes-commit: 8d92cfb13163f596feddfe1b5e734fd1ba4f6323
2023-03-22 16:55:07 -04:00
Mike Spreitzer
42799afb70 Add structured alternatives to strings in client-go/tools/cache
Kubernetes-commit: ec9515a828ec3907ffc66913947adf4e8ee7b9d6
2023-03-22 16:21:17 -04:00
Kubernetes Publisher
1517ffb8d3 Merge pull request #116623 from lavalamp/xfrmr
change where transformers are called

Kubernetes-commit: 76d351065e504e23b7962158ef0e9067b6bd96ed
2023-03-17 00:11:43 +00:00
Kubernetes Publisher
308e6b1055 Merge pull request #113218 from ahmedtd/kep-3257
Add certificates.k8s.io/v1alpha1 ClusterTrustBundle

Kubernetes-commit: a34e37c9963af5944435b736882bfcd1e81f7e09
2023-03-16 20:00:06 +00:00
Daniel Smith
c3b84f0438 Change where transformers are called.
Kubernetes-commit: e76dff38cf74c3c8ad9ed4d3bc6e3641d9b64565
2023-03-14 23:05:20 +00:00
Stephen Kitt
20433f9965 api-machinery: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

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

Kubernetes-commit: 94410ee8078971b8894e5c400ce3fc79f02bc510
2023-03-14 16:17:48 +01:00
Antonio Ojea
9ed804b6d5 improve remotecommand testing fuzzing the data stream
Change-Id: I1303bc79a8c43fc4fb04bf76afcf90653ceb9e14

Kubernetes-commit: 60d25c3ed77cbd8341fc7ae984e165e7046e5c9b
2023-03-01 19:56:41 +00:00
Sunil Shivanand
aea98eb150 combine conditional checks
Signed-off-by: Sunil Shivanand <sunil.shivanand@statnett.no>

Kubernetes-commit: 80480f8e21572cba152a4f6f171ebb5de8c6bafb
2023-01-11 09:45:37 +01:00
Sunil Shivanand
0d54cf50db handle event errors caused due to terminating namespaces
Create events are forbidden in terminating namespaces, use info
instead of error to log the failed event.

Signed-off-by: Sunil Shivanand <sunil.shivanand@statnett.no>

Kubernetes-commit: 7a6d58001b7d824f92601fd246b3aad9fbb9c583
2023-01-05 12:56:40 +01:00
Hao Ruan
db3650d98f replaced spew.Sprintf with a util pretty print function
Kubernetes-commit: f638e2849fbddeb201b8290586a4747af99086bf
2023-01-04 14:12:56 +08:00
Timo Reimann
d3003795b3 Localize SpyWorkQueue to cloud-provider for now
Kubernetes-commit: 208af2d1d83488de933977849581207149b829ee
2022-11-09 07:32:40 +01:00
Taahir Ahmed
4c5879adb0 ClusterTrustBundles: make update
Kubernetes-commit: 2e4b637bf8f304c5264b93cced659c2bcbb66733
2022-11-07 11:45:53 -08:00
Max Smythe
4666344cbc Custom match criteria (#116350)
* Add custom match conditions for CEL admission

This PR is based off of, and dependent on the following PR:

https://github.com/kubernetes/kubernetes/pull/116261

Signed-off-by: Max Smythe <smythe@google.com>

* run `make update`

Signed-off-by: Max Smythe <smythe@google.com>

* Fix unit tests

Signed-off-by: Max Smythe <smythe@google.com>

* Fix unit tests

Signed-off-by: Max Smythe <smythe@google.com>

* Update compatibility test data

Signed-off-by: Max Smythe <smythe@google.com>

* Revert "Update compatibility test data"

This reverts commit 312ba7f9e74e0ec4a7ac1f07bf575479c608af28.

* Allow params during validation; make match conditions optional

Signed-off-by: Max Smythe <smythe@google.com>

* Add conditional ignoring of matcher CEL expression validation on update

Signed-off-by: Max Smythe <smythe@google.com>

* Run codegen

Signed-off-by: Max Smythe <smythe@google.com>

* Add more validation tests

Signed-off-by: Max Smythe <smythe@google.com>

* Short-circuit CEL matcher when no matchers specified

Signed-off-by: Max Smythe <smythe@google.com>

* Run codegen

Signed-off-by: Max Smythe <smythe@google.com>

* Address review comments

Signed-off-by: Max Smythe <smythe@google.com>

---------

Signed-off-by: Max Smythe <smythe@google.com>

Kubernetes-commit: e5fd204c33e90a7e8f5a0ee70242f1296a5ec7af
2023-03-16 04:07:18 +00:00
Igor Velichkovich
38589731da Matchconditions admission webhooks alpha implementation for kep-3716 (#116261)
* api changes adding match conditions

* feature gate and registry strategy to drop fields

* matchConditions logic for admission webhooks

* feedback

* update test

* import order

* bears.com

* update fail policy ignore behavior

* update docs and matcher to hold fail policy as non-pointer

* update matcher error aggregation, fix early fail failpolicy ignore, update docs

* final cleanup

* openapi gen

Kubernetes-commit: 5e5b3029f3bbfc93c3569f07ad300a5c6057fc58
2023-03-15 06:19:12 +00:00
Kubernetes Publisher
445660b561 Merge pull request #116332 from klueska/extend-resourceclaimstatus
Update resource.AllocationResult with a slice of ResourceHandlers

Kubernetes-commit: ae36991498282514da3fe771b0dd9de66b991c86
2023-03-15 06:19:06 +00:00
Kubernetes Publisher
e023fb8815 Merge pull request #116119 from vinaykul/restart-free-pod-vertical-scaling-fixes
Restructure resize policy naming and set default resize policy values

Kubernetes-commit: 9053b5dc2c8e0b977e759b9f076d1a52bafabbb7
2023-03-15 06:18:59 +00:00
Kubernetes Publisher
9ff2627505 Merge pull request #115075 from aojea/ipaddress
IPAddress allocator

Kubernetes-commit: f44d561c1f8c327bdf2ff3bff175bd10d161454c
2023-03-15 06:18:52 +00:00
Kubernetes Publisher
84ae514115 Merge pull request #116539 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.9.1, gomega v1.27.3

Kubernetes-commit: f22504a9bafd5e34d86853a816d10578376aadc2
2023-03-15 06:18:45 +00:00
Kubernetes Publisher
ef07195878 Merge pull request #114242 from austince/feat/per-queue-metrics
Allow setting per-workqueue metrics providers

Kubernetes-commit: 98b1980a42ad197404d65a5022a32dcdc2087784
2023-03-15 06:18:38 +00:00
Kubernetes Publisher
23d016c390 Merge pull request #107826 from smarterclayton/context_wait
wait: Introduce new methods that allow detection of context cancellation

Kubernetes-commit: 5469b170fe8717cb9fae8f12498cd1afd5586891
2023-03-15 06:18:32 +00:00
Kubernetes Publisher
f3dc70cf10 Merge pull request #116603 from seans3/discovery-resilience
Aggregated discovery client resilient to nil GVK in response

Kubernetes-commit: a9fd6dfc736da314096f1fda24171119e58017c6
2023-03-15 06:18:27 +00:00
Kubernetes Publisher
48d97c09db Merge pull request #116556 from pohly/dra-podschedulingcontext
dra: PodScheduling -> PodSchedulingContext

Kubernetes-commit: fbfc887a097b2f7cddd065deacbff03abf0bfef6
2023-03-15 06:18:23 +00:00
Kubernetes Publisher
2a7ba94880 Merge pull request #112334 from dgrisonnet/fix-eventseries-count
Fix EventSeries starting count discrepancy

Kubernetes-commit: 689fc37dd2f92ca61f4f2405186cb7e097be3ab1
2023-03-15 06:18:17 +00:00
Kubernetes Publisher
3cafc13f5d Merge pull request #116299 from pohly/dra-v1alpha2
api: resource.k8s.io v1alpha1 -> v1alpha2

Kubernetes-commit: 0e06be57a65792ad5744b5ddf6abe95dd20ac773
2023-03-15 06:18:13 +00:00
Sean Sullivan
2bd557faec Aggregated discovery resilient to nil GVK
Kubernetes-commit: 26bf8a7ceb51bac357d8a02fd3e62b84363716db
2023-03-14 17:59:19 +00:00
Patrick Ohly
76262aa83e api: generated files for PodSchedulingContext
Kubernetes-commit: 2b8a4e809710f1b5eb3846a2964431a0266f287e
2023-03-13 23:16:18 +01:00
Patrick Ohly
a952148a50 dependencies: ginkgo v2.9.1, gomega v1.27.4
They contain some nice-to-have improvements (for example, better printing of
errors with gomega/format.Object) but nothing that is critical right now.

"go mod tidy" was run manually in
staging/src/k8s.io/kms/internal/plugins/mock (https://github.com/kubernetes/kubernetes/pull/116613
not merged yet).

Kubernetes-commit: fe59e091eb3331db54cff2351f16eabfe0cb681d
2023-03-13 16:06:20 +01:00
Antonio Ojea
568393e257 make update
Change-Id: I19e12ca05d977dca63043cb07ecf8a90e0e525c5

Kubernetes-commit: ba42ed9a49345f8a182829e72c7013ea3ff0d224
2023-03-12 13:50:02 +00:00
austin ce
21b4553e44 Allow custom metric provider for retry metrics
Kubernetes-commit: a60624ffbc265d61b35cab16ea9ded485909f3ed
2023-03-10 17:48:10 -05:00
austin ce
66fa9d308f Unify queue constructors, deprecate current constructors
Kubernetes-commit: fea83b78243c77e81b91f3f0a812979809aeacaf
2023-03-10 17:46:26 -05:00
Clayton Coleman
250fc3d6b4 wait: Update tests to reference the constant error
The structure of the error is changing, and we don't guarantee
reflect.DeepEqual(...) will remain true for ErrWaitTimeout currently.

Kubernetes-commit: 8d4004bbc77d012642db97e09238f4f65a926bca
2023-03-10 11:02:59 -06:00
Kevin Klues
ff60d1bd90 Update generated code for resource.k8s.io/v1alpha2
Signed-off-by: Kevin Klues <kklues@nvidia.com>

Kubernetes-commit: 452f345c472a206b148bbe7e4e27f772841dc363
2023-03-07 11:35:08 +00:00
Patrick Ohly
324f43b974 api: resource.k8s.io v1alpha1 -> v1alpha2
For Kubernetes 1.27, we intend to make some breaking API changes:
- rename PodScheduling -> PodSchedulingHints (https://github.com/kubernetes/kubernetes/issues/114283)
- extend ResourceClaimStatus (https://github.com/kubernetes/enhancements/pull/3802)

We need to switch from v1alpha1 to v1alpha2 for that.

Kubernetes-commit: 29941b8d3e7928244f48b05bf5bd453221fe7a9d
2023-03-06 12:43:58 +01:00
Kubernetes Publisher
362ffe4fcd Merge pull request #115668 from jiahuif-forks/feature/validating-admission-policy/type-system
Type System for ValidatingAdmissionPolicy

Kubernetes-commit: 152876a3eb9c6211c48bb159c87e2bf834e4eedc
2023-03-15 06:18:05 +00:00
Jiahui Feng
8dcee0c630 generated: ./hack/update-codegen.sh && ./hack/update-openapi-spec.sh
Kubernetes-commit: deb467261ca23ca5decfdb6b67bef3591d4cb842
2023-03-13 19:44:28 -07:00
Kubernetes Publisher
b5e4a5a9c3 Merge pull request #116397 from jiahuif-forks/feature/validating-admission-policy/message-expression
MessageExpression for ValidatingAdmissionPolicy

Kubernetes-commit: 6b3e2b7873f8518b95f5b09fa04f5f316669c7b2
2023-03-14 05:26:20 +00:00
Kubernetes Publisher
471f66fb10 Merge pull request #116490 from tallclair/docs-urls2
Fix broken links in API documentation

Kubernetes-commit: 110541b3d72e32e0016061cbaaecb4db9683e1eb
2023-03-14 01:10:18 +00:00
Kubernetes Publisher
e4aa1125e3 Merge pull request #116542 from enj/enj/f/go1.20
Explicit bump to go 1.20

Kubernetes-commit: de9ce03f19e8b1ace1e79fae17119820c4232b67
2023-03-13 21:15:40 +00:00
Kubernetes Publisher
b14244a3db Merge pull request #116477 from twz123/synctrack-64bit-alignment
Properly align synctrack.SingleFileTracker struct

Kubernetes-commit: 077ca3b7367d0761eaee833dffb15e7eed73fa2a
2023-03-13 21:15:38 +00:00
Monis Khan
e0b969df98 Explicit bump to go 1.20
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: ba471884fba92246e1547ce4a27f9d5e735afc60
2023-03-13 12:47:36 -04:00
Tom Wieczorek
9e8c663097 Properly align synctrack.SingleFileTracker struct
count is used with atomic operations so it must be 64-bit aligned,
otherwise atomic operations will panic. Having it at the top of the
struct will guarantee that, even on 32-bit arches.

This fixes panics like that one observed in kube-apiserver:

    E0310 13:48:47.476124     676 runtime.go:77] Observed a panic: unaligned 64-bit atomic operation
    goroutine 141 [running]:
    k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2482378, 0x2db2ff8})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x94
    k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x78
    panic({0x2482378, 0x2db2ff8})
    	/usr/local/go/src/runtime/panic.go:884 +0x218
    runtime/internal/atomic.panicUnaligned()
    	/usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
    runtime/internal/atomic.Load64(0x685f794)
    	/usr/local/go/src/runtime/internal/atomic/atomic_arm.s:280 +0x14
    k8s.io/client-go/tools/cache/synctrack.(*SingleFileTracker).HasSynced(0x685f790)
    	vendor/k8s.io/client-go/tools/cache/synctrack/synctrack.go:115 +0x3c
    k8s.io/client-go/tools/cache.(*processorListener).HasSynced(0x6013e60)
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:907 +0x20
    k8s.io/client-go/tools/cache.WaitForCacheSync.func1()
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:332 +0x50
    k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1({0x2dcf274, 0x607c600})
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x1c
    k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext({0x2dcf274, 0x607c600}, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x64
    k8s.io/apimachinery/pkg/util/wait.waitForWithContext({0x2dcf274, 0x607c600}, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:649 +0x11c
    k8s.io/apimachinery/pkg/util/wait.poll({0x2dcf274, 0x607c600}, 0x1, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:600 +0xc4
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext({0x2dcf274, 0x607c600}, 0x5f5e100, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:551 +0x60
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntil(0x5f5e100, 0x6298020, 0x607c600)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:542 +0x48
    k8s.io/client-go/tools/cache.WaitForCacheSync(0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:329 +0x80
    k8s.io/client-go/tools/cache.WaitForNamedCacheSync({0x283c5e1, 0xf}, 0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:316 +0xe8
    created by k8s.io/kubernetes/plugin/pkg/auth/authorizer/node.AddGraphEventHandlers
    	plugin/pkg/auth/authorizer/node/graph_populator.go:65 +0x5b0
    panic: unaligned 64-bit atomic operation [recovered]
    	panic: unaligned 64-bit atomic operation

    goroutine 141 [running]:
    k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x0})
    	vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:56 +0xf4
    panic({0x2482378, 0x2db2ff8})
    	/usr/local/go/src/runtime/panic.go:884 +0x218
    runtime/internal/atomic.panicUnaligned()
    	/usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
    runtime/internal/atomic.Load64(0x685f794)
    	/usr/local/go/src/runtime/internal/atomic/atomic_arm.s:280 +0x14
    k8s.io/client-go/tools/cache/synctrack.(*SingleFileTracker).HasSynced(0x685f790)
    	vendor/k8s.io/client-go/tools/cache/synctrack/synctrack.go:115 +0x3c
    k8s.io/client-go/tools/cache.(*processorListener).HasSynced(0x6013e60)
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:907 +0x20
    k8s.io/client-go/tools/cache.WaitForCacheSync.func1()
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:332 +0x50
    k8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1({0x2dcf274, 0x607c600})
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:222 +0x1c
    k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext({0x2dcf274, 0x607c600}, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:262 +0x64
    k8s.io/apimachinery/pkg/util/wait.waitForWithContext({0x2dcf274, 0x607c600}, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:649 +0x11c
    k8s.io/apimachinery/pkg/util/wait.poll({0x2dcf274, 0x607c600}, 0x1, 0x64a6060, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:600 +0xc4
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntilWithContext({0x2dcf274, 0x607c600}, 0x5f5e100, 0x6382050)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:551 +0x60
    k8s.io/apimachinery/pkg/util/wait.PollImmediateUntil(0x5f5e100, 0x6298020, 0x607c600)
    	vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:542 +0x48
    k8s.io/client-go/tools/cache.WaitForCacheSync(0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:329 +0x80
    k8s.io/client-go/tools/cache.WaitForNamedCacheSync({0x283c5e1, 0xf}, 0x607c600, {0x6298000, 0x3, 0x3})
    	vendor/k8s.io/client-go/tools/cache/shared_informer.go:316 +0xe8
    created by k8s.io/kubernetes/plugin/pkg/auth/authorizer/node.AddGraphEventHandlers
    	plugin/pkg/auth/authorizer/node/graph_populator.go:65 +0x5b0

Kubernetes-commit: ffcf653e0666366e6241c99d9418e830840afa0f
2023-03-13 08:37:13 +01:00
Kubernetes Publisher
012954e4d5 Merge pull request #116450 from vinaykul/restart-free-pod-vertical-scaling-api
Rename ContainerStatus.ResourcesAllocated to ContainerStatus.AllocatedResources

Kubernetes-commit: 3c6e419cc3e364e0fce874e6c51ca058f1b9daab
2023-03-13 01:21:52 +00:00
Tim Allclair
b8c2b4bd8c Fix broken API docs URLs
Kubernetes-commit: ea974280dc9948e31d426ee6366abff0957a5f82
2023-03-10 19:18:06 -08:00
Jiahui Feng
d2cdd64ea8 generated: ./hack/update-codegen.sh && ./hack/update-openapi-spec.sh
Kubernetes-commit: 1fff4949bd3168bea68f9d64525f394fd6821c54
2023-03-10 09:03:49 -08:00
Kubernetes Publisher
6df09021f9 Merge pull request #116435 from pohly/client-go-cache-reflector-leak
client-go: shut down watch reflector as soon as stop channel closes

Kubernetes-commit: fcfe5dfc2177320833caa451b401f2d1dc5668e7
2023-03-10 17:01:51 +00:00
Kubernetes Publisher
1f020beddb Merge pull request #110772 from p0lyn0mial/upstream-reflector-gets-stream
client-go: Add support for API streaming to the reflector

Kubernetes-commit: 90c3232de77aa0dd09b948ffdd27c575688fba8a
2023-03-10 17:01:47 +00:00
Kubernetes Publisher
d2ebc4d27c Merge pull request #116349 from apelisse/use-smarter-cache
Update kube-openapi to 15aac26d736a

Kubernetes-commit: a034962173e2b481d59e81178e3897870511ec7d
2023-03-10 08:45:19 +00:00
Kubernetes Publisher
756a0f3ae9 Merge pull request #114290 from Jefftree/mime-remove
remove mime AddExtensionType in discovery test

Kubernetes-commit: 37260b764811fc4f6ddddcb8b5b51f49f733c50c
2023-03-10 08:45:16 +00:00
vinay kulkarni
d906637aa7 Rename ContainerStatus.ResourcesAllocated to ContainerStatus.AllocatedResources - generated files
Kubernetes-commit: 565fd4116df866a642e245d6ef9c2fe94448b265
2023-03-10 03:36:01 +00:00
Patrick Ohly
29ad2bc1d4 client-go: shut down watch reflector as soon as stop channel closes
Without this change, sometimes leaked goroutines were reported for
test/integration/scheduler_perf. The one that caused the cleanup to get delayed
was this one:

    goleak.go:50: found unexpected goroutines:
        [Goroutine 2704 in state chan receive, 2 minutes, with k8s.io/client-go/tools/cache.(*Reflector).watch on top of the stack:
        goroutine 2704 [chan receive, 2 minutes]:
        k8s.io/client-go/tools/cache.(*Reflector).watch(0xc00453f590, {0x0, 0x0}, 0x1f?, 0xc00a128080?)
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:388 +0x5b3
        k8s.io/client-go/tools/cache.(*Reflector).ListAndWatch(0xc00453f590, 0xc006e94900)
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:324 +0x3bd
        k8s.io/client-go/tools/cache.(*Reflector).Run.func1()
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:279 +0x45
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc007aafee0)
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x49
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003e18150?, {0x75e37c0, 0xc00389c280}, 0x1, 0xc006e94900)
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xcf
        k8s.io/client-go/tools/cache.(*Reflector).Run(0xc00453f590, 0xc006e94900)
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/cache/reflector.go:278 +0x257
        k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithChannel.func1()
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:58 +0x3f
        k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x74
        created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
                /nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0xe5

watch() was stuck in an exponential backoff timeout. Logging confirmed that:

        I0309 21:14:21.756149 1572727 reflector.go:387] k8s.io/client-go/informers/factory.go:150: watch of *v1.PersistentVolumeClaim returned Get "https://127.0.0.1:38269/api/v1/persistentvolumeclaims?allowWatchBookmarks=true&resourceVersion=1&timeout=7m47s&timeoutSeconds=467&watch=true": dial tcp 127.0.0.1:38269: connect: connection refused - backing off

Kubernetes-commit: b4751a52d53d4acc6a5ce3e796938c9a12f81fcb
2023-03-09 21:19:17 +01:00
Kubernetes Publisher
65be885753 Merge pull request #116409 from p0lyn0mial/upstream-reflector-list-n-watch
reflector: allow watch method to accept a watcher

Kubernetes-commit: 20e44913853fba580997cacad594e5274613bd2d
2023-03-09 15:59:46 +00:00
Maksim Nabokikh
64e2c7ff16 KEP-3325: Promote SelfSubjectReview to Beta (#116274)
* Promote SelfSubjectReview to Beta

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fix whoami API

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fixes according to code review

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

---------

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: c1431af4f83b2b06a581f23806ee12a0663fed3b
2023-03-09 03:35:44 +00:00
Kubernetes Publisher
223d456ea2 Merge pull request #116145 from seans3/discovery-stale
Surface "stale" GroupVersions from AggregatedDiscovery

Kubernetes-commit: b1ba5c54625efc61931fbdf831044c76780dd8b4
2023-03-08 23:43:50 +00:00
Kubernetes Publisher
e6ae4ec2c5 Merge pull request #116354 from pacoxu/cleanup-CronJobTimeZone
cleanup: sync testdata as CronJobTimeZone is GAed

Kubernetes-commit: a66e13921408b0db8956e6d76feb5db1388f7603
2023-03-08 19:49:17 +00:00
Lukasz Szaszkiewicz
ac7598edb4 reflector: allow watch method to accept a watcher
Kubernetes-commit: f6161a51e93bfa70585f1797f447f13ec1fde68b
2023-03-08 12:52:32 +01:00
Paco Xu
7bf37ef90f cleanup: sync testdata as CronJobTimeZone is GAed
Kubernetes-commit: 23a583dc3679111d5aaebf2a87db67e4d7c58739
2023-03-08 13:15:46 +08:00
Lukasz Szaszkiewicz
262b98af03 cache/controller: Add ENABLE_CLIENT_GO_WATCH_LIST_ALPHA
Kubernetes-commit: 966b26d55c22f7fbf20841a3a993de4f984d88db
2023-03-07 12:34:11 +01:00
Kubernetes Publisher
60e53732bb Merge pull request #115973 from jpbetz/enforcement-actions
KEP-3488: Implement Enforcement Actions and Audit Annotations

Kubernetes-commit: 04675428bbfc9bf7ba4c9e1abfc427b6228069d9
2023-03-07 07:41:01 +00:00
Joe Betz
bbbf092e1d Generate code
Kubernetes-commit: 932a4d97249cb79f3041b5d8842425b0ed7275b3
2023-03-06 17:30:37 -05:00
Kubernetes Publisher
48ca73428a Merge pull request #115978 from seans3/discovery-empty-response
"empty response" not logged as error in memcache discovery client

Kubernetes-commit: 6bfa9371cffc66e7b80a848d72b81d4007ab05b8
2023-03-06 19:38:33 +00:00
Kubernetes Publisher
29a689d161 Merge pull request #116297 from p0lyn0mial/upstream-reflector-list-n-watch-refactor
reflector: extract watch and startResyncAsync methods

Kubernetes-commit: 778b24c97e189dcc8f14a81ce32e022b959f8fd3
2023-03-06 15:46:20 +00:00
Lukasz Szaszkiewicz
ac0a428e7a reflector watchlist tests
Kubernetes-commit: 194ffd779e7699c3f756f12e604b479b73f9f66c
2023-03-06 09:24:36 +01:00
Lukasz Szaszkiewicz
b33e818785 reflector: use watchlist
Kubernetes-commit: 51ec7305aa9fc2541c46c4836f5e150c818341f9
2023-03-09 14:11:59 +01:00
Lukasz Szaszkiewicz
d1c260eddc reflector: introduce watchList
Kubernetes-commit: 2fed6b8a19dde62fb6824aa9d008baedf51c2466
2023-03-09 14:08:58 +01:00
Kubernetes Publisher
06ad6b391d Merge pull request #116166 from pohly/test-go-vet
fix "go vet" issues, check as part of golangci-lint

Kubernetes-commit: ff735dff85367c2a096c4065b8b3c1fbbeecabc4
2023-03-04 00:02:04 +00:00
Kubernetes Publisher
d39f8291fc Merge pull request #116162 from apelisse/update-openapi
Update kube-openapi to afdc3dddf62d31f5e3868d699379c571a6007920

Kubernetes-commit: 253ab3eda71f250ad6692bb16f035cebaf0651c9
2023-03-04 00:02:02 +00:00
Antoine Pelisse
59fa142a96 Update kube-openapi to afdc3dddf62d31f5e3868d699379c571a6007920
Kubernetes-commit: 736123f447219375219a23b9acc9d550fe8ec4c4
2023-03-03 08:43:44 -08:00
Kubernetes Publisher
bfa72fd2d3 Merge pull request #116237 from seans3/openapi3-add-error
Add custom error struct for Group/Version not found

Kubernetes-commit: a6c775333cb1012ecdc192b68f7a411e38ff4ae7
2023-03-02 22:56:57 -08:00
Sean Sullivan
4c5eaaf0d7 Add custom error struct for Group/Version not found
Kubernetes-commit: dc83af0b44bd6432dea3ccd29a77ca3a0b6122a2
2023-03-03 00:01:22 +00:00
Kubernetes Publisher
3f4372de09 Merge pull request #115865 from seans3/discovery-client-cleanup
Updates old 403 and 404 discovery response tolerations

Kubernetes-commit: e0ca10118e0aa0076a49a6f96ea96534ffe30dcd
2023-03-03 00:01:45 +00:00
Lukasz Szaszkiewicz
f694a7978b reflector: extract watch and startResyncAsync methods
Kubernetes-commit: 34fe27355b8b5acc4d29d053ed4361b4f72e147b
2023-03-02 16:26:41 +01:00
Kubernetes Publisher
02d652e007 Merge pull request #116195 from seans3/openapi3-root-fix
Fixes bug with Root not handling Group without Version

Kubernetes-commit: bb8e9f3afb961920ef62dc073b283f3724d5adb2
2023-03-02 01:18:32 +00:00
Kubernetes Publisher
91199a69ee Merge pull request #115277 from pohly/klog-update
klog update

Kubernetes-commit: 51dedff4f3efd407ebf47de11d0db521274471a3
2023-03-02 01:18:31 +00:00
Sean Sullivan
6ddf61b8c1 Fixes bug with Root not handling Group without Version
Kubernetes-commit: 17cd59ec1cf5c0a83d52bc94995025e802f1a123
2023-03-01 21:24:02 +00:00
John Howard
089d04441d client-go: support Shutdown() for metadata and dynamic informers (#114434)
* client-go: support `Shutdown()` for metadata and dynamic informers

Followup to https://github.com/kubernetes/kubernetes/pull/112200,
specifically
https://github.com/kubernetes/kubernetes/pull/112200#issuecomment-1344812038.

* add comments

* Defer lock

Kubernetes-commit: b99fe0d5b9896dd3fe9a2c1bc3b399a18ad080d2
2023-02-28 23:09:17 -08:00
Kubernetes Publisher
9ea785f819 Merge pull request #116090 from abserari/patch-1
Typo: fix EndpointsLeasesResourceLock ->ConfigMapsLeasesResourceLock

Kubernetes-commit: 11ff3fbeeeba56b28be3bf0badf8b49ec7d9fc2b
2023-03-01 01:18:45 +00:00
Patrick Ohly
3259c410fa staging: fix "go vet" issues
These issues were not found earlier because "make vet" ignored staging. Some of
these fixes are stylistic and/or don't matter in practice, but all of the
loopclosure issues seem to be real: those tests didn't run as intended.

Here's the full error report:

staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go:304:11: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersion struct literal uses unkeyed fields (govet)
				gv := schema.GroupVersion{crd.Spec.Group, v.Name}
				      ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go:790:119: composites: k8s.io/apimachinery/pkg/runtime/serializer/json.SerializerOptions struct literal uses unkeyed fields (govet)
			delegate := serializerjson.NewSerializerWithOptions(serializerjson.DefaultMetaFactory, unstructuredCreator{}, nil, serializerjson.SerializerOptions{tc.yaml, false, tc.strictDecoding})
			                                                                                                                   ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go:171:30: composites: k8s.io/apiserver/pkg/cel.Error struct literal uses unkeyed fields (govet)
		compilationResult.Error = &apiservercel.Error{apiservercel.ErrorTypeInvalid, "compilation failed: " + issues.String()}
		                           ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go:175:30: composites: k8s.io/apiserver/pkg/cel.Error struct literal uses unkeyed fields (govet)
		compilationResult.Error = &apiservercel.Error{apiservercel.ErrorTypeInvalid, "cel expression must evaluate to a bool"}
		                           ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go:182:30: composites: k8s.io/apiserver/pkg/cel.Error struct literal uses unkeyed fields (govet)
		compilationResult.Error = &apiservercel.Error{apiservercel.ErrorTypeInternal, "unexpected compilation error: " + err.Error()}
		                           ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go:201:30: composites: k8s.io/apiserver/pkg/cel.Error struct literal uses unkeyed fields (govet)
		compilationResult.Error = &apiservercel.Error{apiservercel.ErrorTypeInvalid, "program instantiation failed: " + err.Error()}
		                           ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go:206:30: composites: k8s.io/apiserver/pkg/cel.Error struct literal uses unkeyed fields (govet)
		compilationResult.Error = &apiservercel.Error{apiservercel.ErrorTypeInternal, "cost estimation failed: " + err.Error()}
		                           ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:38:14: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
				Default: structuralschema.JSON{"foo"},
				         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:44:15: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
					Default: structuralschema.JSON{"foo"},
					         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:53:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"A"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:58:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"B"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:63:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"C"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:76:19: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
									Default: structuralschema.JSON{"A"},
									         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:81:19: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
									Default: structuralschema.JSON{"B"},
									         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:91:18: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
								Default: structuralschema.JSON{"N"},
								         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:96:18: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
								Default: structuralschema.JSON{"O"},
								         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:108:21: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
											Default: structuralschema.JSON{"alpha"},
											         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:113:21: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
											Default: structuralschema.JSON{"beta"},
											         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:123:16: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
						Default: structuralschema.JSON{"bar"},
						         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:133:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"A"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:147:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"A"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:159:15: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
					Default: structuralschema.JSON{"A"},
					         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:169:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
						Default:  structuralschema.JSON{"A"},
						          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:179:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
						Default:  structuralschema.JSON{"A"},
						          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:190:18: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default:  structuralschema.JSON{"A"},
							          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/algorithm_test.go:202:18: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default:  structuralschema.JSON{"A"},
							          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/prunenulls_test.go:38:14: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
				Default: structuralschema.JSON{"foo"},
				         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/prunenulls_test.go:47:17: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default: structuralschema.JSON{"A"},
							         ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting/prunenulls_test.go:57:18: composites: k8s.io/apiextensions-apiserver/pkg/apiserver/schema.JSON struct literal uses unkeyed fields (govet)
							Default:  structuralschema.JSON{"C"},
							          ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/defaulting_test.go:289:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/listtype_test.go:140:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go:453:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:214:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:266:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:377:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:418:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:471:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go:556:38: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	fooClient := dynamicClient.Resource(schema.GroupVersionResource{crd.Spec.Group, crd.Spec.Versions[0].Name, crd.Spec.Names.Plural})
	                                    ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/celcoststability_test.go:1096:32: loopclosure: loop variable validRule captured by func literal (govet)
					s := withRule(*tt.schema, validRule)
					                          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/celcoststability_test.go:1107:19: loopclosure: loop variable expectedCost captured by func literal (govet)
					if rtCost != expectedCost {
					             ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/celcoststability_test.go:1108:83: loopclosure: loop variable expectedCost captured by func literal (govet)
						t.Fatalf("runtime cost %d does not match expected runtime cost %d", rtCost, expectedCost)
						                                                                            ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:2009:30: loopclosure: loop variable tt captured by func literal (govet)
			celValidator := validator(tt.schema, true, model.SchemaDeclType(tt.schema, true), PerCallLimit)
			                          ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:2013:65: loopclosure: loop variable tt captured by func literal (govet)
			errs, _ := celValidator.Validate(ctx, field.NewPath("root"), tt.schema, tt.obj, tt.oldObj, math.MaxInt)
			                                                             ^
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go:2015:22: loopclosure: loop variable tt captured by func literal (govet)
			for _, e := range tt.errors {
			                  ^
staging/src/k8s.io/apimachinery/pkg/runtime/mapper_test.go:28:67: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	gvr := func(g, v, r string) schema.GroupVersionResource { return schema.GroupVersionResource{g, v, r} }
	                                                                 ^
staging/src/k8s.io/apimachinery/pkg/runtime/mapper_test.go:30:63: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
	gvk := func(g, v, k string) schema.GroupVersionKind { return schema.GroupVersionKind{g, v, k} }
	                                                             ^
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go:150:35: composites: k8s.io/apimachinery/pkg/runtime.WithoutVersionDecoder struct literal uses unkeyed fields (govet)
		if err := d.DecodeNestedObjects(runtime.WithoutVersionDecoder{c.decoder}); err != nil {
		                                ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher.go:119:18: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
		return false, &apierrors.StatusError{status.Status()}
		               ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/testcase.go:300:17: composites: k8s.io/api/admissionregistration/v1.MutatingWebhook struct literal uses unkeyed fields (govet)
		mutating[i] = registrationv1.MutatingWebhook{h.Name, h.ClientConfig, h.Rules, h.FailurePolicy, h.MatchPolicy, h.NamespaceSelector, h.ObjectSelector, h.SideEffects, h.TimeoutSeconds, h.AdmissionReviewVersions, nil}
		              ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:70:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "", schema.GroupVersionKind{"extensions", "v1beta1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:71:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:72:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1beta1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1beta1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:73:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1alpha1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1alpha1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:75:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "scale", schema.GroupVersionKind{"extensions", "v1beta1", "Scale"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:76:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", schema.GroupVersionKind{"autoscaling", "v1", "Scale"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:77:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1beta1", "deployments"}, "scale", schema.GroupVersionKind{"apps", "v1beta1", "Scale"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:78:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1alpha1", "deployments"}, "scale", schema.GroupVersionKind{"apps", "v1alpha1", "Scale"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:81:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"example.com", "v1", "widgets"}, "", schema.GroupVersionKind{"", "", ""})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:82:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"example.com", "v2", "widgets"}, "", schema.GroupVersionKind{"", "", ""})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:100:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:114:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:116:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"apps", "v1", "Deployment"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:139:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:141:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"apps", "v1", "Deployment"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:159:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:179:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:199:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:201:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"extensions", "v1beta1", "Deployment"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:220:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"apps", "v1", "Deployment"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:222:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"apps", "v1beta1", "Deployment"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:246:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:248:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"autoscaling", "v1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:266:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:286:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:306:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:308:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"extensions", "v1beta1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:327:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:329:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"apps", "v1beta1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:343:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:345:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"autoscaling", "v1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:359:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:375:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:377:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"autoscaling", "v1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:392:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "scale", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:413:61: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:           admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                         ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:415:22: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectMatchKind: &schema.GroupVersionKind{"autoscaling", "v1", "Scale"},
			                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:435:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:450:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:460:59: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{"autoscaling", "v1", "Scale"}, "ns", "name", schema.GroupVersionResource{"apps", "v1", "deployments"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:475:70: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(&example.Pod{}, nil, schema.GroupVersionKind{"example.apiserver.k8s.io", "v1", "Pod"}, "ns", "name", schema.GroupVersionResource{"example.apiserver.k8s.io", "v1", "pods"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:491:70: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(&example.Pod{}, nil, schema.GroupVersionKind{"example.apiserver.k8s.io", "v1", "Pod"}, "ns", "name", schema.GroupVersionResource{"example.apiserver.k8s.io", "v1", "pods"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:507:70: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(&example.Pod{}, nil, schema.GroupVersionKind{"example.apiserver.k8s.io", "v1", "Pod"}, "ns", "name", schema.GroupVersionResource{"example.apiserver.k8s.io", "v1", "pods"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:523:70: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			attrs:         admission.NewAttributesRecord(&example.Pod{}, nil, schema.GroupVersionKind{"example.apiserver.k8s.io", "v1", "Pod"}, "ns", "name", schema.GroupVersionResource{"example.apiserver.k8s.io", "v1", "pods"}, "", admission.Create, &metav1.CreateOptions{}, false, nil),
			                                                                  ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:591:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"extensions", "v1beta1", "deployments"}, "", schema.GroupVersionKind{"extensions", "v1beta1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:592:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:593:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1beta1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1beta1", "Deployment"})
	                       ^
staging/src/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching_test.go:594:25: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionResource struct literal uses unkeyed fields (govet)
	mapper.RegisterKindFor(schema.GroupVersionResource{"apps", "v1alpha1", "deployments"}, "", schema.GroupVersionKind{"apps", "v1alpha1", "Deployment"})
	                       ^
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go:120:19: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
		r.AcquireTime = metav1.Time{spec.AcquireTime.Time}
		                ^
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go:123:17: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
		r.RenewTime = metav1.Time{spec.RenewTime.Time}
		              ^
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go:135:26: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		AcquireTime:          &metav1.MicroTime{ler.AcquireTime.Time},
		                       ^
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go:136:26: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		RenewTime:            &metav1.MicroTime{ler.RenewTime.Time},
		                       ^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go:1088:28: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
			ExpirationTimestamp:   &v1.Time{now.Add(time.Hour)},
			                        ^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go:1100:28: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
			ExpirationTimestamp:   &v1.Time{now.Add(time.Hour)},
			                        ^
staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec_test.go:1110:28: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
			ExpirationTimestamp:   &v1.Time{now.Add(time.Hour)},
			                        ^
staging/src/k8s.io/client-go/tools/events/event_recorder.go:44:15: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
	timestamp := metav1.MicroTime{time.Now()}
	             ^
staging/src/k8s.io/client-go/tools/events/eventseries_test.go:95:24: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		EventTime:           metav1.MicroTime{time.Now()},
		                     ^
staging/src/k8s.io/client-go/tools/events/eventseries_test.go:299:56: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
	cachedEvent := recorder.makeEvent(regarding, related, metav1.MicroTime{time.Now()}, v1.EventTypeNormal, "test", "some verbose message: 1", "eventTest", "eventTest-"+hostname, "started")
	                                                      ^
staging/src/k8s.io/client-go/tools/events/eventseries_test.go:385:57: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		cachedEvent := recorder.makeEvent(regarding, related, metav1.MicroTime{time.Now()}, v1.EventTypeNormal, "test", "some verbose message: 1", "eventTest", "eventTest-"+hostname, "started")
		                                                      ^
staging/src/k8s.io/client-go/tools/leaderelection/leaderelection_test.go:365:26: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		AcquireTime:          &metav1.MicroTime{time.Now()},
		                       ^
staging/src/k8s.io/client-go/tools/leaderelection/leaderelection_test.go:366:26: composites: k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime struct literal uses unkeyed fields (govet)
		RenewTime:            &metav1.MicroTime{time.Now()},
		                       ^
staging/src/k8s.io/client-go/tools/auth/exec/types_test.go:40:53: loopclosure: loop variable cluster captured by func literal (govet)
			testClientAuthenticationClusterTypesAreSynced(t, cluster)
			                                                 ^
staging/src/k8s.io/cli-runtime/pkg/resource/scheme_test.go:44:16: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectGVK: &schema.GroupVersionKind{"", "v1", "Status"},
			            ^
staging/src/k8s.io/cli-runtime/pkg/resource/scheme_test.go:50:16: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectGVK: &schema.GroupVersionKind{"meta.k8s.io", "v1", "Status"},
			            ^
staging/src/k8s.io/cli-runtime/pkg/resource/scheme_test.go:56:16: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectGVK: &schema.GroupVersionKind{"example.com", "v1", "Status"},
			            ^
staging/src/k8s.io/cli-runtime/pkg/resource/scheme_test.go:62:16: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
			expectGVK: &schema.GroupVersionKind{"example.com", "v1", "Foo"},
			            ^
staging/src/k8s.io/cli-runtime/pkg/resource/builder_example_test.go:77:1: tests: ExampleLocalBuilder refers to unknown identifier: LocalBuilder (govet)
func ExampleLocalBuilder() {
^
staging/src/k8s.io/component-base/metrics/desc_test.go:159:26: copylocks: call of reflect.DeepEqual copies lock value: k8s.io/component-base/metrics.Desc contains sync.RWMutex (govet)
			if !reflect.DeepEqual(*descA, *descB) {
			                      ^
staging/src/k8s.io/component-base/logs/json/json_benchmark_test.go:46:6: structtag: struct field secret has json tag but is not exported (govet)
					secret  string `json:"secret"`
					^
staging/src/k8s.io/component-base/logs/json/json_benchmark_test.go:76:6: structtag: struct field secret has json tag but is not exported (govet)
					secret  string `json:"secret"`
					^
staging/src/k8s.io/component-base/logs/json/json_benchmark_test.go:105:6: structtag: struct field secret has json tag but is not exported (govet)
					secret  string `json:"secret"`
					^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume_test.go:31:26: composites: k8s.io/api/core/v1.TopologySelectorTerm struct literal uses unkeyed fields (govet)
	topologySelectorTerm := v1.TopologySelectorTerm{[]v1.TopologySelectorLabelRequirement{
	                        ^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume_test.go:37:40: composites: k8s.io/api/core/v1.TopologySelectorTerm struct literal uses unkeyed fields (govet)
	topologySelectorTermWithBetaLabels := v1.TopologySelectorTerm{[]v1.TopologySelectorLabelRequirement{
	                                      ^
staging/src/k8s.io/csi-translation-lib/plugins/vsphere_volume_test.go:43:34: composites: k8s.io/api/core/v1.TopologySelectorTerm struct literal uses unkeyed fields (govet)
	expectedTopologySelectorTerm := v1.TopologySelectorTerm{[]v1.TopologySelectorLabelRequirement{
	                                ^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:506:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:509:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, encLocalKEK)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:539:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:542:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, lk.encKEK)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:589:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:592:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, encLocalKEK)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:627:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:630:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, lk.encKEK)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:677:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:680:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, encLocalKEK)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:717:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() error = %v", err)
				^
staging/src/k8s.io/kms/pkg/hierarchy/hierarchy_test.go:720:5: testinggoroutine: call to (*T).Fatalf from a non-test goroutine (govet)
				t.Fatalf("Encrypt() annotations = %v, want %v", resp.Annotations, lk.encKEK)
				^
staging/src/k8s.io/kubectl/pkg/cmd/debug/debug_test.go:451:25: composites: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields (govet)
					CreationTimestamp: metav1.Time{time.Now()},
					                   ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:341:5: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			&errors.StatusError{metav1.Status{
			 ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:352:5: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			&errors.StatusError{metav1.Status{
			 ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:364:5: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			&errors.StatusError{metav1.Status{
			 ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:374:5: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			&errors.StatusError{metav1.Status{
			 ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:385:50: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			AddSourceToErr("creating", "configmap.yaml", &errors.StatusError{metav1.Status{
			                                              ^
staging/src/k8s.io/kubectl/pkg/cmd/util/helpers_test.go:395:5: composites: k8s.io/apimachinery/pkg/api/errors.StatusError struct literal uses unkeyed fields (govet)
			&errors.StatusError{metav1.Status{
			 ^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs_test.go:204:15: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
				"needle": schema.GroupVersionKind{"testgroup.k8s.io", "v1", "Kind"},
				          ^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs_test.go:206:6: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
					{"randomgroup.k8s.io", "v1", "OtherKind"},
					^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs_test.go:207:6: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
					{"testgroup.k8s.io", "v1", "OtherKind"},
					^
staging/src/k8s.io/kubectl/pkg/explain/v2/funcs_test.go:208:6: composites: k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind struct literal uses unkeyed fields (govet)
					{"testgroup.k8s.io", "v1", "Kind"},
					^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/history_test.go:95:46: composites: k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference struct literal uses unkeyed fields (govet)
				OwnerReferences: []metav1.OwnerReference{{"apps/v1", "Deployment", deployment.Name, deployment.UID, &trueVar, nil}},
				                                         ^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/history_test.go:222:46: composites: k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference struct literal uses unkeyed fields (govet)
				OwnerReferences: []metav1.OwnerReference{{"apps/v1", "StatefulSet", "moons", "1993", &trueVar, nil}},
				                                         ^
staging/src/k8s.io/kubectl/pkg/polymorphichelpers/history_test.go:326:46: composites: k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference struct literal uses unkeyed fields (govet)
				OwnerReferences: []metav1.OwnerReference{{"apps/v1", "DaemonSet", "moons", "1993", &trueVar, nil}},
				                                         ^
staging/src/k8s.io/kubectl/pkg/util/i18n/i18n_test.go:143:31: loopclosure: loop variable envVar captured by func literal (govet)
					defer func() { os.Setenv(envVar, envVarValue) }()
					                         ^
staging/src/k8s.io/legacy-cloud-providers/aws/aws_assumerole_provider_test.go:95:9: copylocks: range var tt copies lock: struct{name string; fields k8s.io/legacy-cloud-providers/aws.fields; want github.com/aws/aws-sdk-go/aws/credentials.Value; wantProviderCalled bool; sleepBeforeCallingProvider time.Duration; wantErr bool; wantErrString string} contains k8s.io/legacy-cloud-providers/aws.fields contains sync.RWMutex (govet)
	for _, tt := range tests {
	       ^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:190:5: lostcancel: the cancel function is not used on all paths (possible context leak) (govet)
				ctx, cancel := context.WithCancel(context.Background())
				^
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go:236:3: lostcancel: this return statement may be reached without using the cancel var defined on line 190 (govet)
		}()
		^
staging/src/k8s.io/pod-security-admission/policy/registry_test.go:152:35: composites: k8s.io/pod-security-admission/api.LevelVersion struct literal uses unkeyed fields (govet)
		results := registry.EvaluatePod(api.LevelVersion{tc.level, versionOrPanic(tc.version)}, nil, nil)
		                                ^
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer/etcd.go:50:10: composites: k8s.io/sample-apiserver/pkg/registry.REST struct literal uses unkeyed fields (govet)
	return &registry.REST{store}, nil
	        ^
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder/etcd.go:50:10: composites: k8s.io/sample-apiserver/pkg/registry.REST struct literal uses unkeyed fields (govet)
	return &registry.REST{store}, nil
	        ^

Kubernetes-commit: a58eb1b3da870b2b568fcf0ffd42332d6a0fd667
2023-02-28 21:22:40 +01:00
Sean Sullivan
6b8e57ec24 Plumb stale GroupVersions through aggregated discovery
Kubernetes-commit: fed7bb7c51e9f85db122ad6d111cb8326dce9f8a
2023-02-28 19:44:34 +00:00
Kubernetes Publisher
8f4ee7119f Merge pull request #102884 from vinaykul/restart-free-pod-vertical-scaling
In-place Pod Vertical Scaling feature

Kubernetes-commit: b9fd1802ba0aec68508b4e9eec00819008a79370
2023-02-28 09:06:23 +00:00
vinay kulkarni
2932f6b3c1 Restructure naming of resource resize restart policy - generated files
Kubernetes-commit: c5130fb0d6337436c405426468de47ae96717243
2023-02-28 08:13:36 +00:00
DingRui Yang
af12621334 Typo: fix EndpointsLeasesResourceLock ->ConfigMapsLeasesResourceLock
The comment on ConfigMapsLeasesResourceLock begins with the wrong name: EndpointsLeasesResourceLock.

Kubernetes-commit: a50c9db09ba4d22328088887d2fd00b61b36e6c4
2023-02-27 21:09:07 +08:00
Kubernetes Publisher
b46677097d Merge pull request #115393 from seans3/openapi3-root
OpenAPI V3 Root interface and basic implementation

Kubernetes-commit: fb57080e069fe2efe11734a4570a92873e673c35
2023-02-25 01:06:03 +00:00
Kubernetes Publisher
6e69fba05a Merge pull request #114872 from Iceber/fix_acquire_leader
client-go: fix the wait time for trying to acquire the leader lease

Kubernetes-commit: 6e213e7390b60c6db85210f322a213768cefb172
2023-02-24 17:06:01 +00:00
Kubernetes Publisher
ba2fdddad1 Merge pull request #115784 from seans3/openapi-fake-client
Refactor to use openapi fake client

Kubernetes-commit: 5961d8ce1bb4eb6537f7ca3b3eaf7fd9d5cd2595
2023-02-24 05:05:58 +00:00
Sean Sullivan
0bc91705fa Tolerate empty discovery response in memcache client
Kubernetes-commit: a49f13258548c71194e3001ebf5fa219b88155d0
2023-02-22 23:59:37 +00:00
Sean Sullivan
bc1864f6cf Removes old discovery hack ignoring 403 and 404
Kubernetes-commit: 298cb361c85be02d6336437bde37c8a4ccf5583a
2023-02-17 12:47:05 -08:00
Sean Sullivan
0a3ea4f4da Refactor to use openapi fake client
Kubernetes-commit: e352d94e45cdd7f92574ac02e37fc3ab78a34798
2023-02-14 18:00:08 -08:00
Kubernetes Publisher
1ea719588e Merge pull request #115933 from intUnderflow/clean-up-fake-recorder
Clean up FakeRecorder event emission

Kubernetes-commit: b2a40948bdf18e622147a38421f4145b3302ae84
2023-02-22 01:05:51 +00:00
Lucy Sweet
3a78ee0346 Fix typo
Kubernetes-commit: 247299946bb424407590219729c4f16b073f1e4a
2023-02-21 22:05:02 +01:00
Lucy Sweet
1fc8a8a5a7 Clean up FakeRecorder event emission
Kubernetes-commit: 191fe47b6ca537040b22e56776bb97d3d21737e3
2023-02-21 20:35:54 +01:00
Kubernetes Publisher
269abfd8b0 Merge pull request #115860 from intUnderflow/include-annotations-fake-recorder
Allow inclusion of annotations in channel events when using FakeRecorder

Kubernetes-commit: 3a4583aeb6b66452fdfc7958fbc28d744805a63e
2023-02-21 21:05:39 +00:00
Lucy Sweet
c633a8222b Include annotations all the time
Kubernetes-commit: 8373afef0e0886fcd05a4cbf8b0bedeaa82a4d05
2023-02-21 16:42:37 +01:00
Lucy Sweet
f7f367ebae Respond to review
Kubernetes-commit: 7a48c6e2171d23fea76b7a15ab4971989f125b96
2023-02-21 16:29:38 +01:00
Kubernetes Publisher
dda9c5244f Merge pull request #115809 from seans3/openapi-file-client
New openapi v3 testing file client

Kubernetes-commit: 1c97dbc8c9096495706b1e141b0fe256ff3185e9
2023-02-17 21:05:23 +00:00
Kubernetes Publisher
d7a20b15ab Merge pull request #115472 from lanycrost/client-go-110992-GenerateSelfSignedCertKeyWithFixtures-permissions
client-go: make generating certificate/key permissions more restrictive (600)

Kubernetes-commit: 8014155cb5828d7d39905da68c3e2d39b1dab132
2023-02-17 21:05:21 +00:00
Lucy Sweet
a43f324cb9 Allow inclusion of annotations in channel events when using FakeRecorder
Kubernetes-commit: 9839ce96f557413f522230fa3e374e26356ae3d9
2023-02-17 16:38:10 +01:00
Khachatur Ashotyan
bd24c4230e client-go: change permissions of key
Kubernetes-commit: 49af62e64f33317ec0c12f9ed8ab8a0d4f365d44
2023-02-17 14:21:24 +04:00
Khachatur Ashotyan
a7dbbf8255 client-go: change permissions of GenerateSelfSignedCertKeyWithFixtures generated cert
Kubernetes-commit: 3cc99c5e77185ce26fd2d5513336e7229c5f7441
2023-02-17 11:20:39 +04:00
Khachatur Ashotyan
be82893604 client-go: change permissions of directories and certs
Kubernetes-commit: c941877438c2219318b0625f5b4e321efe324171
2023-02-17 11:16:46 +04:00
Kubernetes Publisher
d0008d188f Merge pull request #115620 from odinuge/ou-relist-missing-delete
client-go/cache: fix missing delete event on replace

Kubernetes-commit: 814faade7fa3916478df963cfc6e34042e79ce89
2023-02-17 01:05:14 +00:00
Kubernetes Publisher
df55688a24 Merge pull request #115604 from pacoxu/fix-design-proposals-links
old design proposals are now moved to Design Proposals Archive repo

Kubernetes-commit: ffe410bbb4e43ba7b7ceaec379709575e817d866
2023-02-16 21:05:13 +00:00
Paco Xu
4bd9226d28 API docs: point to current docs instead of archived designs
Kubernetes-commit: 3d536bd14bba0586f20d1d96560073e5d9e82f97
2023-02-16 15:29:56 +08:00
Sean Sullivan
1369f160e9 New openapi v3 testing file client
Kubernetes-commit: 195a55c84c1a0ba9dcc278cc1cccee320334d5e1
2023-02-15 11:37:08 -08:00
Kubernetes Publisher
60f5c9b463 Merge pull request #115786 from liggitt/net-0.7.0-master
Update golang.org/x/net to v0.7.0

Kubernetes-commit: b3d8ac8496a23d65a907f9333d906bcd5463764e
2023-02-15 10:47:27 +00:00
Kubernetes Publisher
249eb86644 Merge pull request #115785 from liggitt/fix-kubectl-test
Revert "Refactor fake versions of openapi client into testing subdir"

Kubernetes-commit: 98406e2a3e88bd6a2affe5674b7a577aa0926d48
2023-02-14 21:26:39 -08:00
Jordan Liggitt
e850f4518c Update golang.org/x/net to v0.7.0
Kubernetes-commit: f8e00778ddca11c08117ccf1d1c410641c70c428
2023-02-14 23:14:30 -05:00
Jordan Liggitt
fb55d97d70 Revert "Refactor fake versions of openapi client into testing subdir"
This reverts commit 869da89eab37ce670759cea2c86325f36625e7fc.

Kubernetes-commit: f98944590058f936c7adb76ea2c974899a460fe2
2023-02-14 22:14:37 -05:00
Kubernetes Publisher
278918a593 Merge pull request #115465 from seans3/openapi-client-testing
Refactor fake versions of openapi client into testing subdir

Kubernetes-commit: 08bbecb8e315fc976e35575e4e33c8a4a0e1cd28
2023-02-15 06:24:06 +00:00
Kubernetes Publisher
8ef4d7d4e8 Merge pull request #115685 from skitt/rest-req-error
client-go: add an Error() function on Request

Kubernetes-commit: 30f15671456283f37c3ed09412299b27cb92bcb4
2023-02-13 14:53:41 -08:00
Odin Ugedal
b2a4f028d6 client-go/cache: update Replace comment to be more clear
Since the behavior is now changed, and the old behavior leaked objects,
this adds a new comment about how Replace works.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 27f4bcae5c52a3bb88141f940ec23d907a15cde5
2023-02-13 11:23:50 +00:00
Odin Ugedal
a01b5a2a96 client-go/cache: rewrite Replace to check queue first
This is useful to both reduce the code complexity, and to ensure clients
get the "newest" version of an object known when its deleted. This is
all best-effort, but for clients it makes more sense giving them the
newest object they observed rather than an old one.

This is especially useful when an object is recreated. eg.

Object A with key K is in the KnownObjects store;
- DELETE delta for A is queued with key K
- CREATE delta for B is queued with key K
- Replace without any object with key K in it.

In this situation its better to create a DELETE delta with
DeletedFinalStateUnknown with B (with this patch), than it is to give
the client an DeletedFinalStateUnknown with A (without this patch).

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 7bcc3e00fc28b2548886d04639a2e352ab37fb55
2023-02-13 11:12:37 +00:00
Odin Ugedal
b250bf51ae client-go/cache: merge ReplaceMakesDeletionsForObjectsInQueue tests
Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: cd3e98b65c1339a8adc157175630de099a057d3f
2023-02-10 14:30:10 +00:00
Odin Ugedal
8279635aa4 client-go/cache: fix missing delete event on replace without knownObjects
This fixes an issue where a relist could result in a DELETED delta
with an object wrapped in a DeletedFinalStateUnknown object; and then on
the next relist, it would wrap that object inside another
DeletedFinalStateUnknown, leaving the user with a "double" layer
of DeletedFinalStateUnknown's.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 0bf0546d9f75d92c801e81c9f7adf040bba64102
2023-02-10 14:16:26 +00:00
Stephen Kitt
22e2a9b6b1 client-go: add an Error() function on Request
Requests can accumulate errors with no obvious indication, e.g. if
their primary purpose is to construct a URL: URL() itself doesn't
return an error if r.err is non-nil.

Instead of changing URL() to return an error, which has quite a large
impact, add an Error() function and indicate on URL() that it should
be checked.

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

Kubernetes-commit: f69c1c47463ff70ad61adf6f38c4d5b7373e9d0a
2023-02-10 14:44:07 +01:00
Kubernetes Publisher
d46293369e Merge pull request #115665 from aramase/aramase/f/update_vendor_k8s_utils
Update k8s.io/utils to `a36077c30491`

Kubernetes-commit: 9a51625ebebcc8345c851afc2b5cc98eb19ac193
2023-02-10 01:08:12 +00:00
Anish Ramasekar
86a4c64374 Update k8s.io/utils to a36077c30491
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 09e02052fdf3d248368b3d05d5c922d616528c4c
2023-02-09 20:09:41 +00:00
Odin Ugedal
2ded6b6eb8 client-go/cache: fix missing delete event on replace
This fixes a race condition when a "short lived" object
is created and the create event is still present on the queue
when a relist replaces the state. Previously that would lead in the
object being leaked.

The way this could happen is roughly;

1. new Object is added O, agent gets CREATED event for it
2. watch is terminated, and the agent runs a new list, L
3. CREATE event for O is still on the queue to be processed.
4. informer replaces the old data in store with L, and O is not in L
  - Since O is not in the store, and not in the list L, no DELETED event
    is queued
5. CREATE event for O is still on the queue to be processed.
6. CREATE event for O is processed
7. O is <leaked>; its present in the cache but not in k8s.

With this patch, on step 4. above it would create a DELETED event
ensuring that the object will be removed.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>

Kubernetes-commit: 25d77218acdac2f793071add9ea878b08c7d328b
2023-02-08 14:57:23 +00:00
Kubernetes Publisher
efd0415f67 Merge pull request #115514 from pohly/event-broadcaster-shutdown
client-go: don't wait too long after EventBroadcaster.Shutdown

Kubernetes-commit: b0171f77f68427813efbb478c0ba89f48322d34a
2023-02-08 13:07:28 +00:00
Paco Xu
878a4f8bbe archived design proposals are now moved to Design Proposals Archive Repo.
Kubernetes-commit: 019d2615af3f7fd0ed0d593ef9df348f6d85b204
2023-02-08 11:12:22 +08:00
Kubernetes Publisher
00b9d76f44 Merge pull request #115315 from enj/enj/i/kas_kubelet_conn_close
kubelet/client: collapse transport wiring onto standard approach

Kubernetes-commit: 22b88dea360b0aae4ecaa57142718386b3cbd40d
2023-02-07 17:07:30 +00:00
Kubernetes Publisher
9c5046523c Merge pull request #115379 from artemvmin/serial-mkfs
Add an option to limit the number of concurrent mkfs calls

Kubernetes-commit: 6eb008620cd0ee3501326ee003d47fbaf1fa5b52
2023-02-07 05:07:29 +00:00
Kubernetes Publisher
2e3265cc1d Merge pull request #108396 from tkashem/retry-metric
client-go: add a metric to count request retries

Kubernetes-commit: 2ab3151936f1df6b3ffb4d49bf9dc90218264545
2023-02-07 05:07:26 +00:00
Iceber Gu
899a109017 leaderelection: using le.clock for the time calculations
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>

Kubernetes-commit: 9c31f14a7cfea7cc793a9a3f98bdd117cb438316
2023-02-07 13:00:55 +08:00
Monis Khan
d8b14dc089 kubelet/client: collapse transport wiring onto standard approach
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 754cb3d601a820180d19567c3600a789d77b0f07
2023-02-05 20:51:54 -05:00
vinay kulkarni
85d57cfad9 Generated files and compat data from API changes
Kubernetes-commit: 3c70be1a1231e11c45698e209b01e91b92f8c5d2
2023-02-05 04:44:45 +00:00
Artem Minyaylov
13c89f7a54 Update k8s.io/utils to latest version
Update all usages of FakeExec to pointer to avoid copying the mutex

Kubernetes-commit: f573e149423dc578284789fdff8eeb3c195b5ccf
2023-02-03 14:51:25 -08:00
Patrick Ohly
f6a5a1f139 client-go: don't wait too long after EventBroadcaster.Shutdown
When Shutdown was called, delivery of each pending event would still be retried
12 times with a delay of ~10s between each retry. In apiserver integration
tests that caused the goroutine to linger long after the corresponding
apiserver of the test was shut down.

Kubernetes-commit: 15b01af9c18a0840d71e2bb7dff4d8c29b158aad
2023-02-03 14:52:20 +01:00
Khachatur Ashotyan
71253f0b35 fix: comment about permission bits
Kubernetes-commit: fd17dcf3876458229ac15d426eb1bd58f8c52cb4
2023-02-03 13:40:33 +04:00
Khachatur Ashotyan
03568a1821 client-go: make generating certificate/key permissions more secure (600)
Kubernetes-commit: 5f81c3005f6d3aeb652a0626c3632ff68b036577
2023-02-02 14:52:45 +04:00
Sean Sullivan
bb1833cfed Refactor fake versions of openapi client into testing subdir
Kubernetes-commit: 869da89eab37ce670759cea2c86325f36625e7fc
2023-02-01 18:39:18 -08:00
Sean Sullivan
6eb57690dc OpenAPI V3 Root interface and basic implementation
Kubernetes-commit: 5b482476b1bb458b8206c122be045ced759550f2
2023-01-29 23:28:35 -08:00
Patrick Ohly
6a9f0eb8ac dependencies: update klog v2.90.1
This improves performance of the text formatting and ktesting.

Because ktesting no longer buffers messages by default, one unit
test needs to ask for that explicitly.

Kubernetes-commit: 961819a4d09488e20931103e0c36d2bed588fdcb
2023-01-23 18:19:54 +01:00
Iceber Gu
b4217e149b client-go: fix the wait time for trying to acquire the leader lease
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>

Kubernetes-commit: 9d80516abb4244ac1df4ceb84a32d3204fe5b308
2023-01-10 13:09:07 +08:00
Antoine Pelisse
e2867f9cdc Update kubernetes code for minor API changes to kube-openapi
Kubernetes-commit: 88ec8fba32f0ef7b768ec528cfbe44046877ea34
2022-12-29 12:12:33 -08:00
Antoine Pelisse
3d77c7c648 Update kube-openapi to 15aac26d736a
Kubernetes-commit: 9bbdb9f130516a14a73914d0b41396ddb72a88ea
2023-03-07 16:14:54 -08:00
Jefftree
eec00dc791 remove mime AddExtensionType in discovery test
Kubernetes-commit: 50c6b6c86a50d0196af4bc659948d8dfd2147308
2022-12-05 17:30:08 +00:00
austin ce
9668243c04 Integrate new metrics provider option in test case
Kubernetes-commit: 9e83e7e975dd5971e60e9768e06520aa5ebf9bf8
2022-12-02 14:08:11 -05:00
austin ce
e0785d6713 Remove options from queue ctors w/o metrics
Kubernetes-commit: 31f16db1959bb1db02fcc578f4aa7d47414a26f4
2022-12-02 14:06:37 -05:00
austin ce
89a4c1271f Add license header to new file
Kubernetes-commit: 95ad089ff8164d455f766694b1292ca8f1d200df
2022-12-01 18:28:02 -05:00
austin ce
98d0d1a9ba Allow setting per-queue metrics providers
Kubernetes-commit: da71811514ac6e8fedd265831fed71f897b97781
2022-11-29 20:47:33 -05:00
Timo Reimann
0536a4e40c Add tests
Kubernetes-commit: fc8b4657c18a6e58b2587060ad3c862d3d2ae262
2022-10-22 00:47:04 +02:00
Damien Grisonnet
9c7c60b695 events: fix EventSeries starting count discrepancy
The kube-apiserver validation expects the Count of an EventSeries to be
at least 2, otherwise it rejects the Event. There was is discrepancy
between the client and the server since the client was iniatizing an
EventSeries to a count of 1.

According to the original KEP, the first event emitted should have an
EventSeries set to nil and the second isomorphic event should have an
EventSeries with a count of 2. Thus, we should matcht the behavior
define by the KEP and update the client.

Also, as an effort to make the old clients compatible with the servers,
we should allow Events with an EventSeries count of 1 to prevent any
unexpected rejections.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: d00364902bda05eed4f7f02051ab81f7be55f8a9
2022-09-08 23:50:41 +02:00
Claudiu Belu
79c893df5a Replaces path.Operation with filepath.Operation (staging)
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.

Kubernetes-commit: 856bb5c8f266f5276f1a576f47be622d7cb384e7
2022-06-15 15:17:24 +03:00
Patrick Ohly
9445f86b9d Generate go.work files
This creates go.work and enables Go Workspaces.  This is a file that
includes info on k/k and all the staging modules.

This depends on go 1.22 and setting FORCE_HOST_GO=true (for kube
scripts, which try to be hermetic).

Make this part of the normal update/verify sequence.

The top-level go.work file contains no replace statements. Instead, the
replace statements in the individual go.mod files are used. For this to
work, replace statements in the individual go.mod files have to be
consistent.

hack/tools has different dependencies and can't be in the main
workspace, so this adds a go.work just for that.  Without this, go tries
to consider all deps in all modules and pick one that works for all.
This is problematic because there are so many of them that it is
difficult to manage.

Likewise for k8s.io/code-generator/examples and
k8s.io/kms/internal/plugins/_mock - add trivial go.work files.

For example k/k depends on an older version of a lib that gloangci-lint
needs (transitively) and it breaks.

This also updates vendor (needed to make go happy), and removes
vendor'ed symlinks.  This breaks a LOT of our build tools, which will be
fixed subsequently.

Result: `go` commands work across modules:

Before:
```
$ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/
main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api/core/v1

$ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api

$ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api
```

After:
```
$ go list ./pkg/proxy/iptables/ ./staging/src/k8s.io/api/core/v1/
k8s.io/kubernetes/pkg/proxy/iptables
k8s.io/api/core/v1

$ go build ./pkg/proxy/iptables/ ./staging/src/k8s.io/api

$ go test ./pkg/proxy/iptables/ ./staging/src/k8s.io/api
ok  	k8s.io/kubernetes/pkg/proxy/iptables	0.360s
ok  	k8s.io/api	2.302s
```

Result: `make` fails:

```
$ make
go version go1.22rc1 linux/amd64
+++ [0106 12:11:03] Building go targets for linux/amd64
    k8s.io/kubernetes/cmd/kube-proxy (static)
    k8s.io/kubernetes/cmd/kube-apiserver (static)
    k8s.io/kubernetes/cmd/kube-controller-manager (static)
    k8s.io/kubernetes/cmd/kubelet (non-static)
    k8s.io/kubernetes/cmd/kubeadm (static)
    k8s.io/kubernetes/cmd/kube-scheduler (static)
    k8s.io/component-base/logs/kube-log-runner (static)
    k8s.io/kube-aggregator (static)
    k8s.io/apiextensions-apiserver (static)
    k8s.io/kubernetes/cluster/gce/gci/mounter (static)
    k8s.io/kubernetes/cmd/kubectl (static)
    k8s.io/kubernetes/cmd/kubectl-convert (static)
    github.com/onsi/ginkgo/v2/ginkgo (non-static)
    k8s.io/kubernetes/test/e2e/e2e.test (test)
    k8s.io/kubernetes/test/conformance/image/go-runner (non-static)
    k8s.io/kubernetes/cmd/kubemark (static)
    github.com/onsi/ginkgo/v2/ginkgo (non-static)
    k8s.io/kubernetes/test/e2e_node/e2e_node.test (test)
test/e2e/e2e.go:35:2: cannot find package "k8s.io/api/apps/v1" in any of:
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/api/apps/v1 (vendor tree)
	/home/thockin/src/kubernetes/_output/local/.gimme/versions/go1.22rc1.linux.amd64/src/k8s.io/api/apps/v1 (from $GOROOT)
	/home/thockin/src/kubernetes/_output/local/go/src/k8s.io/api/apps/v1 (from $GOPATH)
	... more ...
	... more ...
	... more ...
!!! [0106 12:13:41] Call tree:
!!! [0106 12:13:41]  1: /home/thockin/src/kubernetes/hack/lib/golang.sh:948 kube::golang::build_binaries_for_platform(...)
!!! [0106 12:13:41]  2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0106 12:13:41] Call tree:
!!! [0106 12:13:41]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0106 12:13:41] Call tree:
!!! [0106 12:13:41]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:96: all] Error 1
```

Again, this requires go 1.22 (e.g. gotip), as go 1.21.x does not have
`go work vendor` support.

TO REPEAT:
    ( \
      ./hack/update-go-workspace.sh; \
      ./hack/update-vendor.sh; \
      ./hack/update-go-workspace.sh; \
    )

Kubernetes-commit: 65b841c077e0d3282d28b9199aec72d23d045104
2022-06-08 12:12:42 +02:00
Abu Kashem
d2388d199c client-go: add metric to count retries
Kubernetes-commit: b6c369f5c90bbef8058b3d44949f4e815dd6607f
2022-02-28 12:22:09 -05:00
Kubernetes Publisher
f457a57d6d Merge pull request #112072 from tkashem/retry-concurrency-test
client-go: add unit test for Request thread safety

Kubernetes-commit: 87759c73eb7d7804c8b5116becbce3f1066678bd
2023-01-31 01:46:49 -08:00
Abu Kashem
67f1485c1d client-go: add unit test for Request thread safety
Kubernetes-commit: ca492a9b62a586caf3e3cd22bc020108a63fb395
2022-08-26 13:24:36 -04:00
Kubernetes Publisher
b1350830d0 Merge pull request #115266 from pohly/gomega-update
dependencies: update gomega to v1.26.0

Kubernetes-commit: 6d17cb2051b3a9958ed3353df242312d85e75d43
2023-01-30 21:07:00 +00:00
Kubernetes Publisher
d7d6bcf014 Merge pull request #115354 from pohly/dra-reserved-for-list-type
dynamic resource allocation: avoid apiserver complaint about list content

Kubernetes-commit: c829397f7a1fa956766f6479a8ca454b6937feda
2023-01-30 17:06:56 +00:00
Kubernetes Publisher
648d82831a Merge pull request #110253 from tkashem/retry-condition-test
client-go: add a test to document retry conditions

Kubernetes-commit: 3bf42a7aec041f4e50e7b4ce3b3cfe04de0af859
2023-01-27 09:14:48 +00:00
Patrick Ohly
fa4e59aaee dynamic resource allocation: avoid apiserver complaint about list content
This fixes the following warning (error?) in the apiserver:

E0126 18:10:38.665239   16370 fieldmanager.go:210] "[SHOULD NOT HAPPEN] failed to update managedFields" err="failed to convert new object (test/claim-84; resource.k8s.io/v1alpha1, Kind=ResourceClaim) to smd typed: .status.reservedFor: element 0: associative list without keys has an element that's a map type" VersionKind="/, Kind=" namespace="test" name="claim-84"

The root cause is the same as in e50e8a0c919c0e02dc9a0ffaebb685d5348027b4:
nothing in Kubernetes outright complains about a list of items where the item
type is comparable in Go, but not a simple type. This nonetheless isn't
supposed to be done in the API and can causes problems elsewhere.

For the ReservedFor field, everything seems to work okay except for the
warning. However, it's better to follow conventions and use a map. This is
possible in this case because UID is guaranteed to be a unique key.

Validation is now stricter than before, which is a good thing: previously,
two entries with the same UID were allowed as long as some other field was
different, which wasn't a situation that should have been allowed.

Kubernetes-commit: 508cd60760567b3832da748140e3cf782c1b8695
2023-01-26 20:37:00 +01:00
Patrick Ohly
55c90d535e dependencies: update gomega to v1.26.0
If gomega.Eventually/Consistently run into a situation where it observes some
state of e.g. a pod which does not satisfy the condition and then further
polling fails with API server errors, gomega will report both the most recent
pod state and API error instead of just the API error.

Kubernetes-commit: aa1279b5eb79177f5351368d8d9159982b1bfb5e
2023-01-23 15:19:38 +01:00
Abu Kashem
79c4b4060a client-go: add test to document retry conditions
Kubernetes-commit: 68c542d52246b0b750e332616884350164018695
2022-05-27 09:13:30 -04:00
Kubernetes Publisher
adb1f506f9 Merge pull request #114550 from alexzielenski/apiserver/smd/update-kube-openapi
update kube-openapi dependency

Kubernetes-commit: df03edaf755f71a61f4f817ca374ebe3b6416270
2023-01-25 05:06:36 +00:00
Alexander Zielenski
1c9d8a00ef update kube-openapi
Kubernetes-commit: 7641ff75412c1d8b547c4fa388d3901aeeda6948
2023-01-23 15:32:33 -08:00
Kubernetes Publisher
cbb60162c0 Merge pull request #111652 from ash2k/ash2k/leader-elector-tweaks
Always emit the stopped leading event

Kubernetes-commit: f21c60341740874703ce12e070eda6cdddfd9f7b
2023-01-23 13:06:19 +00:00
Mikhail Mazurskiy
ac40ba3297 Always emit the stopped leading event
Kubernetes-commit: 771ab7488d53f0d6c85238992a8e5f4bcb73e24e
2022-10-12 20:53:05 +11:00
Kubernetes Publisher
84ad8a7920 Merge pull request #113540 from wongearl/cleanup-client-go
diff.ObjectReflectDiff is DEPRECATED use cmp.Diff

Kubernetes-commit: 60d73ba75148483d150622a4d8b6e122e189ceab
2023-01-19 21:09:35 +00:00
Kubernetes Publisher
7059973891 Merge pull request #115186 from thockin/codegen-2-rm-deprecated-clients
Remove deprecated and orphaned generated code

Kubernetes-commit: 2fba771792023756b539501cdabdb19a32bb9536
2023-01-19 21:09:34 +00:00
Kubernetes Publisher
31586e6042 Merge pull request #115184 from thockin/codegen-1-clientset-doc-go
Don't generate clientset/doc.go in client-gen

Kubernetes-commit: c2d18a6d14974b123d09c4ce40ea0dd79184787d
2023-01-19 04:13:56 +00:00
Kubernetes Publisher
c33df1cccb Merge pull request #113637 from mikedanese/http-proxy
switch spdy round trip tests to simple http proxy

Kubernetes-commit: 0acf6dbf7c094b71291b9fd7f78d5385565aa97c
2023-01-19 00:27:41 +00:00
Tim Hockin
7c57428f98 Remove obsolete generated listers
These are not regenerated by any input.  The OWNERS files were the last
things left for these 2 directories

Kubernetes-commit: dc88f34ce30eb98285f7f30e391b135e842cdbc2
2023-01-14 17:54:12 -08:00
Tim Hockin
0f17f43973 Remove obsolete generated applyconfigs
These are not regenerated by any input.

Kubernetes-commit: 37ca6b0fac3c118c9cb0619a07a2fe40e567f6d1
2023-01-14 17:20:06 -08:00
Tim Hockin
1d637ff29e Don't generate clientset/doc.go in client-gen
It seems valuable to be able to provide hand-written docs for these
first-level directories, and if don't want them, the generated doc.go
files are not actually very helpful.

This commit also adds new doc.go files for client-go listers/ and
informers/.

Kubernetes-commit: 95bf7b0afe9dd6a0f00125b1d290514a23e778e2
2023-01-12 09:51:33 -08:00
Tim Hockin
b94c7fc493 Fix client-go doc.go - not generated
As per liggitt, lavalamp, and jpbetz

Kubernetes-commit: f95a840c12ef24615d1069b98dca8a061c710cbb
2023-01-04 15:04:06 -08:00
Mike Danese
9edd019f97 vendor: removed unused dep github.com/elazarl/goproxy
Kubernetes-commit: f61c4245c18724dcac88f0ad9f347e82bbb57cd7
2022-11-04 22:14:46 +00:00
Kubernetes Publisher
e6998df99e Merge pull request #115093 from xuzhenglun/too-large-resource-version-1.16
Fix bug in reflector not detecting "Too large resource version" error before 1.17.0

Kubernetes-commit: d3f881f7508ec3bd8aa83712038bdcf5f4703396
2023-01-18 11:59:00 +00:00
Kubernetes Publisher
a13376f3fa Merge pull request #114542 from pacoxu/EphemeralContainers
cleanup: EphemeralContainers feature gate related codes

Kubernetes-commit: c913e6ce62d23b19eebec9beda91d7599bf5099b
2023-01-17 20:14:45 +00:00
xuzhenglun
7685b51912 Fix bug in reflector not detecting "Too large resource version" error before 1.17.0
Kubernetes-commit: 11e5e92dc65c1caaeb248a60d90ccc8e29eb9ff0
2023-01-16 11:36:28 +08:00
Kubernetes Publisher
228b004f4a Merge pull request #115077 from smarterclayton/reflector_mock_clock
cache: Reflector should have the same injected clock as its informer

Kubernetes-commit: 4c4d4ad0a4aea4d015561ae3e7d48e8aaf609277
2023-01-15 17:24:49 -08:00
Clayton Coleman
08e22c4b64 cache: Reflector should have the same injected clock as its informer
While refactoring the backoff manager to simplify and unify the code
in wait a race condition was encountered in
TestSharedInformerWatchDisruption. The new implementation failed
because the fake clock was not propagated to the backoff managers
when the reflector was used in a controller. After ensuring the
mangaers, reflector, controller, and informer shared the same
clock the test needed was updated to avoid the race condition by
advancing the fake clock and adding real sleeps to wait for
asynchronous propagation of the various goroutines in the controller.

Due to the deep structure of informers it is difficult to inject
hooks to avoid having to perform sleeps. At a minimum the FakeClock
interface should allow a caller to determine the number of waiting
timers (to avoid the first sleep).

Kubernetes-commit: 91b3a81fbd916713afe215f7d701950e13a02869
2023-01-14 14:17:33 -05:00
Kubernetes Publisher
241dfe3630 Merge pull request #114794 from lavalamp/improved-has-synced
Do not N^2 loading webhook configurations

Kubernetes-commit: cc9cc4d3eaec45206f353216a1c3ff6edaf07d30
2023-01-12 16:03:24 -08:00
Daniel Smith
cb28a0e57e Fix N^2 startup for webhook configurations
Add a "lazy" type to track when an update is needed. It uses a nested
locking technique to avoid extra evaluation calls.

Kubernetes-commit: 5a1091d88d95bd1dd5c27f2c72cee4ecb4219dda
2023-01-09 23:29:25 +00:00
Kubernetes Publisher
895a515b59 Merge pull request #114766 from MadhavJivrajani/prepare-for-go1.20
[Prepare for go1.20] *: Bump versions and fix tests

Kubernetes-commit: 4802d7bb62c2623be8e4f940f6b5c1fcddd6c744
2023-01-12 18:42:58 +00:00
Madhav Jivrajani
47c0033395 *: Bump version of vmware/govmomi
Bumping version to include changes that
better handle TLS errors. Bump nescessary
to prepare for when the version of Go is
bumped to 1.20

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 8b064fa4be71b5f1b498fabb5caade3c57f5d434
2023-01-02 20:56:02 +05:30
Kubernetes Publisher
ce349e1afa Merge pull request #114879 from olivierlemasle/bump-kube-openapi
Bump kube-openapi

Kubernetes-commit: 8fdaac238e4f7f560066ea3a324cdbcaae564ac9
2023-01-12 02:09:56 +00:00
Kubernetes Publisher
6500345693 Merge pull request #113467 from pacoxu/psp-cleanup
Remove PodSecurityPolicy related code except client-go & API type

Kubernetes-commit: 08d9a0ef5b3b30952a558786e4b6e360701a16c6
2023-01-12 02:09:49 +00:00
Kubernetes Publisher
674e53a7cb Merge pull request #112365 from dgrisonnet/consolidate-isomorphic-events
Update isomorphic event definition in the events/v1 client to match aggregation logic from core/v1

Kubernetes-commit: f56c79398e3c58b4f5a9c7e6a1f4d64248ef1b83
2023-01-11 09:22:09 +00:00
Kubernetes Publisher
2c828f0e97 Merge pull request #114859 from pohly/e2e-ginkgo-spec-ordering
dependencies: update ginkgo to v2.7.0

Kubernetes-commit: a11ad04564f05e5d7e2d5a3f421ec5a45b6807c5
2023-01-11 01:23:10 +00:00
Olivier Lemasle
640dd29fa4 Bump kube-openapi
Kubernetes-commit: 8b8e20fcdbbeeb4520995e4f7c6a003a33062dd2
2023-01-09 20:41:41 +01:00
Patrick Ohly
e96d4a06a4 dependencies: update ginkgo to v2.7.0
The new ginkgo release adds sorting of specs. This was triggered by
the observation that parallel test execution of Kubernetes E2E tests
sometimes ran the same spec twice and (presumably) other specs not at all
because spec order was random due to iteration over a map.

Sorting should avoid that problem.

Kubernetes-commit: baf832d80d798d53ceb7d4de3a39330c6eda5c6a
2023-01-05 21:19:14 +01:00
Kubernetes Publisher
fda1b1132e Merge pull request #114869 from liggitt/kube-openapi
bump kube-openapi

Kubernetes-commit: 0e49c542d7a73dd056f8f32f33939207dd009b14
2023-01-07 07:51:03 +00:00
Jordan Liggitt
61a4d65439 bump kube-openapi
Kubernetes-commit: d78de56d769ee9bd2193ccadbac5621d4a0ae89d
2023-01-06 12:21:58 -05:00
Kubernetes Publisher
bd7ed9e647 Merge pull request #114460 from brianpursley/pf-exit
portforward: return error on lost connection to pod

Kubernetes-commit: 61cdb86814489624dd5a169526797e186a118e66
2023-01-07 07:51:00 +00:00
Kubernetes Publisher
5ea7f43b5d Merge pull request #113654 from stevekuznetsov/skuznets/fake-group-name-registration
code-generator: refer to the API package for GV{R,K}

Kubernetes-commit: c97dbd1afb815731cbebf9cb0d888a29c39e2b76
2023-01-07 07:50:58 +00:00
Kubernetes Publisher
dc46266e11 Merge pull request #114829 from liggitt/oauth-revert
Revert "bump golang.org/x/oauth2"

Kubernetes-commit: 293bf70916de8ef61d5f868f53959f1e15b3e091
2023-01-07 07:50:56 +00:00
Kubernetes Publisher
37a1df5cba Merge pull request #111660 from pacoxu/key-encipherment-v1.26
Key encipherment usage  v1.27

Kubernetes-commit: 492637878f0b26fa126f2025af2ee5c1f1fd5867
2023-01-07 07:50:51 +00:00
Kubernetes Publisher
26d70e3a1c Merge pull request #114822 from liggitt/oauth2
bump golang.org/x/oauth2

Kubernetes-commit: 4e785dc7e3ac1d01cedd23a0ed9c4a67dc9c214f
2023-01-07 07:50:50 +00:00
Jordan Liggitt
338dcc21ed Revert "bump golang.org/x/oauth2"
This reverts commit fc9a140badf29382c1396b7de4813849d6f3e3c9.

Kubernetes-commit: 9f07c8e346fef454942d205f2702885475c7fc9a
2023-01-04 17:58:08 -05:00
Jordan Liggitt
4dad476f03 bump golang.org/x/oauth2
Kubernetes-commit: fc9a140badf29382c1396b7de4813849d6f3e3c9
2023-01-04 11:16:43 -05:00
Kubernetes Publisher
3e0d990533 Merge pull request #114236 from dgrisonnet/fix-eventseries-race
Fix data race when emitting similar Events consecutively

Kubernetes-commit: ca858e0c961db6ef8b22ecc3e257a02757261ea1
2023-01-02 17:28:37 +00:00
Kubernetes Publisher
7e3470802f Merge pull request #114237 from dgrisonnet/handle-series-error
Retry when recording an EventSerie results in an AlreadyExist error

Kubernetes-commit: 2b6c8420a245583d5055e9b4b8ed2b648c42529d
2023-01-02 17:28:33 +00:00
Brian Pursley
b0a6a6f777 portforward: Add unit test to cover stopChan usage
Kubernetes-commit: 6f08ab013c6ce54de239aab46b4086c09464f977
2022-12-23 10:11:21 -05:00
Kubernetes Publisher
b69cda3e4e Merge pull request #113538 from pohly/e2e-ginkgo-timeline
e2e: ginkgo timeline

Kubernetes-commit: 020fb2eb776c0affad3a9ff7dd21ba231e6c646d
2022-12-23 02:39:06 +00:00
Kubernetes Publisher
32f9a1505d Merge pull request #114585 from JoelSpeed/fix-resource-requirements-claims
Resource Claims must be a map type, not set

Kubernetes-commit: 5882479457ac2554f70fc4678aa86eca8c49ae8b
2022-12-23 02:39:04 +00:00
Kubernetes Publisher
bc218e478a Merge pull request #114578 from ardaguclu/wrap-ctx-error-until
Embed context deadline exceeded in error to let errors.Is can work

Kubernetes-commit: b704b96565249fe451d9d023f7f743efc1cc90fe
2022-12-23 02:39:02 +00:00
Kubernetes Publisher
19c9966172 Merge pull request #114291 from MaxHorstmann/master
#79612 fix(client-go): return error in fake discovery

Kubernetes-commit: 0783cf49e853e56f2f5e1708519c09fa83f0349f
2022-12-23 02:38:59 +00:00
Joel Speed
984a230dff Resource claims should be a map type
Kubernetes-commit: e50e8a0c919c0e02dc9a0ffaebb685d5348027b4
2022-12-19 16:02:02 +00:00
Arda Güçlü
21fffc1153 Embed context deadline exceeded in error to let errors.Is can work
Currently, watch package embeds context deadlineexceeded error
in it's own error using `%v`, as can be seen in here;

`fmt.Errorf("UntilWithSync: unable to sync caches: %v", ctx.Err())`

However, consumers of this function can not use
`errors.Is(err, context.DeadlineExceeded)` due this `%v`.

To let consumers can distinguish context deadlineexceeded errors,
this PR changes error embedding format to `%w`.

Kubernetes-commit: 6b7c365f8f6d50280c2dab171efdd4b93d964f32
2022-12-19 15:26:08 +03:00
Kubernetes Publisher
089645a7c5 Merge pull request #114559 from liggitt/gofmt
Fix indentation/spacing in comments to render correctly in godoc

Kubernetes-commit: 76522eb1a339a95544523c1ed85da09f287f1ade
2022-12-19 01:08:52 +00:00
Jordan Liggitt
422fe1f61e Fix indentation/spacing in comments to render correctly in godoc
Kubernetes-commit: 78cb3862f11225135afdf76f3424e2d7b33104c7
2022-12-17 17:31:05 -05:00
Paco Xu
20ca706950 cleanup: EphemeralContainers feature gate related codes
Kubernetes-commit: 70e56fa71af5aa4f3d1448fcbc26e86309cd0cf3
2022-12-16 23:46:47 +08:00
Kubernetes Publisher
97591331ce Merge pull request #113985 from lavalamp/improved-has-synced
Propagate HasSynced properly

Kubernetes-commit: 843b40aeb421347ae00f206ea879bc1e1ae2912d
2022-12-15 21:18:24 +00:00
Max Horstmann
24248303bf client-go: properly return error in fake discovery (#79612)
Fake discovery should return an error if an error-returning reactor was prepended.

This is relevant e.g. for unit tests which test a function which relies
on discovery to check if an API Server is available.

Matches existing behavior of other fake types, for example fake_namespace.

Adds unit test coverage as well.

Kubernetes-commit: b47748103a53c0fe5ba1ddc950662ffc9bd9ed0f
2022-12-14 11:41:10 -05:00
Brian Pursley
d0842249d3 portforward: return error on lost connection to pod
Currently, when the remote connection is unexpected closed, forward() prints an error message saying "lost connection to pod" via runtime.HandleError, but then it returns nil for the error.

This prevents the caller from being able to handle this error differently.

This commit changes forward() to return the "lost connection to pod" error so that it can be handled by the caller.

Making this change enables kubectl port-forward to exit with code 1, instead of 0, which is the expected behavior for a command that has failed.

Kubernetes-commit: a9f04103854893056237a09250ad3335867b0391
2022-12-13 13:32:42 -05:00
Damien Grisonnet
e3ded99476 tools/events: retry on AlreadyExist for Series
When attempting to record a new Event and a new Serie on the apiserver
at the same time, the patch of the Serie might happen before the Event
is actually created. In that case, we handle the error and try to create
the Event. But the Event might be created during that period of time and
it is treated as an error today. So in order to handle that scenario, we
need to retry when a Create call for a Serie results in an AlreadyExist
error.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 2f83117bcfe30ad3ada7f1ca66f4b885a1d5df25
2022-12-01 15:40:01 +01:00
Damien Grisonnet
4b578e1242 tools/events: fix data race when emitting series
There was a data race in the recordToSink function that caused changes
to the events cache to be overriden if events were emitted
simultaneously via Eventf calls.

The race lies in the fact that when recording an Event, there might be
multiple calls updating the cache simultaneously. The lock period is
optimized so that after updating the cache with the new Event, the lock
is unlocked until the Event is recorded on the apiserver side and then
the cache is locked again to be updated with the new value returned by
the apiserver.

The are a few problem with the approach:

1. If two identical Events are emitted successively the changes of the
   second Event will override the first one. In code the following
   happen:
   1. Eventf(ev1)
   2. Eventf(ev2)
   3. Lock cache
   4. Set cache[getKey(ev1)] = &ev1
   5. Unlock cache
   6. Lock cache
   7. Update cache[getKey(ev2)] = &ev1 + Series{Count: 1}
   8. Unlock cache
   9. Start attempting to record the first event &ev1 on the apiserver side.

   This can be mitigated by recording a copy of the Event stored in
   cache instead of reusing the pointer from the cache.

2. When the Event has been recorded on the apiserver the cache is
   updated again with the value of the Event returned by the server.
   This update will override any changes made to the cache entry when
   attempting to record the new Event since the cache was unlocked at
   that time. This might lead to some inconsistencies when dealing with
   EventSeries since the count may be overriden or the client might even
   try to record the first isomorphic Event multiple time.

   This could be mitigated with a lock that has a larger scope, but we
   shouldn't want to reflect Event returned by the apiserver in the
   cache in the first place since mutation could mess with the
   aggregation by either allowing users to manipulate values to update
   a different cache entry or even having two cache entries for the same
   Events.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 55ec09d377274b4a6107fe0b7a061ad408fe05a7
2022-12-01 15:39:34 +01:00
Daniel Smith
5d70a118df Enable propagration of HasSynced
* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function

Kubernetes-commit: 8100efc7b3122ad119ee8fa4bbbedef3b90f2e0d
2022-11-18 00:12:50 +00:00
Kubernetes Publisher
e7e7d01afd Merge pull request #110991 from thockin/svc-typenames-starTrafficPolicyType
Svc typenames star traffic policy type

Kubernetes-commit: 923ee203f362aa947a7b0c9b1357488e0a244ea7
2022-12-13 04:24:09 +00:00
Steve Kuznetsov
9bcbb56a27 code-generator: refer to the API package for GV{R,K}
There should only be one source of truth for the API group's name and
version.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: e13198ec6f52c4a6405388e90053954dc7656a31
2022-11-06 07:05:42 -07:00
Paco Xu
be1f5d4ebb client-go: remove extensions psp only
Kubernetes-commit: e41b1bff5853c616f7872ccf36fbefa480f72892
2022-11-03 10:12:16 +08:00
wongearl
5d95f80033 diff.ObjectReflectDiff is DEPRECATED use cmp.Diff
Kubernetes-commit: 6da08775f9fc8d70f867435f55cf712d3a6ef056
2022-11-02 17:40:19 +08:00
Patrick Ohly
beb71aae41 dependencies: update to ginkgo v2.6.1, gomega v1.24.2
Ginkgo v2.5.0 adds support for a "timeline": a full description of what happened
while a specific test ran, including failures, timeouts, and log output.

Ginkgo v2.6.0 adds ReportBeforeSuite which we need for
https://github.com/kubernetes/kubernetes/issues/114313.

Kubernetes-commit: f3ef4004317c1a12d84021be29dd5f92badc8eff
2022-11-02 09:07:12 +01:00
Damien Grisonnet
1113415196 event_broadcaster: update isomorphic event def
Update the definition of an isomorphic event in the events/v1 client to
match the aggregation logic that was already present in the core/v1
implementation.

The note field was omitted even though the message was used in the core
API aggregation because we didn't reach consensus.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 21f2f746abc1a5a1b3193274401f5728e19cc26f
2022-09-09 19:16:40 +02:00
Paco Xu
6a07cedcd3 kubelet: add key encipherment usage only if it is rsa key
remove allowOmittingUsageKeyEncipherment as it is always true

Signed-off-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 160f015ef4affe903f98e74cf42b40fceef15cb9
2022-08-03 16:41:09 +08:00
Tim Hockin
31e7d402a3 ServiceInternalTrafficPolicyType: s/Type//
Rename ServiceInternalTrafficPolicyType => ServiceInternalTrafficPolicy

Kubernetes-commit: dd0a50336e283775e05e54b0b174b7c7a9367d99
2021-11-09 23:30:23 -08:00
Tim Hockin
f5f28c4de4 ServiceExternalTrafficPolicyType: s/Type//
Rename ServiceExternalTrafficPolicyType => ServiceExternalTrafficPolicy

Kubernetes-commit: d0e2b068500b260851f48c636185e1dcbb438d2e
2021-11-09 23:25:43 -08:00
Kubernetes Publisher
5a489e8d10 Merge pull request #114404 from hoskeri/discovery-error-check
Check the correct error in d.downloadAPIs

Kubernetes-commit: 47d58265ae6661fa5e21575f688ce761a11c090e
2022-12-11 00:05:15 -08:00
Abhijit Hoskeri
4dbb1cd1d5 Check the correct error in d.downloadAPIs
The error result of `d.downloadAPIs()` is set in `aerr`,
not `err`.

This prevents a nil-ptr dereference of apiGroups in the next step.

Signed-off-by: Abhijit Hoskeri <abhijithoskeri@gmail.com>

Kubernetes-commit: 450ba4f50638ad9ee4d287a762a8530c64e89ebd
2022-12-10 16:32:02 -08:00
Kubernetes Publisher
58ff029093 Merge pull request #113933 from liggitt/retry-race
Fix client-go request retry race

Kubernetes-commit: 8d2fbfc5a9635bc3247d7f739f8a057962049aca
2022-12-10 23:34:13 +00:00
Kubernetes Publisher
ca60156554 Merge pull request #111898 from ncdc/reflector-unstructured-fixes
Reflector: support logging Unstructured type

Kubernetes-commit: 054274d77c3fc12eeb56fd03d6e371d4aa61f0c1
2022-12-10 03:34:09 +00:00
Kubernetes Publisher
d21defd4b1 Merge pull request #113904 from apelisse/add-owners-apelisse
Add apelisse into some more OWNERS files

Kubernetes-commit: b47752022b5b856a3516ad5377e3b020f43c4f2b
2022-12-09 23:33:52 +00:00
Kubernetes Publisher
6cbd19f22f Merge pull request #114319 from liggitt/net-master
Update golang.org/x/net 1e63c2f

Kubernetes-commit: 72acaad83924360960e21915aa94cd1db8d0196c
2022-12-07 02:03:56 +00:00
Jordan Liggitt
b044399795 Update golang.org/x/net 1e63c2f
Includes fix for CVE-2022-41717

Kubernetes-commit: afe5378db9d17b1e16ea0028ecfab432475f8e25
2022-12-06 17:29:11 -05:00
Andy Goldstein
fbb7f087d1 reflector: refactor setting typeDescription & expectedGVK
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 784ec157e67c86bc3383b326bbfe8ee70737aa4d
2022-12-02 12:39:58 -05:00
Antoine Pelisse
0193d08605 Add jpbetz to k8s.io/client-go/applyconfigurations
Kubernetes-commit: a1f5e36fab45645ad4776eca927347d8dc715c8b
2022-11-17 14:54:41 -08:00
Jordan Liggitt
e2f402cda3 Limit request retrying to []byte request bodies
Kubernetes-commit: 69fad419a7666ac416307de4c3ee88c7e61b94db
2022-11-15 17:47:35 -05:00
Antoine Pelisse
a4d38f89cb Add apelisse into some more OWNERS files
Kubernetes-commit: b5f2130f240b0a9ebd1d0edd400b899d0efb8b2b
2022-11-14 16:28:14 -08:00
Kubernetes Publisher
1ac8d45935 Merge pull request #113797 from seans3/force-no-aggregated
Adds field to force non-aggregated discovery

Kubernetes-commit: 418608e926049e7458f03226fe27f101e7fdc47f
2022-11-14 21:50:55 +00:00
Kubernetes Publisher
c8ffed3108 Merge pull request #111023 from pohly/dynamic-resource-allocation
dynamic resource allocation

Kubernetes-commit: d1c0171aed848900daa07212370c991c19c318b1
2022-11-12 01:50:36 +00:00
Kubernetes Publisher
61cd728579 Merge pull request #113826 from jsafrane/add-openstack
Add CSI migration of OpenStack Cinder volumes

Kubernetes-commit: e4d46148de9d83c23001323d6613618c2897a427
2022-11-11 21:50:36 +00:00
Kubernetes Publisher
cfd682c60b Merge pull request #113375 from atiratree/PodHealthyPolicy-api
api: add unhealthyPodEvictionPolicy for PDBs

Kubernetes-commit: cc704f97784c3359db4690b97201ebfe6b481869
2022-11-11 13:50:33 +00:00
Patrick Ohly
522eaa15ef api: generated files
Kubernetes-commit: 9683c60c05491a9e9cafd3419c150caf7355bf49
2022-11-10 20:22:42 +01:00
Filip Křepinský
f1c80d7a4f generated
Kubernetes-commit: 3e3912467a0d7b00ec8a5231da3603b3aa31337d
2022-11-10 18:41:33 +01:00
Kubernetes Publisher
acc9fa7e04 Merge pull request #113186 from ttakahashi21/KEP-3294
Introduce APIs to support CrossNamespaceSourceProvisioning

Kubernetes-commit: d94261e904c90578e913c42c4d2a0fc8cb30937f
2022-11-10 17:39:30 +00:00
Jan Safranek
f2b10f39ac Remove OpenStack cloud provider
And keep OpenStack Cinder CSI translation

Kubernetes-commit: 6005c3b5120d2bfa1ce72b02389ac951a0482545
2022-11-10 18:26:00 +01:00
Jan Safranek
a3d3eb0cc9 Revert "Remove references to openstack and cinder"
This reverts commit 9bbf01bae93600d3314bce0acbff1f3a0a42e74b.

Kubernetes-commit: 5b284a50b78cb7d68b12825f5c0cfa29503c1577
2022-11-10 18:22:07 +01:00
Takafumi Takahashi
c7bdab2154 Generate code
Kubernetes-commit: cb12a2bc5118fe34e2eb396dc1a3b8e7cc1de9f4
2022-11-09 21:21:52 +00:00
Kubernetes Publisher
0a1f6a8fd0 Merge pull request #112744 from pwschuurman/statefulset-slice-impl
Add implementation of KEP-3335, StatefulSetSlice

Kubernetes-commit: ff19efdf9bd2d1f4abece3229f1e36c1d58b96df
2022-11-09 21:30:32 +00:00
Sean Sullivan
3ac73ea2c8 Adds bool to force non-aggregated discovery
Kubernetes-commit: a84d877310ba5cf9237c8e8e3218229c202d3a1e
2022-11-09 12:30:05 -08:00
Kubernetes Publisher
1c7a870d4f Merge pull request #113485 from MikeSpreitzer/apf-borrowing
Add borrowing between priority levels in APF

Kubernetes-commit: 1193a9abcbd6c6ce6fc7d4ce38872f1933ef5159
2022-11-09 13:30:37 +00:00
Kubernetes Publisher
7280270f31 Merge pull request #113599 from seans3/discovery-client-update
Aggregated discovery client

Kubernetes-commit: c288251818d9d39ffc10d8d133a5094288e73b3b
2022-11-09 09:30:03 +00:00
Marly Puckett
769443557e Update redacting functionality to redact all sensitive info in config when printing with view (#109189)
* Add RedactSecrets function

* Move RedactSecrets method to existing RawBytesData case

* Update TestRedactSecrets to use new pattern of os.CreateTemp()

Kubernetes-commit: e721272d10dd6c4d85ff613182ba0eaddcec9272
2022-11-08 17:30:10 +00:00
Kubernetes Publisher
4b1a9fdfb5 Merge pull request #113314 from cici37/celIntegration
CEL validation in Admission chain

Kubernetes-commit: 595ea324113580ae61f4a15ab3e5b22303a195cf
2022-11-08 05:49:13 +00:00
Kubernetes Publisher
ea9ec91697 Merge pull request #112905 from alexzielenski/kubectl-apply-csa-migration
kubectl: `apply --server-side` managed fields migration

Kubernetes-commit: 2f837dc113ba35f84e7012a6d1b06b075b349353
2022-11-08 05:49:10 +00:00
Kubernetes Publisher
3daf180aa6 Merge pull request #113688 from dashpole/update_utils
Update k8s.io/utils to fix util tracing panic

Kubernetes-commit: fa2e203a6bde89a84443ee9813e1f27aa31326a9
2022-11-08 05:49:08 +00:00
David Ashpole
dbe034bd24 update k8s.io/utils to fix util tracing panic
Kubernetes-commit: 3f1511c8e9a64cf60821036aa1fc3ec9d58a2931
2022-11-07 19:30:21 +00:00
Kubernetes Publisher
7ed3193a72 Merge pull request #111545 from jlsong01/rewrite_signature_of_StartEventWatcher
rewrite signature of function StartEventWatcher

Kubernetes-commit: f33209a6ede53ce6ead8aed6cfc1823df1afedfc
2022-11-08 05:49:05 +00:00
Kubernetes Publisher
cbe28cf468 Merge pull request #113274 from Huang-Wei/kep-3521-A
[KEP-3521] Part 1: New Pod API .spec.schedulingGates

Kubernetes-commit: 8c77820759cc28a5d82e9a68f3d335d1a27f4466
2022-11-04 07:56:09 +00:00
Alexander Zielenski
898b7a3cbd add FindFieldsOwners util function
to be used by kubectl to determine csa manager name used

findowners

Kubernetes-commit: 26a6e1234869b5c546195aaf416f3424cd3c3dc8
2022-11-03 12:01:34 -07:00
Alexander Zielenski
4f63b629b5 add UpgradeManagedFieldsPatch
rather than modify the object directly, this function provides a JSONPATCH that should be sent to the server to upgrade its managed fields.

Kubernetes-commit: 4e4d748c06e2c2dfec7608f96237c4b0a42540c9
2022-11-03 17:38:08 -07:00
Alexander Zielenski
c8c6cb5745 add OWNERS to csaupgrade
Kubernetes-commit: 5002ba215bcaec75a65ccd1ee879c64538b970b7
2022-11-03 17:38:02 -07:00
Alexander Zielenski
a45874a99b remove kubectl annotation logic from upgrade patch
adds unneccessary complexity. also discussed in SIG CLI meeting to keep annotation around for a while longer

Kubernetes-commit: 0c055eae3c9eaea26574743f0623d6b0e9e3d6b4
2022-11-03 12:05:45 -07:00
Sean Sullivan
25d5761bfa Aggregated discovery client
Kubernetes-commit: b8fe2c7b8061e6ab0b093a49351bac256606da4a
2022-11-03 11:09:58 -07:00
Wei Huang
2248bf3801 Automated codegen
Kubernetes-commit: fc831d70881d0ef3f4016ad6fa830256f53bb5f3
2022-10-28 15:06:18 -04:00
Kubernetes Publisher
d576a3570d Merge pull request #113387 from wojtek-t/refactor_client_indexing
Refactor store index into its structure

Kubernetes-commit: ee0b179a7b9867203a9cc73f5c90909318a240e3
2022-11-03 07:56:00 +00:00
Kubernetes Publisher
4fbef5bda9 Merge pull request #106242 from thockin/revive-copy-lb-status-type-to-ingress
Copy LoadBalancerStatus from core to networking

Kubernetes-commit: 818b13544f6421cd414d648637db48c9271b0bb7
2022-11-03 07:55:58 +00:00
Kubernetes Publisher
bc6266d159 Merge pull request #103177 from arkbriar/support_cancelable_exec_stream
Support cancelable SPDY executor stream

Kubernetes-commit: 3cf75a2f760b8093f7c97f26b4b2b059f3777bec
2022-11-03 03:55:56 +00:00
Wojciech Tyczyński
5e7ba1f8d7 Minor cleanup of thread safe store
Kubernetes-commit: 72194de96f0bb5c1c1e3247a129cf9e3f11972ef
2022-11-02 13:02:29 +01:00
Kubernetes Publisher
19b2e89c0c Merge pull request #113523 from seans3/content-type-response
Get response content-type

Kubernetes-commit: ccf57ba09dafa94906310059e42a6b896c0eaf44
2022-11-01 22:52:45 -07:00
arkbriar
0563decd0a Propagate the panic with a channel
Signed-off-by: arkbriar <arkbriar@gmail.com>

Kubernetes-commit: b7e6c23e9f73e4cc0209e94fe95c5e2809998bf6
2022-11-02 11:36:22 +08:00
Sean Sullivan
8ff4970e81 Get response content-type
Kubernetes-commit: 4ca128d71aa94653927b0e529b746cb7428563b1
2022-11-02 00:03:24 +00:00
Kubernetes Publisher
0d57396335 Merge pull request #113304 from mimowo/handling-pod-failures-beta-ssa
Use SSA to add pod failure conditions

Kubernetes-commit: 3c9928e4f87c1d023e595292e6139cbd8dfedd5c
2022-10-28 15:55:54 +00:00
Kubernetes Publisher
a232cf00b9 Merge pull request #113367 from pohly/dep-ginkgo-gomega
dependencies: update to gomega v1.23.0 and ginkgo v2.4.0

Kubernetes-commit: 9e8558158478f622104afd0328883577756bff9f
2022-10-28 15:55:53 +00:00
Michal Wozniak
a191e58772 SSA to add pod failure conditions - ready for review
Kubernetes-commit: fea883687feafc597591e15773f8c6f491b35d08
2022-10-24 14:55:16 +02:00
Patrick Ohly
984bdbf170 dependencies: update to gomega v1.23.0 and ginkgo v2.4.0 and dependencies
Gomega adds support for formatting extensions and StopTrying in matchers.
Ginkgo enhances DeferCleanup.

This also triggered an update of other dependencies.

Kubernetes-commit: e6ad2f2f23449c9d24606b864c4737dc66a7427e
2022-10-24 13:43:15 +02:00
Kubernetes Publisher
f87d0472f2 Merge pull request #112693 from aimuz/fix-GO-2022-0969
Fixed CVE-2022-27664 Bump golang.org/x/net to v0.1.1-0.20221027164007-c63010009c80

Kubernetes-commit: 6cb473b6c4f1239d411e0a50a1cdf9c4c092c42a
2022-10-28 07:55:43 +00:00
aimuz
d2367833c1 Fixed (CVE-2022-27664) Bump golang.org/x/net to v0.1.1-0.20221027164007-c63010009c80
Fixed https://pkg.go.dev/vuln/GO-2022-0969

Signed-off-by: aimuz <mr.imuz@gmail.com>

Kubernetes-commit: 78c704d4f60d54996d483d49c23c6aac82f28dc9
2022-10-28 10:07:56 +08:00
Kubernetes Publisher
ef8a2e5227 Merge pull request #113089 from zackzhangkai/fix-doc
fix typo

Kubernetes-commit: 594d34872c73f6abe5eba740f9e4557c6f970887
2022-10-19 07:54:59 +00:00
Kubernetes Publisher
197e4799dc Merge pull request #108959 from astraw99/fix-duplicate-list
Fix duplicate code block of `ListAll` function

Kubernetes-commit: 0be68925f5d584966f3ca131bbfad3ea275a491a
2022-10-18 19:55:26 +00:00
Kubernetes Publisher
42a0e1ca70 Merge pull request #113062 from alexzielenski/client-go-json-output
client-go: raw data options for fetching openapiv3

Kubernetes-commit: bfb78f3e74188b19e627c1126cafaa1be36901d4
2022-10-18 03:55:16 +00:00
Kubernetes Publisher
b6d3c8d376 Merge pull request #107278 from harsimranmaan/allow_pagination_in_dynamic_fake_lister
Preserve metadata for fake dynamic client unstructured lists

Kubernetes-commit: aaee0f57da21e4b00181ad577da862246a5fa73c
2022-10-17 23:59:41 +00:00
Kubernetes Publisher
9cc33a48a7 Merge pull request #113106 from pohly/dep-ginkgo-gomega
dependencies: update to gomega v1.22.1 and ginkgo v2.3.1

Kubernetes-commit: 4216ad3542ff5defcfdb303945772a8e1663a7f6
2022-10-17 19:55:18 +00:00
Alexander Zielenski
624929cd3f address feedback
Kubernetes-commit: 32d834a88673614080bc37727f8cc94b9b85bc86
2022-10-17 10:51:27 -07:00
Harsimran Singh Maan
0c269b7a5b remove selflink as per review feedback
Kubernetes-commit: 5da368d012f7635f9718876061bec864b7dcf8e6
2022-10-17 09:19:21 -07:00
zackzhangkai
0945beb5d7 fix typo
Signed-off-by: zackzhangkai <zhangkaiamm@gmail.com>

Kubernetes-commit: 5a1ca395b28efd6537f93f9615bc5c7ca401a9dd
2022-10-17 14:10:09 +08:00
Alexander Zielenski
12cafe2b1b refactor to use Schema(contentType)
Kubernetes-commit: e6e6dd826d76a2b19515cd907062f1f74f9e52c2
2022-10-14 12:46:36 -07:00
Alexander Zielenski
8b6ceae557 add more options for fetching openapiv3 in clients
remove serialized types from client

update tests

Kubernetes-commit: fec79e75a50f334d8384a5377513fc78222ea36a
2022-10-12 11:43:46 -07:00
arkbriar
2362c7b162 use subtests and defer in TestSPDYExecutorStream
Signed-off-by: arkbriar <arkbriar@gmail.com>

Kubernetes-commit: 86e5d069ecece8591ad693b50bcea49000f6df26
2022-10-10 11:24:40 +08:00
Patrick Ohly
9b5106747f dependencies: update to gomega v1.22.1 and ginkgo v2.3.1
This adds support for timeouts and intermediate reports in Eventually and
Consistently.

Kubernetes-commit: d1dbf7ae3e223d5d93d0b3d875e4f03ff38e6de0
2022-10-07 17:19:09 +02:00
Kubernetes Publisher
fa9ed7f5fe Merge pull request #112860 from nckturner/remove-log-line
Remove log line from expiration cache

Kubernetes-commit: c5bc8f929baf0ef7d6b1559e76f7569e8792a1bd
2022-10-15 07:53:38 +00:00
Kubernetes Publisher
6b2491258e Merge pull request #112988 from alexzielenski/update-kube-openapi
update kube-openapi

Kubernetes-commit: 353e00796ef4c1e8fcea1cb51bcc62fc3acac3c8
2022-10-15 03:54:03 +00:00
Kubernetes Publisher
aea20dde59 Merge pull request #113037 from pacoxu/fsnotify-v1.6.0
update fsnotify to v1.6.0

Kubernetes-commit: 542ec977054c16c7981606cb1590cc39154ddf01
2022-10-14 07:56:41 +00:00
Alexander Zielenski
e3bb48f784 update kube-openapi
hack/pin-dependency.sh k8s.io/kube-openapi 172d655c2280350c77cf05962948fc67ff043492
hack/update-vendor.sh

Kubernetes-commit: f622dd918ab5d3bc902a8c625a0a89b21e8afe43
2022-10-13 19:51:22 -07:00
Paco Xu
1af37115fa update fsnotify to v1.6.0
Kubernetes-commit: 3fee9d27355afe64dec7fa264e1faf209712f169
2022-10-13 13:14:43 +08:00
Kubernetes Publisher
e6d958c7a8 Merge pull request #112989 from ameukam/bump-golang.org/x/text-to-v0.3.8
Bump golang.org/x/text to v0.3.8

Kubernetes-commit: 054d86feb42b67bb13608d9aa9a7c986750da753
2022-10-12 03:53:33 +00:00
Arnaud Meukam
5e469bad4c Bump golang.org/x/text to v0.3.8
Signed-off-by: Arnaud Meukam <ameukam@gmail.com>

Kubernetes-commit: 0d19690a54e480923e8222ce79566e6879667a1f
2022-10-11 23:30:39 +02:00
Kubernetes Publisher
f515a4cb9f Merge pull request #112774 from stevekuznetsov/skuznets/dynamic-client-similar
client-go: factor the dynamic client similarly to others

Kubernetes-commit: bb2101bac12748aa77adfa15b07b5b8d8dcd0672
2022-10-10 19:53:31 +00:00
Kubernetes Publisher
b28f6c94f4 Merge pull request #112875 from pohly/update-yaml
dependencies: update to sigs.k8s.io/yaml v1.3.0

Kubernetes-commit: 93d1c43b491a39740297cf1e76782b99d8739865
2022-10-06 15:53:38 +00:00
Patrick Ohly
c9afc73c5f dependencies: update to sigs.k8s.io/yaml v1.3.0
No particular benefit and no relevant changes, it's just to stay up-to-date and
to avoid having to pull that in when merging
https://github.com/kubernetes/kubernetes/pull/111023 which indirectly depends
on the newer release.

Kubernetes-commit: 9b93cc663a102b6e36f07eecc7b6e32225f39295
2022-10-05 11:14:23 +02:00
Nick Turner
5870c622c7 Remove log line from expiration cache
Kubernetes-commit: e7bfd5909f5540f884a8bb914a9230c9bf7c2803
2022-10-04 11:01:37 -07:00
Kubernetes Publisher
f24bd6967c Merge pull request #112306 from tkashem/v1beta3
add v1beta3 for Priority And Fairness

Kubernetes-commit: 9720af2ba3f0d792c873bfa6e4d54e60736fb7a0
2022-10-03 19:47:29 +00:00
Cici Huang
3a430a4884 API - make update
API - Auto update

API - make update

API - make update

Kubernetes-commit: 19b2df871560816c3eb29fbb271953afab1e39c8
2022-10-03 17:17:45 +00:00
Abu Kashem
d4a3675975 apiserver: add generated files for borrowing in flowcontrol
Kubernetes-commit: a76223f8da90e984cb3a699fe908b0e7a35ad5f9
2022-10-03 13:17:24 -04:00
Kubernetes Publisher
ebc7cd4b2d Merge pull request #112707 from enj/enj/i/https_links
Use https links for k8s KEPs, issues, PRs, etc

Kubernetes-commit: 3af1e5fdf6f3d3203283950c1c501739c21a53e2
2022-09-29 22:29:31 +00:00
Steve Kuznetsov
34e8a5d862 client-go: factor the dynamic client similarly to others
All other clients:

 - expose a New() method that takes a rest.Interface
 - expose their RESTClient()
 - return pointers to the type, not instances of an interface that the
   type implements

For code that is generic over all Kubernetes clients, and for general
developer experience, it's best to make sure that this client adheres to
these common practices.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 74af6f1e7d9057bfcb64f4d875063c14041937e5
2022-09-28 08:57:22 -06:00
Peter Schuurman
eed251634d Adding implementation of KEP-3335, StatefulSetSlice
Kubernetes-commit: 7b3d77a41af88083ba14ffe2cc8ad3a66010c43b
2022-09-26 18:34:03 -07:00
Kubernetes Publisher
2f43d370b3 Merge pull request #112705 from stevekuznetsov/skuznets/fix-comment
clients: clarify a misleading comment

Kubernetes-commit: bc6e801aa0e0cf17d22652ff881ebc3540b7af55
2022-09-26 16:34:18 +00:00
Kubernetes Publisher
369734286b Merge pull request #112680 from enj/enj/i/tls_cache_key_comparable
transport/cache: statically assert that tlsCacheKey is comparable

Kubernetes-commit: a024252328430d90e807eabfcb86d84e6651b7db
2022-09-26 16:34:16 +00:00
Kubernetes Publisher
c81636cd44 Merge pull request #112665 from NoicFank/fix-typo
Fix typo error in shared_informer

Kubernetes-commit: 953ce2212bd00f4d212ec3b1c35b5aba01952cb1
2022-09-24 22:44:02 +00:00
Monis Khan
166580894e Use https links for k8s KEPs, issues, PRs, etc
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: b738be9b46a899571303c8c887e32bf4d5b71a0a
2022-09-23 16:13:22 -04:00
Steve Kuznetsov
956c1ce5e8 clients: clarify a misleading comment
It's clear that client-sets contain many versions of one group, so this
comment just seems to be out-dated.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 588f016c3bc04ea2da85d7077643677028a8cb1b
2022-09-23 12:25:52 -06:00
Kubernetes Publisher
be20b2bd91 Merge pull request #112673 from dims/update-to-latest-k8s.io/utils-sep-22
Update to latest k8s.io/utils to pick up changes

Kubernetes-commit: 722e02408ed1d0d1fc5b7304e2ad8c23125aa2b4
2022-09-22 18:51:49 +00:00
Monis Khan
cc2441c02c transport/cache: statically assert that tlsCacheKey is comparable
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: a6d0f483002926f075009e69d533e244dec3cd2b
2022-09-22 13:14:38 -04:00
Davanum Srinivas
04dbcd88ed Update to latest k8s.io/utils to pick up changes
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e7e7cdd3ce7cd0cec806298c2b7705ea240369c
2022-09-22 07:14:21 -04:00
Lurong
59765b8784 fix typo error
Kubernetes-commit: 0b2ad4cc42e727ec93011411033cac1abfb637ea
2022-09-22 14:42:41 +08:00
Abu Kashem
9b97b72528 rename assuredConcurrencyShares for flowcontrol v1beta3
Kubernetes-commit: 66fc0d703794f309c9715028d3b63f64c281a5fd
2022-09-21 15:40:33 -04:00
Kubernetes Publisher
2fd4aac190 Merge pull request #112613 from dims/update-github.com/go-openapi/jsonreference-to-drop-github.com/PuerkitoBio/purell
Update github.com/go-openapi/jsonreference to drop github.com/PuerkitoBio/purell

Kubernetes-commit: 299e65cdc5799b982b6af69858c14bfe41463540
2022-09-21 14:44:50 +00:00
Davanum Srinivas
47ad72abfd update github.com/go-openapi/jsonreference to drop github.com/PuerkitoBio/purell
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 005a5ca08173b080193ecb01421e2513f32d045b
2022-09-20 20:49:55 -04:00
Kubernetes Publisher
f7c9c639d4 Merge pull request #112545 from dims/update-etcd-3.5.5-and-all-otel-related-to-latest
Update etcd 3.5.5 and all otel related libraries to newer versions

Kubernetes-commit: 6820a383be4a1bbb5cd526eb3aeb9e6ade351498
2022-09-20 02:44:03 +00:00
Kubernetes Publisher
b6e72dce28 Merge pull request #112226 from aojea/client_go_transport
client-go: test transport generation is goroutine safe

Kubernetes-commit: 5d45f766b5f1527cb54bbc9b625f90cc64b3b784
2022-09-19 18:47:00 +00:00
Kubernetes Publisher
acfaa39399 Merge pull request #112352 from pohly/e2e-ginkgo-progress
e2e: better ginkgo progress reports

Kubernetes-commit: 25b93a607a3edd28b0c720701ab7b6ebf1252148
2022-09-19 10:56:47 +00:00
Davanum Srinivas
6b5ecadcc5 updated etcd to v3.5.5 and newer otel libraries as well
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 5be80c05c423daf4bd2a4eb1cabf61fae9a03629
2022-09-17 14:04:16 -04:00
Kubernetes Publisher
037b5fd01d Merge pull request #112514 from markmc/patch-1
client-go: remove reference to TPR in examples

Kubernetes-commit: 86c46a4bcc2b5be6371422fd3130feb98c6697ab
2022-09-16 22:23:41 +00:00
Mark McLoughlin
3f66212017 client-go: remove reference to TPR in examples
5 years after third party resources were removed, we're probably just confusing readers with this reference.

Kubernetes-commit: d21fc6e762276747e3306cfaf27b0ce1201071c2
2022-09-16 15:14:13 +01:00
Kubernetes Publisher
86ffa32437 Merge pull request #112475 from vatsalparekh/fix-TestRESTClientLimiter
Fix Infelicities in TestRESTClientLimiter

Kubernetes-commit: 8b7840e393d8107647b1818e0a623018786f006f
2022-09-16 14:41:04 +00:00
Kubernetes Publisher
ece64627e4 Merge pull request #112476 from enj/enj/i/list_pager_flake
Check for context cancellation on each buffered chunk

Kubernetes-commit: be506dc46e4ba13c701bd8f228a4d1d1581873be
2022-09-16 14:41:03 +00:00
Kubernetes Publisher
58155b7df0 Merge pull request #112450 from enj/enj/i/exec_tls_cache_holder_cleanup
client-go/transport: drop Dial and GetCert fields in favor of Holders

Kubernetes-commit: 6824cd3addbb214e88e00f451babb8a44eb738d1
2022-09-16 14:41:02 +00:00
Kubernetes Publisher
eecd3e52a3 Merge pull request #112091 from xyz-li/master
kubectl: fix memory leaks in port forwarding client

Kubernetes-commit: 7a68c8a21a29787adf9e959271b8f955a68d3d82
2022-09-15 14:36:40 +00:00
Monis Khan
67030989c0 Check for context cancellation on each buffered chunk
TestListPager_EachListItem flakes without this change.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 7458ed01d6aa150b8a6046e0dbeba88d5d5ff1bb
2022-09-15 10:33:33 -04:00
Vatsal Parekh
bf2b395a89 Fix Infelicities in TestRESTClientLimiter
Signed-off-by: Vatsal Parekh <vatsalparekh@outlook.com>

Kubernetes-commit: c980cf489eeb39fd0fe0af7e80cfea2dbe2007db
2022-09-15 19:30:40 +05:30
Kubernetes Publisher
f6b8521807 Merge pull request #111333 from flant/selfsubjectattributesreviews
Add auth API to get self subject attributes

Kubernetes-commit: 4e8b11d4411cefbe1a32cf9e54810d9e0bd7378e
2022-09-14 22:43:31 +00:00
Patrick Ohly
ec6c80aa4d e2e: bump ginkgo to v2.2.0
The new release adds support for intermediate progress reports.

Kubernetes-commit: 1e4edaf2fe0a7bedd7e54725b489f62c20c92954
2022-09-09 15:47:46 +02:00
Monis Khan
5dab9a0b84 client-go/transport: drop Dial and GetCert fields in favor of Holders
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 3313a70d5bcc40a39f99f482c18effc9de6072ba
2022-09-09 08:06:01 -04:00
Abu Kashem
9bac803bd8 apiserver: generate for apf v1beta3
Kubernetes-commit: 6ac0e879790ddaf62942ea101d6edb24b0c57cbd
2022-09-08 10:53:38 -04:00
Antonio Ojea
1bd914a925 client-go: test transport generation is goroutine safe
Kubernetes-commit: fe41181c3d470207772d3ac9a91d4ef2c2a6720d
2022-09-04 12:36:01 +02:00
LiHui
cc3cc93e6a kubectl: fix memory leaks in port forwarding client
Signed-off-by: LiHui <andrewli@kubesphere.io>

Kubernetes-commit: 1df24569a0bf62a528c49f73fdb236fd56eb05ee
2022-08-29 14:15:01 +08:00
arkbriar
5e0a53136c Support cancelable SPDY executor stream
Mark remotecommand.Executor as deprecated and related modifications.

Handle crash when streamer.stream panics

Add a test to verify if stream is closed after connection being closed

Remove blank line and update waiting time to 1s to avoid test flakes in CI.

Refine the tests of StreamExecutor according to comments.

Remove the comment of context controlling the negotiation progress and misc.

Signed-off-by: arkbriar <arkbriar@gmail.com>

Kubernetes-commit: 42808c8343671e6783ba4c901dcd619bed648c3d
2022-08-24 10:21:35 +08:00
Andy Goldstein
37897aff8d Reflector: support logging Unstructured type
Add an annotation that can be added to the exampleType passed to
NewReflector to indicate the expected type for the Reflector. This is
useful for types such as unstuctured.Unstructured, which, when used with
a dynamic informer, do not have their TypeMeta filled in.

Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 474fc8c5234000bce666a6b02f7ffbb295ef135f
2022-08-17 15:49:26 -04:00
jlsong01
34679611a8 rewrite signature of function StartEventWatcher
Kubernetes-commit: c8291e393b32f8ce4e8fd1d4f18e848247be13f8
2022-07-29 23:43:05 +08:00
m.nabokikh
b2b55e607d Add auth API to get self subject attributes
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: 00dfba473b08528f0a21f7bd3b921f5dd35b013a
2022-07-22 04:01:52 +04:00
Kubernetes Publisher
18c3338d48 Merge pull request #112200 from pohly/client-go-shared-informer-factory-shutdown
client-go: support waiting for SharedInformerFactory shutdown

Kubernetes-commit: 084a412e03816ef3ea57da928ae8fd332d17ab59
2022-09-13 18:36:50 +00:00
Kubernetes Publisher
9dae6917fb Merge pull request #112309 from shyamjvs/disable-compression
Add a "DisableCompression" option to kubeconfig

Kubernetes-commit: ed520f3cac2243cd5f66967e2c590caf1e98b9e2
2022-09-12 18:36:27 +00:00
Kubernetes Publisher
ab826d2728 Merge pull request #112349 from pohly/klog-update
build: update to klog v2.80.1

Kubernetes-commit: b48b0eac6ad3556b343f54c26b49ed74cac276e3
2022-09-09 22:42:45 +00:00
Patrick Ohly
ab0bfda62e build: update to klog v2.80.1
The fix for https://github.com/kubernetes/klog/issues/348 is required before
https://github.com/kubernetes/kubernetes/pull/111998 can be merged because the
way how a unit test in that PR uses klog triggers the data race.

Kubernetes-commit: 60d92dd96a4ba3873dd9e061c3e332c16c213e30
2022-09-09 13:11:55 +02:00
Kubernetes Publisher
f32861cf25 Merge pull request #112341 from enj/enj/i/second_time_is_the_charm
Remove in-tree credential plugins (again)

Kubernetes-commit: d569886a234cb65cb1ec777b7ab2e5b9a35d7145
2022-09-09 06:35:35 +00:00
Monis Khan
7d208ba573 Remove in-tree credential plugins (again)
This change reverts three commits:

1. Revert "Revert "Remove gcp and azure auth plugins""
   This reverts commit 651b4f5b647a205d12fad4d0edc489d97109cccc.

2. Revert "update-gofmt"
   This reverts commit 79c09f0b310b8b66f8f14ad254f268788c42e076.

3. Revert "Update removal warnings to 1.26"
   This reverts commit 68758fc5c5099c83104a637e6d6ad3f4534f0d08.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 09cde58bbc13ff1229f61146221f56af4ff675dc
2022-09-08 19:11:03 -04:00
Kubernetes Publisher
e003fa92aa Merge pull request #112017 from enj/enj/i/exec_tls_cache
exec auth: support TLS config caching

Kubernetes-commit: 082da2f04e413932615bcc32cba83959e7d043f7
2022-09-09 02:35:35 +00:00
Shyam Jeedigunta
49ac40b489 Autogen code
Kubernetes-commit: f9c46a0e3361e19de93c02562fedfff7de448dc2
2022-09-07 18:05:42 -07:00
Shyam Jeedigunta
b8a8d94944 Add DisableCompression option to KubeConfig
Kubernetes-commit: 641fd5b482c6117d459a22d99f76aae086c3524f
2022-09-07 18:04:17 -07:00
Kubernetes Publisher
2698e8276e Merge pull request #111967 from alexzielenski/csa-to-ssa
[client-go] add function to upgrade managedfields CSA to SSA

Kubernetes-commit: 385cc255c77dd8c03bba6322946f7c97fdb33f53
2022-09-07 22:50:19 +00:00
Kubernetes Publisher
27c67e708a Merge pull request #111122 from alexzielenski/informer
support removal of event handlers from SharedIndexInformers

Kubernetes-commit: 2969000db3fae354b7b27bc79712d244248e640e
2022-09-07 22:50:16 +00:00
Kubernetes Publisher
d28c73639f Merge pull request #112022 from JackZxj/release-lock
update lock getter of leaderelection

Kubernetes-commit: 2b203348fbe7d05dec9e913e0fb50045a2474425
2022-09-07 18:39:46 +00:00
Alexander Zielenski
00d892f447 correct spacing
Kubernetes-commit: dbff8e117c8d4aeccac6ea211dfa334e30621727
2022-09-06 20:58:50 -07:00
Alexander Zielenski
2efbeaf56e add boilerplate
Kubernetes-commit: 3528fd7e47f585c144b13c0c2b75bc4e432987c6
2022-09-06 19:51:47 -07:00
Alexander Zielenski
dac0826f18 remove inaccurate comment
Kubernetes-commit: 52fcd20b578b67234a9ac84b5abf1cd2b3d06ea4
2022-09-02 17:42:08 -07:00
Alexander Zielenski
7634f2e002 make upgrade modify input instead of deep copying
Kubernetes-commit: adcb5ec3d43908a916fd1ae75af121568f26b80d
2022-09-02 17:40:34 -07:00
Alexander Zielenski
9aa7c11460 remove fieldsv1 from upgrade body
Kubernetes-commit: 5c9534b9cfdcfa9625153051f0859e101abb97a9
2022-09-02 17:38:29 -07:00
Alex Zielenski
703d15eff6 Update staging/src/k8s.io/client-go/util/csaupgrade/upgrade.go
Co-authored-by: Antoine Pelisse <apelisse@gmail.com>

Kubernetes-commit: 5caffef694b50168f546d7758a26de832302b541
2022-09-02 17:34:07 -07:00
Kubernetes Publisher
b8b620636c Merge pull request #112199 from pohly/klog-update
dependencies: update to klog v2.80.0

Kubernetes-commit: bacd6029b3bac1dbc468b0cc2bc5770bef671af2
2022-09-02 18:36:24 +00:00
Patrick Ohly
5a2c3e9222 dependencies: update to klog v2.80.0
Contains one bug fix in the code path for formatting of objects that support
LogMarshal.

Kubernetes-commit: 1bc3bde128463cdc6d55d5d222f489e8eda5eeb7
2022-09-02 08:05:47 +02:00
Patrick Ohly
ec4fedd955 client-go: support waiting for SharedInformerFactory shutdown
SharedInformerFactory starts goroutines in Start and those can be stopped by
closing the stop channel. However, there was no API that waits for the
goroutines.

This is a problem for unit testing. A test has to return while the informers
are still running, which may get flagged by tools like
https://github.com/uber-go/goleak or by klog/ktesting when those informers
lead to log output.

While at it, more documentation gets added to address
https://github.com/kubernetes/kubernetes/issues/65036.

Kubernetes-commit: e89d1d47e8365cad31600b17dab662d3c8a359dd
2022-09-01 13:46:08 +02:00
Kubernetes Publisher
7ccf7b05af Merge pull request #112134 from apelisse/client-go-valid-segment
Validate segments with client-go/dynamic

Kubernetes-commit: b274815e200528c77b66f352e223cdaa987505f5
2022-09-01 02:35:55 +00:00
Kubernetes Publisher
d83ec9e727 Merge pull request #112129 from pohly/e2e-ginkgo-report-after-each
e2e: suppress too verbose output

Kubernetes-commit: d0e413e86d150e0d4638ce306ca3fd437fe0b763
2022-08-31 18:36:12 +00:00
Antoine Pelisse
a4b84d86ec Validate segments with client-go/dynamic
Kubernetes-commit: 7d64440dd1edf2acb8e71ecd6726904962c6bd02
2022-08-30 16:32:10 -07:00
Alexander Zielenski
675ca93180 refactor if statement
Kubernetes-commit: f7defeecce9c9e32d180deb2a2c67e063a10265f
2022-08-30 15:46:43 -07:00
Alexander Zielenski
a300ae0dfe return when test is done
Kubernetes-commit: cc0b9ffbd5a4edfe7ce01293c2bf963d4335d8d6
2022-08-30 14:38:21 -07:00
Alexander Zielenski
cfaca90a30 address comments
Kubernetes-commit: e8d8eb4381f96ec4923a801116050ee998de4887
2022-08-30 13:21:29 -07:00
Patrick Ohly
cac10a8427 dependencies: update to ginkgo v2.1.6 and gomega v1.20.1
Ginkgo v2.1.6 adds ginkgo.SuppressProgressReporting which is needed
to suppress too verbose output each time the ReportAfterEach of the custom
progress reporter is invoked.

Kubernetes-commit: 311144fb3e61dabdbcd48d164dc80716b5ba5a73
2022-08-30 19:33:50 +02:00
Alexander Zielenski
93e5e0e8a0 hold listener lock while waiting for goroutines to finish
Kubernetes-commit: 7ce19b75a8dbca12837ed9f4c5c2828c38b82a03
2022-08-29 12:34:35 -07:00
Alexander Zielenski
e11a988e1c simplify control flow
Kubernetes-commit: ee24648300f8575f503156f45b44034054c2e49d
2022-08-29 11:52:35 -07:00
jackzhang
d04c2ced1c update lock getter of leaderelection
The lock acquired by tryAcquireOrRenew is released when the leader ends
leadership. However, due to the cancellation of the context, the lock may
be set as an empty lock, so the Update cannot be run normally, resulting
in a failure to release the lock.

Signed-off-by: jackzhang <x_jackzhang@qq.com>

Kubernetes-commit: 8690ff6264cceb38bd81dec99bb8affcc40286a9
2022-08-29 09:58:13 +08:00
Kubernetes Publisher
46d4284b93 Merge pull request #111241 from Abirdcfly/fixtestorsource
make TestListPager_EachListItem rework

Kubernetes-commit: ce2c5875d83487eae67896b2ec099bbb9e40395f
2022-08-26 22:35:39 +00:00
Kubernetes Publisher
bdae576b94 Merge pull request #112068 from aojea/aojea_client_go
add aojea as client-go reviewer

Kubernetes-commit: 213d811fcb23d918ade553cbb74b174946768045
2022-08-26 11:30:26 -07:00
Antonio Ojea
fd22687940 add aojea as client-go reviewer
Kubernetes-commit: 7ddb0ef4642d62ac8bc5a58cf0370b14b8d44f01
2022-08-26 17:01:56 +02:00
Kubernetes Publisher
35ead05f62 Merge pull request #112052 from tosi3k/bump-client-golang
Bump prometheus/client_golang to v1.13.0

Kubernetes-commit: 8ccd03226f81573b91550f21c6b8d63f65e7c2f1
2022-08-26 10:35:28 +00:00
Antoni Zawodny
5291ca2900 Bump prometheus/client_golang to v1.13.0
Kubernetes-commit: f78e7a2b19fe275b7cb43c01099366c52545e4d1
2022-08-26 05:40:17 +02:00
Kubernetes Publisher
e6538dd42b Merge pull request #112024 from cndoit18/remove-redundant-judgment
style: remove redundant judgment

Kubernetes-commit: bc9f48b84187e6fd9ba5b828a449893d4569e4c6
2022-08-25 18:35:19 +00:00
Alexander Zielenski
089614c43e remove last applied configuration information
Kubernetes-commit: a7fe0f0283765e4970211f7227602e2caa4b3a57
2022-08-24 12:31:57 -07:00
Alexander Zielenski
efe378914a add more test cases
Kubernetes-commit: 42c960497a4737d8147d40d436a00be81ec4248d
2022-08-24 11:51:30 -07:00
Alexander Zielenski
46dc22f46a clean up test
Kubernetes-commit: 8f6d7f1fa13db3d7a3354a13f014e1ce7acabda0
2022-08-24 10:24:05 -07:00
Alexander Zielenski
ced85a8521 update godoc
Kubernetes-commit: f94ef92f2ac44fb07bc8d75d5f250b757b343c11
2022-08-24 10:12:41 -07:00
Alexander Zielenski
049ba69f2f expose FieldsToSet and SetToFields
Kubernetes-commit: a338fff435c35a4da2556a8f4c4ab059c98e909c
2022-08-24 10:03:16 -07:00
Monis Khan
6a008ec216 exec auth: support TLS config caching
This change updates the transport.Config .Dial and .TLS.GetCert fields
to use a struct wrapper.  This indirection via a pointer allows the
functions to be compared and thus makes them valid to use as map keys.
This change is then leveraged by the existing global exec auth and TLS
config caches to return the same authenticator and TLS config even when
distinct but identical rest configs were used to create distinct
clientsets.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 831d95b6a021c2767effe85e461309cb6a0fdcec
2022-08-24 16:04:19 +00:00
Alexander Zielenski
aa892ab1ac remove unused code
Kubernetes-commit: f495d7656ca79e2d5cae03b37977e75369352645
2022-08-23 16:17:27 -07:00
Alexander Zielenski
90ef078c30 dont expose internal methods in implementatoin
Kubernetes-commit: fe2b5d00f2c1f16636638acd10b8d640e6de22c9
2022-08-23 16:12:47 -07:00
Alexander Zielenski
ac7f6579ff fix spelling
Kubernetes-commit: 7685b393c2ee8f8548d62f9dd8485df764a0c8c3
2022-08-22 17:34:02 -07:00
Alexander Zielenski
c364b639fb add function to upgrade managedfields CSA to SSA
Kubernetes-commit: 27cd307e23df3a2d508d52ff10ac8f46bf3bcea3
2022-08-22 16:42:18 -07:00
Alexander Zielenski
0f4a6cf319 reset listenersStarted
for correctness. technically shouldnt be an issue since restarting a stopped processor is not supported

Kubernetes-commit: 3a81341cfa6f7e2ca1b9bfc195c567dcdfaa4dea
2022-08-08 14:19:37 -07:00
Alexander Zielenski
449817f7b5 add multithreaded test to shared informer
Kubernetes-commit: 8af0a31a15079725e5910d538a6ace03df2e382a
2022-08-08 13:39:18 -07:00
Alexander Zielenski
de0b7671e3 remove duplicate test
became a duplicate while refactoring original PR

Kubernetes-commit: df9a7afa63164035f1e94c3278d470b347b697b9
2022-08-08 11:46:05 -07:00
Alexander Zielenski
0565962dd0 address review comments
asd

Kubernetes-commit: 5f372e1867305679d8f9d8a013c5500763e5c875
2022-08-08 11:44:37 -07:00
cndoit18
bcd2e6c7da style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
2022-07-29 18:25:05 +08:00
Kubernetes Publisher
d5e58631fd Merge pull request #111752 from aanm/revert-final-url-template
Revert "client-go: remove no longer used finalURLTemplate"

Kubernetes-commit: dfd10d3133669d7c30b28edcf1024bafda1df766
2022-08-24 02:35:32 +00:00
Kubernetes Publisher
5feaced742 Merge pull request #67782 from dims/yank-in-tree-openstack-cloud-provider
Remove in-tree openstack cloud provider

Kubernetes-commit: 07bca2d7919c192435949c53f81acff58d6f39eb
2022-08-24 02:35:30 +00:00
Kubernetes Publisher
0fdc4f348a Merge pull request #111684 from 0xff-dev/master1
use constant NamespaceDefault instead of variable namespace

Kubernetes-commit: e7297321321a7cde918734402a8a999990045179
2022-08-24 02:35:29 +00:00
Kubernetes Publisher
4faffa8644 Merge pull request #111564 from inosato/remove-ioutil-from-cli-client-go
Remove ioutil from client-go

Kubernetes-commit: eb713b11867557c0bf829fc5cf919791db2a022b
2022-08-24 02:35:26 +00:00
Kubernetes Publisher
2e404084ad Merge pull request #111918 from liggitt/in-tree-auth
Restore in-tree credential plugins for 1.25

Kubernetes-commit: d581cc90adba6c84919738841fe3e07302d53e33
2022-08-18 22:38:37 +00:00
Jordan Liggitt
c2f61ae20a Update removal warnings to 1.26
Kubernetes-commit: 68758fc5c5099c83104a637e6d6ad3f4534f0d08
2022-08-18 14:17:56 -04:00
Jordan Liggitt
54e42ab6f2 update-gofmt
Kubernetes-commit: 79c09f0b310b8b66f8f14ad254f268788c42e076
2022-08-18 14:17:31 -04:00
Jordan Liggitt
ef26118838 Revert "Remove gcp and azure auth plugins"
This reverts commit 916cf16cf14928702f3f90b655ddddab2c85fcec.

Kubernetes-commit: 651b4f5b647a205d12fad4d0edc489d97109cccc
2022-08-18 14:16:23 -04:00
André Martins
e9d4627252 client-go/rest: check if url is nil to prevent nil pointer dereference
Signed-off-by: André Martins <aanm90@gmail.com>

Kubernetes-commit: 94e7b2b8fdb4028b8b9d10ce57b9b33df146beb7
2022-08-09 14:19:01 +02:00
André Martins
c501ee0eba Revert "client-go: remove no longer used finalURLTemplate"
The functionality provided by the finalURLTemplate is still used by
certain external projects to track the request latency for requests
performed to kube-apiserver.

Using a template of the URL, instead of the URL itself, prevents the
explosion of label cardinality in exposed metrics since it aggregates
the URLs in a way that common URLs requests are reported as being the
same.

This reverts commit bebf5a608f68523fc430a44f6db26b16022dc862.

Signed-off-by: André Martins <aanm90@gmail.com>

Kubernetes-commit: f8f190cdd2fa76296f8b1b019ac77128b5d40b79
2022-08-08 23:27:45 +02:00
Davanum Srinivas
98e81a7784 Remove references to openstack and cinder
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9bbf01bae93600d3314bce0acbff1f3a0a42e74b
2022-08-08 16:01:59 -04:00
Kubernetes Publisher
a890e7bc14 Merge pull request #109090 from sarveshr7/multicidr-rangeallocator
Enhance NodeIPAM to support multiple ClusterCIDRs

Kubernetes-commit: 759785ea147bc13945d521eaba4a6592cbc0675f
2022-08-07 23:56:12 +00:00
Kubernetes Publisher
f10f16e029 Merge pull request #111113 from mimowo/retriable-pod-failures-job-controller
Support handling of pod failures with respect to the configured rules

Kubernetes-commit: eefcf6aa801c5db48b564d0464470d623b8bfb79
2022-08-05 00:25:03 +00:00
Kubernetes Publisher
3300752b61 Merge pull request #111696 from liggitt/go119mod
Update go.mod to go1.19

Kubernetes-commit: 897cdea783916023f269e32003a9a3cdb98e4b46
2022-08-04 20:16:34 +00:00
Kubernetes Publisher
ce9ac379ec Merge pull request #108692 from jsafrane/selinux
Speed up SELinux volume relabeling using mounts MVP

Kubernetes-commit: b6d0f6ab613e4f3d3d1f4b6a48c24c561c65a4f1
2022-08-04 20:16:31 +00:00
Jordan Liggitt
4100519c43 Update go.mod to go1.19
Kubernetes-commit: 00db9f02293a6e0325330b575bffb9e466406dfe
2022-08-04 10:03:05 -04:00
Michal Wozniak
c439b2507d Support handling of pod failures with respect to the specified rules
Kubernetes-commit: bf9ce70de34c93b545f95e1d81c122c81a8a0aa5
2022-08-04 08:21:32 +02:00
0xff-dev
c94a539bfb use constant NamespaceDefault instead of variable namespace
Kubernetes-commit: 4bdca5689f65597f28a99f3610dd4e43fbc9cd7c
2022-08-04 14:18:47 +08:00
Sarvesh Rangnekar
76884cd2d8 Auto generate code for ClusterCIDR API
Kubernetes-commit: 299724d099f87d66b7a196d5acb545eb4dd78b9a
2022-08-02 02:09:07 +00:00
inosato
27de641f75 Remove ioutil from client-go
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 88dfa51b6003c90e8f0a0508939a1d79950a40df
2022-07-30 20:54:41 +09:00
Abirdcfly
9b300defa3 make TestListPager_EachListItem rework
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: 5e84f6b6d7cd39b785eaca404c3f7e460f80f71b
2022-07-19 15:34:23 +08:00
Alexander Zielenski
5a25eb0de8 switch listeners to use a map, adapt tests
Kubernetes-commit: 063ef090e7fb5823ca18a10a83e8847eedac9599
2022-06-16 10:54:03 -07:00
Jan Safranek
a00e9abf6c Regenerate files
Kubernetes-commit: f2fd9c1c16c7ba99856d96f69c3b9bde1b811367
2022-06-06 20:08:29 +02:00
Kubernetes Publisher
55b6f70f83 Merge pull request #111677 from dims/stop-panic-in-govet-levee
Stop panic in govet levee under golang 1.19

Kubernetes-commit: ef7fc1046059b7cbf93a7a7f5481ed200783ff21
2022-08-04 08:16:30 +00:00
Davanum Srinivas
606e4a8099 run lint-dependencies and follow directions
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 34742f2d2eebfc3ced8442f8579581705dcba38d
2022-08-03 21:56:02 -04:00
Davanum Srinivas
fe9020e749 Stop panic in govet-levee CI job
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 30e2fcd041cdf00d91fb7876f28165f532950213
2022-08-03 21:47:28 -04:00
Kubernetes Publisher
e803ec6bfc Merge pull request #110495 from alexzielenski/atomic-objectreference
make ObjectReference field ownership granular

Kubernetes-commit: a0e702763e01d246ce13a5d7608407204094748a
2022-08-04 00:23:48 +00:00
Kubernetes Publisher
07171f82e7 Merge pull request #111090 from kinvolk/rata/userns-support-2022
Add support for user namespaces phase 1 (KEP 127)

Kubernetes-commit: 4b6134b6dc497f48916d4b1667d4c9a461aaa36a
2022-08-03 20:20:12 +00:00
Alexander Zielenski
b5feb253b6 mark persistentvolume's claimRef as granular
Kubernetes-commit: 84f795d04aa04b29f587d34a8852818ba5803e35
2022-08-03 09:48:30 -07:00
Alexander Zielenski
c5a511a525 update kube-openapi
Kubernetes-commit: 133c26553020409b26de0c1487c804250b528e71
2022-08-03 09:46:39 -07:00
Natasha Sarkar
bebf21907c Update kubectl kustomize to kyaml/v0.13.9, cmd/config/v0.10.9, api/v0.12.1, kustomize/v4.5.7 (#111606)
Kubernetes-commit: 83c3c37a879c6d14cce2465161f88d3c6881de8b
2022-08-03 04:15:46 +00:00
Kubernetes Publisher
68639ba114 Merge pull request #111557 from alexzielenski/update-smd-422
update smd to 4.2.3

Kubernetes-commit: 22eab136f6c85f83e56ff71ec6346ffd7cc5e977
2022-08-02 20:16:39 +00:00
Kubernetes Publisher
b0d4101b8e Merge pull request #111475 from alculquicondor/clear_pod_disruption
Add worker to clean up stale DisruptionTarget condition

Kubernetes-commit: bc4c4930ff18dce320bd33f645ff4f3accc72018
2022-08-02 20:16:37 +00:00
Alexander Zielenski
1631be4c27 update smd to 4.2.3
Kubernetes-commit: e77ed0bc2e3a807f4aca9360ec20933a03869716
2022-08-02 10:07:50 -07:00
Rodrigo Campos
912b04a8ad Update autogenerated files
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>

Kubernetes-commit: 8dc98c9b8ecded941b2664f64d24b3ee98c0f500
2022-07-27 12:54:15 +02:00
Aldo Culquicondor
3dfaef50d7 Add clock interface to disruption controller
To be able to write more precise unit tests in the future

Change-Id: I8f45947dfacca501acd856849bd978fad0f735cd

Kubernetes-commit: dad8454ebb87ba7af897537db6d34033127bbfef
2022-07-26 15:11:53 -04:00
Kubernetes Publisher
3e9c4b4f17 Merge pull request #111587 from ialidzhikov/k8s-utils@ee6ede2d64
Update `k8s.io/utils` to `ee6ede2d64ed`

Kubernetes-commit: 9af9947230633823ffa94e1fd11c58d7af986d8b
2022-08-01 04:15:43 +00:00
ialidzhikov
2037cc6a9a Update k8s.io/utils to ee6ede2d64ed
Kubernetes-commit: 6aa5efb1bdc2d0dcccca67c6a9cc20820380a366
2022-07-31 16:33:14 +03:00
Kubernetes Publisher
07735eaa93 Merge pull request #111441 from denkensk/respect-topology
Respect PodTopologySpread after rolling upgrades

Kubernetes-commit: 3902a534197b3e4b7ca7a026f5027cfe0a3cc3aa
2022-07-30 12:15:36 +00:00
Alex Wang
2190b2f23b code generated by script for MatchLabelKeys in TopologySpreadConstraint
Signed-off-by: Alex Wang <wangqingcan1990@gmail.com>

Kubernetes-commit: 86a2a85e7dd0a650020bf407a6eb85b956653539
2022-07-30 13:24:55 +08:00
Kubernetes Publisher
95367f2044 Merge pull request #110851 from negz/more-like-mac-slow-s
Use checksums instead of fsyncs to avoid slow discovery caching on MacOS

Kubernetes-commit: 8cecf183a659784b240d430e22b828b8e32c1c37
2022-07-30 04:15:31 +00:00
Kubernetes Publisher
ec0f33729d Merge pull request #111387 from marseel/feature/retry_internal_errors
Add option to retry internal api error in reflector.

Kubernetes-commit: 79a62d62350fb600f97d1f6309c3274515b3587a
2022-07-28 16:16:03 +00:00
Kubernetes Publisher
c2d2c47718 Merge pull request #111228 from Abirdcfly/220716
clean unreachable code

Kubernetes-commit: 4e5711829c1c8bfadbb7632b28def5ba08325132
2022-07-27 20:05:57 +00:00
Kubernetes Publisher
fe12e65afd Merge pull request #111442 from ialidzhikov/k8s-utils@56c0de1e6f
Update `k8s.io/utils` to `9bab9ef40391`

Kubernetes-commit: e092b6d27bff004171b71fffa45f111fdcd6e81b
2022-07-27 20:05:55 +00:00
Nic Cope
761f55c9e0 Use SHA256 sums to verify discovery cache integrity
This is a little more computationally expensive but reduces the
likelihood of a potentially malicious cache collision.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: c5957c284e1d23bdadc98fbbe2bb481fc1f345d4
2022-07-26 23:51:01 -07:00
ialidzhikov
7a55c3b96b Update k8s.io/utils to 9bab9ef40391
Kubernetes-commit: 168fef6845f50f0460e7bdc0280da480cc92b787
2022-07-26 18:43:20 +03:00
Kubernetes Publisher
cc879cd5b6 Merge pull request #111254 from dims/update-to-golang-1.19-rc2
[golang] Update to 1.19rc2 (from 1.18.3)

Kubernetes-commit: 3ffdfbe286ebcea5d75617da6accaf67f815e0cf
2022-07-27 00:05:46 +00:00
Kubernetes Publisher
b5c7588f8a Merge pull request #109141 from ulucinar/bump-discovery-burst
Bump default burst limit for discovery client to 300

Kubernetes-commit: 5ac563c507cd75c9382a2a23a3c8e3452138a021
2022-07-26 20:05:51 +00:00
Marcel Zięba
ff6bf679aa Add option to retry internal api error in reflector.
Kubernetes-commit: 0b2b6489de8f75d5299f54180617601126bb8878
2022-07-25 08:02:54 +00:00
Kubernetes Publisher
b2097e607c Merge pull request #110666 from ldsdsy/modify
Fix some syntax errors under the staging/src/k8s.io/client-go/rest/ folder

Kubernetes-commit: 6db9d882387eb2a0b5d78deffac88a121ceac9f3
2022-07-22 16:22:34 +00:00
Kubernetes Publisher
4db4856058 Merge pull request #111242 from wojtek-t/fix_leaking_goroutines_11
Fix leaking goroutines in multiple integration tests

Kubernetes-commit: 0cde1b744652306e921116883e2465a005b79811
2022-07-22 16:22:31 +00:00
Kubernetes Publisher
95a40e254c Merge pull request #110178 from kevindelgado/validation-beta-1-25
Graduate server side validation to beta

Kubernetes-commit: eeb12bb3af3361c9ac652be071c3b9cf49aa5e58
2022-07-22 16:22:30 +00:00
Kubernetes Publisher
267b6570f5 Merge pull request #111235 from Abirdcfly/220719
fix a possible panic because of taking the address of nil

Kubernetes-commit: e234917e0a3e4bb384ef14c198742643a7e170fd
2022-07-22 16:22:27 +00:00
Kubernetes Publisher
0cfc9635b9 Merge pull request #110649 from harshanarayana/fix/GIT-110335-fix-fake-event-expansion
client-go: Modify FakeEvents to Work Event Sink started with `""` namespace

Kubernetes-commit: 0e7bb163e38cde20712ce29e918e10ec5c82f3eb
2022-07-22 16:22:26 +00:00
Davanum Srinivas
2a6c116e40 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

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

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Abirdcfly
ca60e0ea14 fix a possible panic because of taking the address of nil
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: c8c2819a4d7327f33a143f65c6af2bff5ef49735
2022-07-19 10:39:08 +08:00
Wojciech Tyczyński
9dde02d660 Clean shutdown of client integration tests
Kubernetes-commit: f673c262bdc2f3f0f060a2ed4349b723a088f36a
2022-07-18 21:13:33 +02:00
Abirdcfly
65b1e7d3c0 clean Unreachable code
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: f71718d6448418d0289b9649905a16bfb1962b68
2022-07-19 00:58:17 +08:00
Kubernetes Publisher
c6bd30b9ec Merge pull request #111176 from p0lyn0mial/upstream-cacher-refactor-for-streaming
refactor the reflector to pave the way for streaming

Kubernetes-commit: d96891255f0a15c5c992ba38ab3cf782eda66fdf
2022-07-15 21:11:11 +00:00
Lukasz Szaszkiewicz
441e2c8c97 reflector: simplify reading the resourceVersion
Kubernetes-commit: 63b125d4061d267ad8998ea30e054bb1445b1a5a
2022-07-15 10:14:26 +02:00
Nic Cope
735524f850 Use sha256 to sanitize discovery HTTP cache keys
This helps avoid (potentially malicious) collisions when reading and
writing cache data.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: 288a17fd337c65cb5aea44e44ecb74e9cb8088f5
2022-07-14 14:11:33 -07:00
Alper Rifat Ulucinar
4aac6a7c9c Bump discovery burst of default ConfigFlags to 300
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

Kubernetes-commit: 45f653e3db6a120d7cafaf2a9262fb3c8a2e22a2
2022-07-14 09:58:55 +03:00
Kevin Delgado
b4c3510afd update kjson
Kubernetes-commit: c210483cf02768c3f2eaf42e13844c5d821831ba
2022-07-13 16:05:45 +00:00
Giuseppe Scrivano
828c3cb11b pkg/apis, staging: add HostUsers to pod spec
It is used to request that a pod runs in a unique user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
Co-authored-by: Rodrigo Campos <rodrigoca@microsoft.com>

Kubernetes-commit: 9e9b23fd3ca6c0c58ee401b18a65422c0564bec0
2022-07-07 21:43:51 +02:00
Nic Cope
1ea239faa5 Use checksums instead of fsyncs to manage discovery cache corruption
Part of the API discovery cache uses an HTTP RoundTripper that
transparently caches responses to disk. The upstream implementation of
the disk cache is hard coded to call Sync() on every file it writes.
This has noticably poor performance on modern Macs, which ask their disk
controllers to flush all the way to persistant storage because Go uses
the `F_FULLFSYNC` fnctl. Apple recommends minimizing this behaviour in
order to avoid degrading performance and increasing disk wear.

The content of the discovery cache is not critical; it is indeed just a
cache and can be recreated by hitting the API servers' discovery
endpoints. This commit replaces upstream httpcache's diskcache
implementation with a similar implementation that can use CRC-32
checksums to detect corrupted cache entries at read-time. When such an
entry is detected (e.g. because it was only partially flushed to
permanent storage before the host lost power) the cache will report a
miss. This causes httpcache to fall back to its underlying HTTP
transport (i.e. the real API server) and re-cache the resulting value.

Apart from adding CRC-32 checksums and avoiding calling fsync this
implementation differs from upstream httpcache's diskcache package in
that it uses FNV-32a hashes rather than MD5 hashes of cache keys in
order to generate filenames.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: 7a2c6a432f9e8db8b84abe5607843429f8bff417
2022-06-28 19:15:49 -07:00
Nic Cope
76fccca0ea Add a benchmark for the discovery cache RoundTripper
This benchmark is intended to demonstrate a performance improvement
gained by removing fsyncs. Refer to the below issue for more detail.

https://github.com/kubernetes/kubernetes/issues/110753

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: eace46906512b99c23ad9635edc2ea055363a602
2022-06-28 19:40:58 -07:00
Lukasz Szaszkiewicz
04f67d5d4f reflector: move LIST to its own method
Kubernetes-commit: 6fc09008def0b63fdd31bd26a14f7fcd3ed63c7e
2022-06-24 16:25:08 +02:00
Lukasz Szaszkiewicz
4e28921c86 reflector: refactor watchHandler
Kubernetes-commit: e9e26068b746315b616a26b91ff2613f98e934bc
2022-06-24 13:44:32 +02:00
Kubernetes Publisher
163ee0b6d7 Merge pull request #111080 from zhoumingcheng/master-v3
Correct wrong syntax

Kubernetes-commit: 3b4d2a9b315be29f600c4eae704d62107fd5ff98
2022-07-15 21:11:09 +00:00
Kubernetes Publisher
743e29dc1f Merge pull request #111008 from cici37/bumpCEL
Bump cel-go to v0.12.3

Kubernetes-commit: 19a22f763770d1208dca2b8d50513ac805f7fe14
2022-07-14 13:11:01 +00:00
Kubernetes Publisher
79a582f2eb Merge pull request #111097 from saltbo/fix-thethe-typo
fix: update the typo code comment

Kubernetes-commit: f3654386abbb838c42286250ef52a73c52ab1812
2022-07-14 01:23:24 +00:00
Kubernetes Publisher
eabd4289b0 Merge pull request #111002 from HecarimV/fix-220707
fix static-check for staging/src/k8s.io/client-go/

Kubernetes-commit: 09e8339ae4e575ec40e8ed0fc2829fcb678c0f19
2022-07-13 09:22:58 +00:00
saltbo
7c3fa18b11 fix: update the typo code comment
Kubernetes-commit: d2bab218ddef3fc3f444038420dd500c0e8bc068
2022-07-13 10:16:51 +08:00
Kubernetes Publisher
59fda2e669 Merge pull request #111087 from HecarimV/fix-22071205
Fix: import the same package multiple times

Kubernetes-commit: d46399f788fbb8de586cd71c19d1e49bfae8659f
2022-07-12 17:29:46 +00:00
HaoJie Liu
2f582c2a40 Fix:import the same package multiple times
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>

Kubernetes-commit: 4f0a0ec81c649727cfc62cf8c0a2ad7eabf12516
2022-07-12 17:41:37 +08:00
zhoumingcheng
84e1219642 Correct some wrong syntax
Signed-off-by: zhoumingcheng <zhoumingcheng@beyondcent.com>

Kubernetes-commit: e590ab77dcb68486a154b755aae658509b9290ea
2022-07-12 10:46:56 +08:00
Kubernetes Publisher
3b969f9680 Merge pull request #111001 from pohly/klog-update
build: update to klog v2.70.1

Kubernetes-commit: 8e62fd24b073296c4cfd8f8d966d5922b6d9022c
2022-07-08 01:23:16 +00:00
Cici Huang
7f7dbbc80a Bump cel-go to v0.12.0
Kubernetes-commit: 772a252b06da86955d30d7b935dc4dba84fdc328
2022-07-07 17:13:57 +00:00
HaoJie Liu
f295032991 fix static-check for staging/src/k8s.io/client-go/
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>

Kubernetes-commit: 6022b69dfd1c6e9454d4aa79012803c749706f6d
2022-07-07 18:58:25 +08:00
Patrick Ohly
26b506437f build: update to klog v2.70.1
This makes ktesting more resilient against logging from leaked goroutines,
which is a problem that came up in kubelet node shutdown
tests (https://github.com/kubernetes/kubernetes/issues/110854).

Kubernetes-commit: 3581e308835c69b11b2c9437db44073129e0e2bf
2022-07-07 12:54:08 +02:00
Kubernetes Publisher
506ef8944c Merge pull request #110990 from thockin/svc-typenames-IPFamilyPolicyType
Rename IPFamilyPolicyType => IPFamilyPolicy

Kubernetes-commit: e8eb7a5e1906ec07f5e666a2d2f32f3a0e74dcec
2022-07-07 05:29:22 +00:00
ldsdsy
123d4e7e38 Fix a typo
Kubernetes-commit: bfe61fa574321474c4b278afb39af95464efad43
2022-06-20 21:52:50 +08:00
Harsha Narayana
e2ef40870b GIT-110335: address namespace defaulting for events
Kubernetes-commit: 85e74aa3122114ac7e82c3044f387d03661063e4
2022-06-18 21:52:50 +05:30
Wojciech Tyczyński
b69a16cf38 Refactor store index into its structure
Kubernetes-commit: 7c94ce3076a96acab4c7e88489cd596f1aad40e0
2022-05-05 17:30:24 +02:00
Alper Rifat Ulucinar
ed7d154cc2 Bump default burst limit for discovery client to 300
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

Kubernetes-commit: 534427f5d3134189f49e6811a7642b86cf92c55a
2022-03-30 11:19:41 +03:00
astraw99
f549acf3ce Fix duplicate code block of ListAll function
Kubernetes-commit: d8db1e9ba3c110012def6faa5579ad3abb71a6a6
2022-03-24 14:47:20 +08:00
Harsimran Singh Maan
fbd8e9aa52 fix failing test assertions
Kubernetes-commit: c8714ebd118760f8d68e9b536d0350129af12d9b
2022-02-22 16:05:40 -08:00
Harsimran Singh Maan
1f10368e31 Preserve metadata for fake dynamic client unstructured lists
Signed-off-by: Harsimran Singh Maan <maan.harry@gmail.com>

Kubernetes-commit: ac904454c24bebd9501ea4701d38f55f25ec9c33
2021-12-31 15:15:18 -08:00
Tim Hockin
61a7d9d6e1 Rename IPFamilyPolicyType => IPFamilyPolicy
Kubernetes-commit: 55232e2ef773423ed9b3321b38fc438f85cd690c
2021-11-09 23:09:35 -08:00
Kubernetes Publisher
a16e76eb69 Merge pull request #110831 from chendave/openapi
Bump `kube-openapi` to the latest

Kubernetes-commit: 8a7eda4f610f7003bf096d870531c7583751674e
2022-06-30 19:56:35 +00:00
Dave Chen
6a58c3a5c7 Bump kube-openapi to the latest
This will help us to get rid of `Ginkgo` v1 dep.

Signed-off-by: Dave Chen <dave.chen@arm.com>

Kubernetes-commit: 597071af17377f5ab4de03804b0d8b41f73fe7ce
2022-06-28 15:59:50 +08:00
Kubernetes Publisher
f5b6af4563 Merge pull request #110788 from 21kyu/change_reflect_ptr
Change reflect.Ptr to reflect.Pointer

Kubernetes-commit: 10810ab42bc8acde6732feae545aa34a09ecd299
2022-06-27 19:52:45 +00:00
21kyu
1b23c1577a Change reflect.Ptr to reflect.Pointer
Kubernetes-commit: df168d5b5c2dab7414fc00ead1a51257ec326a98
2022-06-26 01:23:43 +09:00
Kubernetes Publisher
8dfe88aeff Merge pull request #110724 from pohly/klog-update
build: update to klog v2.70.0

Kubernetes-commit: ddfbb5bdbef1febda92fdc4ee4666f5339d1f729
2022-06-23 03:53:28 +00:00
Kubernetes Publisher
899bcd7409 Merge pull request #110425 from LY-today/fake-evict-list-err
fix: list pod err after an pod evicted

Kubernetes-commit: 1d811065345bfe9f3be7f6757a9938c1760180c7
2022-06-22 23:52:40 +00:00
Kubernetes Publisher
0647d43372 Merge pull request #109632 from weilaaa/recorrect_byindex_input_param
correct input params of ByIndex

Kubernetes-commit: e2fe430da77da01aa5b4c9bd787d46062f1500a0
2022-06-22 19:53:10 +00:00
LY-today
9ac8bfecbb fix: list pod err after an pod evicted
Signed-off-by: LY-today <724102053@qq.com>

Kubernetes-commit: f299494e7977a935511208eb91001508b4b629ce
2022-06-22 23:30:40 +08:00
Patrick Ohly
cb4a10df41 build: update to klog v2.70.0
The main practical advantage is that klog.Fatal no longer dumps the backtrace
of all goroutines.

Kubernetes-commit: f05e327ca611c23469ef41310d1d59b384cedc27
2022-06-22 16:29:51 +02:00
weilaaa
64585cf823 correct input params and add godoc
Kubernetes-commit: 9847b2eeb43e3fd13581dfdb4eeb288139ea7f3b
2022-06-22 11:26:07 +08:00
Kubernetes Publisher
acab036eff Merge pull request #110436 from nicks/nicks/issue-1108
client-go: fix panic in ConfirmUsable validation

Kubernetes-commit: 349efaabf89cf894d3f7ef16f3936318ae96728e
2022-06-15 23:58:19 +00:00
Kubernetes Publisher
830d4c4624 Merge pull request #110378 from lucacome/bump-grpc
Bump grpc to v1.47.0

Kubernetes-commit: de5982637aebe17b0fa4a814ec1e6675c0132ddd
2022-06-14 19:52:33 +00:00
Luca Comellini
e0fa50410b Bump grpc to v1.47.0
Signed-off-by: Luca Comellini <luca.com@gmail.com>

Kubernetes-commit: 51fafd7de3e0d71d98a1f9e10d3801f157472ae3
2022-06-13 22:08:47 -07:00
Kubernetes Publisher
2a9f955190 Merge pull request #110518 from dims/switch-to-released-version-of-v3.8.0-github.com/emicklei/go-restful/v3
Switch to released version of v3.8.0 - github.com/emicklei/go-restful/v3

Kubernetes-commit: 0fe0dbf3fb8cf501c24c87f4113a3819cb86a550
2022-06-13 19:52:10 +00:00
Kubernetes Publisher
d4fc9af2df Merge pull request #110520 from dims/update-gopkg.in/yaml.v3-to-v3.0.1
Update gopkg.in/yaml.v3 to v3.0.1

Kubernetes-commit: 3375f5773b4371bc4975879521002b16ed8f0f56
2022-06-13 07:51:49 +00:00
Davanum Srinivas
08b4bbc4f6 Update gopkg.in/yaml.v3 to v3.0.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 68b414764bfa32c3232df7c7455b77e8e8c8ecd7
2022-06-11 20:39:40 -04:00
Davanum Srinivas
7e1edab3f7 Switch to released version of v3.8.0 - github.com/emicklei/go-restful/v3
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 6f2889718fb0bab46558fcd4a11b6858d5fc2149
2022-06-11 11:27:08 -04:00
Kubernetes Publisher
87a5b7b3b7 Merge pull request #110351 from dims/switch-to-v3-of-github.com/emicklei/go-restful
Switch to v3 of github.com/emicklei/go-restful by updating kube-openapi

Kubernetes-commit: 7e66aa3cfb6cdac3508c04017fa3b7cdcdf9238f
2022-06-10 23:51:49 +00:00
Nick Santos
5ce7078061 client-go: fix panic in ConfirmUsable validation
Fixes https://github.com/kubernetes/client-go/issues/1108

Kubernetes-commit: 7d2c6096c212d9c31e7cd0bccb6dc2dec9a4ef6a
2022-06-07 15:53:16 -04:00
Davanum Srinivas
cf0ba13096 Switch to v3 of github.com/emicklei/go-restful
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: ab690750df1d27409d31fd270d77b4390bac4431
2022-06-02 10:03:29 -04:00
Kubernetes Publisher
f88de91ae5 Merge pull request #96771 from soltysh/shortcut_expander
restmapper: re-try shortcut expander after not-found error

Kubernetes-commit: 7e3c98fd303359cb9f79dfc691da733a6ca2a6e3
2022-05-30 12:48:08 +00:00
Tim Hockin
3f162fe9e9 Copy LoadBalancerStatus from core to networking
This type should never have been shared between Service and Ingress.
The `ports` field is unfortunate, but it is needed to stay compatible.

Kubernetes-commit: 0153bfad16102e42d0b0dbb56742d0a6626e4180
2021-11-08 17:06:59 -08:00
Uwe Krueger
90c6a46b32 active remove/add tests for event handlers
Kubernetes-commit: e9cd17170b1646672796e713dee6c4fb0e6693bb
2021-10-06 12:40:46 +02:00
Uwe Krueger
de4dd3aaf3 tests for invalid registration removals
Kubernetes-commit: 152b6e11af4c8c50b768630bf7724e0bb3414e9c
2021-08-22 13:27:36 +02:00
Uwe Krueger
33eff64a05 apply desired changes for handler registration
Kubernetes-commit: 92f04baac98186673c684bba419087d6285807b1
2021-08-22 13:03:18 +02:00
Uwe Krueger
d73e40f207 rename handle to registration
Kubernetes-commit: 7054ac16d43a4a55d6e7b69943eb209f6495c4ce
2021-08-04 21:54:32 +02:00
Alexander Zielenski
b3a61c6731 remove informational informer methods again
Kubernetes-commit: f52f4a8e3045fd3eeba0315a347ed653012cd5c5
2022-06-16 00:09:20 -07:00
Alexander Zielenski
ecdc8bf729 support removal of event handlers from SharedIndexInformers
To be able to implement controllers that are dynamically deciding
on which resources to watch, it is required to get rid of
dedicated watches and event handlers again. This requires the
possibility to remove event handlers from SharedIndexInformers again.
Stopping an informer is not sufficient, because there might
be multiple controllers in a controller manager that independently
decide which resources to watch.

Unfortunately the ResourceEventHandler interface encourages to use
value objects for handlers (like the ResourceEventHandlerFuncs
struct, that uses value receivers to implement the interface).
Go does not support comparison of function pointers and therefore
the comparison of such structs is not possible, also. To be able
to remove all kinds of handlers and to solve the problem of
multi-registrations of handlers a registration handle is introduced.
It is returned when adding a handler and can later be used to remove
the registration again. This handle directly stores the created
listener to simplify the deletion.

Kubernetes-commit: 7436af3302088c979b431856c432b95dd230f847
2022-06-16 00:07:54 -07:00
Maciej Szulik
e2598a43a3 restmapper: re-try shortcut expander after not-found error
Kubernetes-commit: f7d1eb7726fa511b6439b7f8162138742ac639ab
2020-11-21 00:10:47 +01:00
Kubernetes Publisher
cf13620092 Merge pull request #84145 from bells17/fix-typo
Fix typo: type -> eventtype

Kubernetes-commit: f9f9e7177a328ae47bac6b823d57a99dfbfd310b
2022-05-26 12:48:14 +00:00
Kubernetes Publisher
33115b49ac Merge pull request #110100 from tkashem/client-go-backoff-fix
client-go: fix backoff delay

Kubernetes-commit: 9997897f44976f8969fcc79678cddc291987fab4
2022-05-23 08:47:41 +00:00
Abu Kashem
71b8c174e4 client-go: fix backoff delay
Kubernetes-commit: 60e74a9ff73b206e5dd439b5df51ac9826635579
2022-05-17 17:19:26 -04:00
Kubernetes Publisher
0bc005e72f Merge pull request #110076 from karlkfi/patch-1
fix: reflector to return wrapped list errors

Kubernetes-commit: f0c47dc91628978ff21d417630037e839102621e
2022-05-17 20:09:18 +00:00
Karl Isenberg
876406445a fix: reflector to return wrapped list errors
This fix allows Reflector/Informer callers to detect API errors using the standard Go errors.As unwrapping methods used by the apimachinery helper methods. Combined with a custom WatchErrorHandler, this can be used to stop an informer that encounters specific errors, like resource not found or forbidden.

Kubernetes-commit: 9ace604b63045ebbb066cab5e8508b51d0900a05
2022-05-16 16:33:30 -07:00
Kubernetes Publisher
ef63e495ba Merge pull request #110013 from enj/enj/i/remove_azure_gcp_auth_plugins
Remove gcp and azure auth plugins

Kubernetes-commit: 2d08104ee3beb5c13db088d40cc22ec053512cea
2022-05-12 23:35:52 +00:00
Monis Khan
1f7dc8805f Remove gcp and azure auth plugins
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 916cf16cf14928702f3f90b655ddddab2c85fcec
2022-05-12 09:48:04 -04:00
Kubernetes Publisher
77f63643f9 Merge pull request #108080 from astoycos/issue-132
Fix Panic Condition

Kubernetes-commit: efb62b3538f34f304ea9c68966a053822bc23d1a
2022-05-11 12:58:10 +00:00
Kubernetes Publisher
b4b8e5e1e5 Merge pull request #108492 from kerthcet/feature/add-NodeInclustionPolicies
Add NodeInclusionPolicy to TopologySpreadConstraint in PodSpec

Kubernetes-commit: cc6619857027c634918a6d2cca9bab072c46f71f
2022-05-11 04:06:00 +00:00
kerthcet
5bb1a76702 feat: add NodeInclusionPolicy to TopologySpreadConstraint in PodSpec
Signed-off-by: kerthcet <kerthcet@gmail.com>

Kubernetes-commit: 02f0a3ee91e43d39da80df926f552b8934a4646d
2022-05-10 12:54:49 +08:00
Kubernetes Publisher
24209264f7 Merge pull request #109891 from pohly/log-dependency-update
dependencies: logr and zapr v1.2.3

Kubernetes-commit: bf52c1fd46a6773b9d653ef97d94502c6e0564e5
2022-05-09 18:30:31 +00:00
Kubernetes Publisher
7c5b74295f Merge pull request #109602 from lavalamp/remove-clustername
Finish clustername removal

Kubernetes-commit: 7af5a7bfc51d0455d8b2322ae9e72ed66fb1b8f9
2022-05-07 18:33:25 +00:00
Daniel Smith
5a9c3acf9d generated files
Kubernetes-commit: 1dabd7be5c08d70dc1b54670de64cae2bf7c6a04
2022-04-21 18:39:21 +00:00
Kubernetes Publisher
c0ab12afa7 Merge pull request #109804 from cici37/celUpdate
Bump cel-go to v0.11.2

Kubernetes-commit: b7c4d243de12a30bba02e23777c8ff1627263f89
2022-05-05 10:33:16 +00:00
Kubernetes Publisher
bb66d8065b Merge pull request #109607 from liggitt/drop-unused-third-party
Drop unused golang/template package and funcs

Kubernetes-commit: a685faa79822e365fd6a3efea955b82cb3b20599
2022-05-05 10:33:13 +00:00
Kubernetes Publisher
f4c553f30d Merge pull request #109440 from liggitt/gomod-1.18
update go.mod files to go 1.18

Kubernetes-commit: cb7beb591216de93bef22525a6c5f0e435e21789
2022-05-05 02:33:08 +00:00
cici37
631da0c65f Update go-control-plane, cncf/xds/go, cncf/udpa/go and remove unused versions
Kubernetes-commit: a3587c12da7f8c87e6676f472dba39f1acbae28f
2022-05-04 18:45:22 -07:00
cici37
28feddd66c Update GRPC
Kubernetes-commit: 334d8fb7a2e85d58513c2d3fae113995c8165a4b
2022-05-04 18:41:20 -07:00
cici37
a8fbc496ab Update genproto and antlr.
Kubernetes-commit: e8f6184d8682bd4510d4e18c7c04b5799367ac51
2022-05-04 18:37:30 -07:00
cici37
ac3e4baf0f Bump cel-go to v0.11.2
Kubernetes-commit: a86dd2915771f280ff095409fc2ee917cee3c2e3
2022-05-04 18:32:06 -07:00
Jordan Liggitt
ccff9638f3 Regenerate vendor
Kubernetes-commit: 9e1064a26bfdc18b3272c3d9031d729793725392
2022-05-04 10:27:41 -04:00
Kubernetes Publisher
671a40c59f Merge pull request #109520 from cncal/lcn_cleanup_duplicate_code_snippet
Remove the duplicate code snippet in client-go delaying_queue tests

Kubernetes-commit: 78dbcb4233799bf219d4983fc2b242dd7ae1be6d
2022-05-04 10:32:57 +00:00
Kubernetes Publisher
211d8a7adf Merge pull request #109443 from kevindelgado/dynamic-apply
Add Apply and ApplyStatus methods to dynamic ResourceInterface

Kubernetes-commit: e8ef77514b5e2fe6a7c602f9663c2ef179387ea4
2022-05-04 10:32:55 +00:00
Kubernetes Publisher
2cf1a8ffd6 Merge pull request #105963 from zhucan/bugfix-95367
csi: add nodeExpandSecret support for CSI client & add unit test

Kubernetes-commit: 1aec0c81b1b283827480f9c40c5a7107b9986aa8
2022-05-04 02:33:08 +00:00
Jordan Liggitt
748150502e Remove package variables
Kubernetes-commit: 87494389ac7987ed9586190dc9566669b33a9f7c
2022-04-21 21:24:49 -04:00
Jordan Liggitt
28c4a4d40f Drop unused golang/template funcs
Kubernetes-commit: 7a261d9fa0edc0a8e615bd6bf81e8e3a5276f4fb
2022-04-21 21:21:16 -04:00
cncal
152e68ff13 Remove the duplicate code snippet in client-go delaying_queue tests
Kubernetes-commit: af438abbf332e26e2f3f729627bf9764c9b1feef
2022-04-17 15:55:33 +08:00
Kubernetes Publisher
28ccde769f Merge pull request #109436 from JamesLaverack/revert-108290
Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"

Kubernetes-commit: 4cdeab4696e86c9738d99e2650d2cdfdfb0f8d32
2022-04-13 16:44:20 +00:00
Kevin Delgado
4eab6be14c Add Apply and ApplyStatus methods to dynamic ResourceInterface
Kubernetes-commit: 581ac7f4465ed97ddc5c62f04376ac427e121601
2022-04-12 20:24:15 +00:00
James Laverack
f9fdccdfc3 Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"
This reverts commit b9792a9daef4d978c5c30b6d10cbcdfa77a9b6ac.

Kubernetes-commit: 7d57d5c70d04f652b431d2b86b8af40e119cd66a
2022-04-12 16:00:35 +01:00
Kubernetes Publisher
af4295f501 Merge pull request #109114 from tkashem/client-go-retry-thread-safe
client-go: make retry in Request thread safe

Kubernetes-commit: 0424c7c74d926b4fe3193059e003e9056b429d28
2022-04-04 16:49:36 -07:00
zhucan
1f8debfcd2 generated code and doc
Signed-off-by: zhucan <zhucan.k8s@gmail.com>

Kubernetes-commit: 1c1faf97ee8d3b147dbad067c5e65fab81cb92db
2022-04-02 00:17:25 +08:00
Patrick Ohly
c301d448ce dependencies: logr and zapr v1.2.3
The updated zapr is more resilient against MarshalLog crashing. Not a known
problem in Kubernetes, though.

Kubernetes-commit: 3e6974e0ba67a8f598e7bc4ccedfdab928935551
2022-03-31 11:26:57 +02:00
Abu Kashem
d8531f5ff0 client-go: make retry in Request thread safe
Kubernetes-commit: 6618b8ef7c0b552839555d4578b64427d20524ef
2022-03-29 13:09:26 -04:00
Kubernetes Publisher
33011f1487 Merge pull request #109050 from MadhavJivrajani/client-go-retry
rest: Ensure response body is fully read and closed before retry

Kubernetes-commit: 97bf2986cdeae0e7da70659d70375e0770b14a5e
2022-04-04 21:13:37 +00:00
Kubernetes Publisher
8a672f0fd2 Merge pull request #109151 from Argh4k/r-101566
Revert "Field `status.hostIPs` added for Pod (#101566)"

Kubernetes-commit: 691d4c3989f18e0be22c4499d22eff95d516d32b
2022-03-31 17:13:25 +00:00
Maciej Wyrzuc
f699049d30 Revert "Field status.hostIPs added for Pod (#101566)"
This reverts commit 61b3c028ba618a939559c39befb546ae5e5fd0b9.

Kubernetes-commit: 1108bed7631f545d43530aa697175d243b99610b
2022-03-30 12:50:48 +00:00
Sarvesh Rangnekar
092a109b2b Introduce APIs to support multiple ClusterCIDRs (#108290)
* Introduce networking/v1alpha1 api, ClusterCIDRConfig type

Introduce networking/v1alpha1 api group.

Add `ClusterCIDRConfig` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.

* Change ClusterCIDRConfig.NodeSelector type in api

* Fix review comments for API

* Update ClusterCIDRConfig API Spec

Introduce PerNodeHostBits field, remove PerNodeMaskSize

Kubernetes-commit: b9792a9daef4d978c5c30b6d10cbcdfa77a9b6ac
2022-03-31 05:16:43 +00:00
Kubernetes Publisher
488e9bb051 Merge pull request #109137 from wojtek-t/fix_multiple_values_indexer
Fix issues in indexer caused by object changing the number of index values

Kubernetes-commit: 2e55595d3baeedcab09745355824f38a60cf6d08
2022-03-30 13:13:25 +00:00
Michael Bolot
e540ebe994 Addresses the issue which caused #109115
Kubernetes-commit: cbbb5f70a47644f9830073d9d0329bf247a328a1
2022-03-29 12:35:13 -05:00
Wojciech Tyczyński
1cab68940f Add test for indexer with multiple values
Kubernetes-commit: 56159f258ca380600b0bc08b2e99cbc745db3560
2022-03-30 08:52:10 +02:00
Kubernetes Publisher
b1e85f6f00 Merge pull request #109031 from Jefftree/openapiv3beta
OpenAPI V3 Enable Beta

Kubernetes-commit: 904c30562a9a34d26ff3e76db29d00daea2e0f60
2022-03-30 05:13:30 +00:00
Abu Kashem
01ab7fb211 client-go: reset request body after response is read and closed
This commit refactors the retry logic to include resetting the
request body. The reset logic will be called iff it is not the
first attempt. This refactor is nescessary mainly because now
as per the retry logic, we always ensure that the request body
is reset *after* the response body is *fully* read and closed
in order to reuse the same TCP connection.

Previously, the reset of the request body and the call to read
and close the response body were not in the right order, which
leads to race conditions.

This commit also adds a test that verifies the order in which
the function calls are made to ensure that we seek only after
the response body is closed.

Co-authored-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 68c8c458ee8f6629eef806c48c1a776dedad3ec4
2022-03-28 20:40:49 -04:00
Jefftree
4fdf361910 generated: Update kube-openapi and vendor
Kubernetes-commit: 550d6383b5219ac43b8c86cf57807c47b82919aa
2022-03-28 13:20:46 -07:00
Kubernetes Publisher
9cfda74c80 Merge pull request #108032 from deejross/kep3140-cronjob-timezone
KEP 3140: TimeZone support for CronJob

Kubernetes-commit: 0f2300575c805bb70ba181957684361bcd25f86a
2022-03-30 01:13:24 +00:00
Shiming Zhang
0c14d0c485 Field status.hostIPs added for Pod (#101566)
* Add FeatureGate PodHostIPs

* Add HostIPs field and update PodIPs field

* Types conversion

* Add dropDisabledStatusFields

* Add HostIPs for kubelet

* Add fuzzer for PodStatus

* Add status.hostIPs in ConvertDownwardAPIFieldLabel

* Add status.hostIPs in validEnvDownwardAPIFieldPathExpressions

* Downward API support for status.hostIPs

* Add DownwardAPI validation for status.hostIPs

* Add e2e to check that hostIPs works

* Add e2e to check that Downward API works

* Regenerate

Kubernetes-commit: 61b3c028ba618a939559c39befb546ae5e5fd0b9
2022-03-29 21:13:35 +00:00
Ricardo Katz
94a1081faf Implementation on Network Policy Status (#107963)
* Implement status subresource in NetworkPolicy

* add NetworkPolicyStatus generated files

* Fix comments in netpol status review

Kubernetes-commit: 42a12010829962c6e87cee8e4bc217d39d7a8043
2022-03-29 09:13:14 +00:00
Kubernetes Publisher
11ca265357 Merge pull request #108992 from alexzielenski/cache-busting-client-go
client-go: OpenAPI v3 support

Kubernetes-commit: 656dc213ce43f1ecfa7f54eb1f01864468f8f0e2
2022-03-29 05:12:59 +00:00
Alexander Zielenski
fa08fc21f5 adjust comments
Kubernetes-commit: e9fc6c28a202ded0228e8505f5e14f5ec2049a3d
2022-03-28 18:40:34 -07:00
Kubernetes Publisher
92adc4de69 Merge pull request #82162 from krmayankk/maxun
API: maxUnavailable for StatefulSet

Kubernetes-commit: f85ff4b5743d501381c76b94a5bc6197b7766190
2022-03-29 01:13:02 +00:00
Ross Peoples
400b1becd3 make update after timeZone support for CronJob
Kubernetes-commit: d26e6cca7255c2c96ba28e8e5550bbc87a7577b9
2022-03-28 14:59:03 -05:00
Alexander Zielenski
27f72fc0bc update vendor
client-go depends on more of kube-openapi v3 now

Kubernetes-commit: bb799d97066bbae4eaacd2ecc2a57f7fd42fa142
2022-03-28 10:07:56 -07:00
Alexander Zielenski
018cf8ace6 add fetching into discovery client for OpenAPI v3
reflect latest struct changes

use correct discovery openapi test data layout

make the OpenAPIv3 interface less blue

field grouping

add copyrights

implement cached discovery client

add cached discovery tests

address review feedback

Kubernetes-commit: 075866b3e3ea029c243d82d8d6eb99e96d9c49d3
2022-03-22 10:40:56 -07:00
Andrew Stoycos
f19a514ff5 Fix Panic Condition
Currenlty an event recorder can send an event to a
broadcaster that is already stopped, resulting
in a panic.  This ensures the broadcaster holds
a lock while it is shutting down and then forces
any senders to drop queued events following
broadcaster shutdown.

It also updates the Action, ActionOrDrop,  Watch,
and WatchWithPrefix functions to return an error
in the case where data is sent on the closed bradcaster
channel rather than panicing.

Lastly it updates unit tests to ensure the fix works correctly

fixes: https://github.com/kubernetes/kubernetes/issues/108518

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>

Kubernetes-commit: 6aa779f4ed3d3acdad2f2bf17fb27e11e23aabe4
2022-02-11 14:50:19 -05:00
bells17
21f4308ca2 Fix typo: type -> eventtype
Kubernetes-commit: 53083ea6aa9817f130b15efaf8ccc2d0c59c4be3
2019-10-21 17:15:44 +09:00
Mayank Kumar
1a9591bb97 API: maxUnavailable for StatefulSet
Kubernetes-commit: 357203d992bb9b0cf9685f878d8635cf3277bef9
2019-08-30 00:05:18 -07:00
Kubernetes Publisher
402aa66c5c Merge pull request #108996 from cici37/errUpdate
Bump kube-openapi and update err handling

Kubernetes-commit: 898443f40583cd0fd864e9b11c8156faf64b680a
2022-03-27 01:12:39 +00:00
cici37
ef44f112db Bump kube-openapi
Kubernetes-commit: 383eb99bebdd5746732b7f6789907ea3598ee98e
2022-03-24 15:11:08 -07:00
Kubernetes Publisher
1933a66cdc Merge pull request #108505 from rikatz/kubectl-debug-not-showing-response
Reintroduce response status and header on kubectl verbose debug

Kubernetes-commit: bb3800f0225dcc025b9bb01f8525f99e5c36d5ce
2022-03-26 21:12:52 +00:00
Kubernetes Publisher
e0aaa37e5a Merge pull request #107180 from ardaguclu/remove-deprecated-serverresource
Remove deprecated discovery/ServerResources function

Kubernetes-commit: 0b79a791eda116199c40b13b21121274c56df374
2022-03-26 09:12:46 +00:00
Kubernetes Publisher
23ab4aec8e Merge pull request #108698 from tkashem/last-error
client-go: wrap previous error to provide more context to caller

Kubernetes-commit: 5af9afe201000ecc30251c3d9683016353b12e82
2022-03-26 01:12:38 +00:00
Kubernetes Publisher
ed2838156a Merge pull request #108531 from tallclair/redirects
Don't follow redirects with spdy

Kubernetes-commit: ea006f5246dded2db606dac7c642041cfbe1ccb1
2022-03-26 01:12:37 +00:00
Kubernetes Publisher
b307538aa1 Merge pull request #108159 from pohly/logcheck
logcheck update and golangci-lint integration

Kubernetes-commit: d60df5ba044fdb1cf20e4fc6d2ba45337d322052
2022-03-25 05:12:38 +00:00
Alex Zielenski
af0252eed9 Update kube-openapi (#108895)
* upgrade k8s.io/kube-openapi

* fix open-api v3 blank aggregator output

* use keys as API group

in ./hack/update-openapi-spec.sh

* fix import grouping

* update openapiv3 integration tests

Kubernetes-commit: 11b3a18cca745485e1033be8d62a1d0cde5a1d1d
2022-03-24 21:12:21 +00:00
Kubernetes Publisher
f4f092dbe0 Merge pull request #108981 from liggitt/skip-race
Temporarily disable TestCheckRetryClosesBody

Kubernetes-commit: 221b60fb82fc0a6de3034e342de99223a04585bb
2022-03-24 17:12:29 +00:00
Kubernetes Publisher
97bcbe7548 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel Gopkg.toml */.gitattributes 2022-03-24 17:12:27 +00:00
Jordan Liggitt
83029168cc Temporarily disable TestCheckRetryClosesBody
Kubernetes-commit: 9c13a27d182c36296b7f2e381970b82c69d5c405
2022-03-24 10:11:06 -04:00
Kubernetes Publisher
cf06297a89 Merge pull request #108725 from pohly/klog-flush-and-exit
klog v2.60.1

Kubernetes-commit: 56f45c5c811ba23934915b1a1330d87c58bddf07
2022-03-24 09:12:44 +00:00
Kubernetes Publisher
d82e1fd884 Merge pull request #108717 from lavalamp/remove-clustername
Remove ClusterName

Kubernetes-commit: bb67b5e9e830fba239c1e7957e5dcbefdce92a37
2022-03-24 09:12:41 +00:00
Kubernetes Publisher
c012194d06 Merge pull request #108342 from tkashem/rate-limit-error
client-go: chain the error returned by rate limiter

Kubernetes-commit: 7dde0b4bb56d04240f75eff01034a2c5a7abab77
2022-03-24 01:21:59 +00:00
Kubernetes Publisher
a1a133ba90 Merge pull request #108445 from pohly/storage-capacity-ga
storage capacity GA

Kubernetes-commit: 24a71990e02edbfd0a05f4abfdedcab991525874
2022-03-23 17:07:24 +00:00
Kubernetes Publisher
c55e66b5a8 Merge pull request #108680 from kidlj/fix_cache_index_comments
make comments of `(c *threadSafeMap) updateIndices` optimization code more accurate

Kubernetes-commit: 29528a266a42bb34768db6944367946df5b0dcf6
2022-03-22 05:07:43 +00:00
Kubernetes Publisher
dedf7ce61c Merge pull request #108852 from mikedanese/auth-plugin-doc
add better link for gcp auth plugin doc

Kubernetes-commit: afb0136d6235201a89a426f071b8957a5a1b79ef
2022-03-21 14:20:44 -07:00
Mike Danese
f624f8e770 add better link for gcp auth plugin doc
Kubernetes-commit: 6a8579d1cd3ddeea6c012a4c0fdb7e32687a83f1
2022-03-21 09:48:27 -07:00
Kubernetes Publisher
3ac142e26b Merge pull request #108616 from margocrawf/delete-execcredential-v1alpha1
Remove v1alpha1 of the execcredential

Kubernetes-commit: b9817c801bcbf9efbea8da1a5b68c83b3ee4ace6
2022-03-19 17:14:34 +00:00
Kubernetes Publisher
c47b802895 Merge pull request #108772 from aojea/user_agent
client-go: default user agent if empty

Kubernetes-commit: b0c435c8c48587edaeade94937525e03ccff9167
2022-03-19 17:14:33 +00:00
Margo Crawford
70889063d2 Generated code for deleting exec credential v1alpha1 api
Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: 38cbe6d7fe0f2536883485a1c36f345a4eafcc79
2022-03-18 10:16:58 -07:00
Margo Crawford
28b9e26d5f Remove v1alpha1 of the execcredential
Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: 5b690b44d08807c6434a421b0041ef685482d337
2022-03-18 10:16:11 -07:00
Daniel Smith
a34beeba71 generated files
Kubernetes-commit: fad4ba2a34525c4831f89483e696509a88c45ce6
2022-03-17 18:27:49 +00:00
Daniel Smith
14e253c7f8 remove unneeded references
Kubernetes-commit: 2831f9a343ec405efce60d09da482a654971018e
2022-03-17 18:35:00 +00:00
Antonio Ojea
0f3c7919bf client-go: update generated
Kubernetes-commit: 1d5ad2264cbebe2ce33e288451c2757fa16a1956
2022-03-17 16:03:10 +01:00
Antonio Ojea
7390aacfeb default kubernetes agent for generated clients
Set default kubernetes agent if empty

Kubernetes-commit: c732bb8348b6ef4acc3ac7d006d56e6956141dd5
2022-03-17 13:19:43 +01:00
Kubernetes Publisher
6889a6b513 Merge pull request #108644 from Jefftree/googleapis-gnostic
googleapis/gnostic -> google/gnostic and update kube-openapi

Kubernetes-commit: b195a64d45e1880878a22d178055f1b4220dcb43
2022-03-17 02:24:26 +00:00
Patrick Ohly
2bba973d33 klog v2.60.1
The new release supports FlushAndExit and contextual logging.

Kubernetes-commit: 09aa1071cdde5ebc2c931c994fbb1e974c2a1515
2022-03-16 09:03:45 +01:00
Jefftree
186c332c7b googleapis/gnostic -> google/gnostic
Kubernetes-commit: 8a1d5947ad34ba275192341baa4e5fef8e6c7f24
2022-03-15 20:36:21 -07:00
Abu Kashem
7c9347d386 client-go: wrap error from previous attempt to provide more context
Kubernetes-commit: 868b5a31d382b325f49e1b831e6b094282d50cc7
2022-03-14 18:57:56 -04:00
Kubernetes Publisher
ab732f5dd6 Merge pull request #107674 from sanposhiho/api-min-domains
Add MinDomains API to TopologySpreadConstraints field

Kubernetes-commit: 5b52c4d12772c65ff5896f9268b4a4ca58a66995
2022-03-14 18:12:18 +00:00
Jian Li
6b59aa0b4a make comments of updateIndices optimization code more accurate
Kubernetes-commit: 0eae1f3addbd044793dac89f9e097e5f4c6fb2aa
2022-03-14 13:56:17 +08:00
Tim Allclair
8c38cf359a Don't follow redirects with spdy
Kubernetes-commit: e1069c64956a43f628d8ae2fcd9107959747c1c6
2022-03-04 16:08:58 -08:00
Ricardo Katz
9c049623c2 Reintroduce response status and header on kubectl verbose debug
Kubernetes-commit: 04b240ac0d16f0d5c8cc0c06ebd8ff1433ca8469
2022-03-04 11:39:53 -03:00
Patrick Ohly
6ece0de2d5 storage capacity: generated files
Kubernetes-commit: b1aefb9b90094ec4625ef2eefab7185fe4db9368
2022-03-02 07:43:19 +01:00
Abu Kashem
147848c452 client-go: chain the error returned by rate limiter
Kubernetes-commit: 6acbe7e6452a44057768c61909da2d5b7c878159
2022-02-24 17:28:01 -05:00
sanposhiho
b32b6a7d22 Add MinDomains API to TopologySpreadConstraints field
Kubernetes-commit: 3b13e9445a3bf86c94781c898f224e6690399178
2022-02-23 21:11:59 +09:00
Kubernetes Publisher
2f52a105e6 Merge pull request #107410 from margocrawf/master
Ensure static certs in kubeconfig override exec plugin

Kubernetes-commit: 19935de5a9a4196f23f9a90cd9b7acb79091e3c2
2022-03-08 22:11:44 +00:00
Kubernetes Publisher
0a04e978b0 Merge pull request #108426 from deads2k/e2e-check
add resource enablement check for e2e tests of beta APIs

Kubernetes-commit: f93be6584ea57d1d01a0ca1d2c5e96782713d311
2022-03-07 22:11:59 +00:00
Kubernetes Publisher
eb103e0abf Merge pull request #108347 from tkashem/refactor
client-go: refactor retry logic for backoff, rate limiter and metric to be reused by Watch, Stream, and Do

Kubernetes-commit: 52cd4d53ac8ac33cacd3d2c618cf22f1e3fd6a7e
2022-03-03 04:25:47 -08:00
David Eads
7d7fd497a0 add resource enablement check for e2e tests of beta APIs
Kubernetes-commit: 8ab8d05cc40c391f8ac650f50f23500666bfc943
2022-03-01 11:51:16 -05:00
Abu Kashem
34f3aff43e client-go: refactor retry logic for backoff, rate limiter and metric
Kubernetes-commit: cecc563d3b9a9438cd3e6ae1576baa0a36f2d843
2022-02-17 16:57:45 -05:00
Kubernetes Publisher
8e46da3fd1 Merge pull request #108296 from aojea/client_go_size_metrics
client-go: add request and response size metrics

Kubernetes-commit: 5ee80dee042d9b83a20031469606af0d2fb8d815
2022-03-01 02:06:30 +00:00
Patrick Ohly
9175c47d17 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.

Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
2022-02-16 12:17:47 +01:00
Arda Güçlü
7e062f8fa4 Remove deprecated discovery/ServerResources function
ServerResources function was deprecated and instead ServerGroupsAndResources
function is suggested.

This PR removes ServerResources function and move every place to use ServerGroupsAndResources.

Kubernetes-commit: ef39a8914291ba200bd5486c88a7575ffd4b7d1d
2021-12-22 11:14:09 +03:00
Antonio Ojea
e2c62ff0c0 client-go: add request and response size metrics
Get metrics for the request and response  size, so we can correlate latency
and size on a request, otherwise we could get confused because we don't know if the
network is slow or just the request size huge.

Kubernetes-commit: 64d9d0585f6dbc9266f31b6d0f795d6c0421495e
2021-12-09 12:11:01 +01:00
Kubernetes Publisher
cc43a708a0 Merge pull request #108262 from tkashem/retry-unit-test
client-go: add unit test to verify order of calls with retry

Kubernetes-commit: 08d32851fec349175f1e7bb84e5690cad39ec5e1
2022-02-23 22:09:19 +00:00
Kubernetes Publisher
5463dac0a9 Merge pull request #106911 from aojea/client_go_metrics
Update client-go latency metrics bucket

Kubernetes-commit: 25ccc48c606f99d4d142093a84764fda9588ce1e
2022-02-23 22:09:18 +00:00
Abu Kashem
e4ecde2cf0 client-go: add unit test to verify order of calls
Kubernetes-commit: f6a66bbe051d2c7d537cf9033cc800babbb1a74b
2022-02-21 13:53:23 -05:00
Antonio Ojea
83bb1e3ff2 client-go: remove no longer used finalURLTemplate
The restclient metrics were updated to track only the host field of the
url, the finalURLTemplate is not longer needed, its only goal was to
replace name and namespace in the path to avoid cardinality.

Kubernetes-commit: bebf5a608f68523fc430a44f6db26b16022dc862
2022-02-17 16:51:55 +01:00
Kubernetes Publisher
41e0447e77 Merge pull request #107105 from justaugustus/go118
golang: Update to go1.18rc1

Kubernetes-commit: bda996e6a7cd115d76ebf1e0c127bee68e06269a
2022-02-21 18:05:47 +00:00
Stephen Augustus
dade88bed7 generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh
Also runs:
hack/pin-dependency.sh golang.org/x/mod \
  v0.6.0-dev.0.20220106191415-9b9b3d81d5e3

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 4b1bd548bbe4d71609c65b050b69f63af1ca81d1
2021-12-18 15:55:39 -05:00
Stephen Augustus
50aa9bbadb [go1.18] Bump golang.org/x/... dependencies
hack/pin-dependency.sh golang.org/x/crypto master
hack/pin-dependency.sh golang.org/x/net master
hack/pin-dependency.sh golang.org/x/oauth2 master
hack/pin-dependency.sh golang.org/x/sync master
hack/pin-dependency.sh golang.org/x/sys master
hack/pin-dependency.sh golang.org/x/term master
hack/pin-dependency.sh golang.org/x/time master
hack/pin-dependency.sh golang.org/x/tools master

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: e6e7a42480f235949a11e0f14a3b8a60ba43bcb0
2021-12-18 15:41:57 -05:00
Kubernetes Publisher
a7d2e01180 Merge pull request #107527 from wojtek-t/remove_selflink_ga
Graduate RemoveSelfLink to Stable

Kubernetes-commit: e42e2e877f01d28d886ebe5b855ff0f16ffca680
2022-02-15 06:05:21 +00:00
Wojciech Tyczyński
dd71ff2e39 Autogenerated
Kubernetes-commit: d63b79ec47171a1b83fea162e26f7ba521e3c20e
2022-01-19 17:55:39 +01:00
Kubernetes Publisher
b74c541cff Merge pull request #108059 from RaghavRoy145/k8s-utils-update
Vendor in k8s.io/utils Changes

Kubernetes-commit: 8bae9bea45de30cc8eb3a3da604abd01376ffbd8
2022-02-11 18:05:21 +00:00
Raghav Roy
6f7b0ae69e Updated k8s.io/utils dependency
Signed-off-by: Raghav Roy <raghavroy145@gmail.com>

Kubernetes-commit: e167d44a173991422b748afe1b9ed9a82bf6efa4
2022-02-11 13:03:54 +05:30
Kubernetes Publisher
6964e37acf Merge pull request #107834 from SataQiu/fix-applyconfiguration
code-generator: fix the bug that ApplyConfiguration constructor missing WithKind/WithAPIVersion methods

Kubernetes-commit: 20a2a4c1af861be8581d63284a68d2dd9454b484
2022-02-08 21:56:16 +00:00
Kubernetes Publisher
4c892f8a5d Merge pull request #107812 from diyi0926/add-field-path-back-to-event-logs
add fieldPath back to event logs

Kubernetes-commit: 834349ed1979073b4f6ed3e16393d31c19008701
2022-02-08 17:54:48 +00:00
Kubernetes Publisher
8f44946f6c Merge pull request #107876 from jlsong01/fix-concurrent-scheme-usage
Fix concurrent usage issue of the same scheme

Kubernetes-commit: cf9b5ab95a21e5b32b6aff72492a18ede37b785b
2022-02-02 09:20:21 -08:00
jlsong01
470c93d04c allocate a unique scheme for each test to fix concurrent usage issue
Kubernetes-commit: d66b3edd65efba0760eb0a5668aac733f294903b
2022-01-31 15:23:42 +08:00
Kubernetes Publisher
af150e1667 Merge pull request #107904 from sabbey37/update_azure_auth
Update azure auth plugin deprecation to warning

Kubernetes-commit: a4f559bfe10532bee534fefcaf4e6cc21c1e466c
2022-02-03 06:02:30 +00:00
sabbey37
f4bf7599b4 Update azure auth plugin deprecation to warning
Kubernetes-commit: c94b4bb2acd11bc0677eb867e6eff5b36bd205b4
2022-02-01 15:31:10 -05:00
SataQiu
1f90b31573 code-generator: fix the bug that ApplyConfiguration constructor missing WithKind/WithAPIVersion methods
Kubernetes-commit: ce50eed94122b780c8e438c3cb30a76fd2012464
2022-01-28 17:01:32 +08:00
Di Yi
5b56e4a504 resolve casing issue
Kubernetes-commit: 9996c154cba000346db940c90e234265d67dd8a9
2022-01-28 15:50:43 +08:00
Di Yi
93a63158d4 add fieldPath back to event logs
Kubernetes-commit: 94245af8f4a144e0aceb5a4be0d3ae4993e19be7
2022-01-27 14:28:26 +08:00
Kubernetes Publisher
7f04550960 Merge pull request #107507 from alexzielenski/client-preprocess-handler
Add configuration point to SharedInformer to transform objects before storing

Kubernetes-commit: f4046f9e6d0bb2fc4fa2d84af64cc9c6db44270a
2022-01-25 01:21:53 +00:00
Kubernetes Publisher
3255cdcd9c Merge pull request #105632 from xens/fix/kubectl-socks5-proxy2
Add SOCKS5 proxy support for kubectl exec

Kubernetes-commit: d10161b45b751df45701e343599476e27d533d58
2022-01-22 01:21:55 +00:00
Alexander Zielenski
54928eef9f modify SharedIndexInformer to use newInformer constructor which supports transformers
avoids code duplication, allows transformer to be used with SharedIndexInformer

Kubernetes-commit: 754bf3b3d02c66d1dd030460b03dddd3d6c7196d
2022-01-19 11:40:42 -08:00
Romain Aviolat
f157a09b37 feat: add missing SOCKS5 features
Goal of this commit is to add some missing features when the
Kubernetes API is accessed through a SOCKS5 proxy. That's for
example the case when port-forwarding is used (`kubectl port-forward`)
or when exec'ing inside a container (`kubectl exec`), with this
commit it'll now be possible to use both.

Signed-off-by: Romain Aviolat <romain.aviolat@kudelskisecurity.com>
Signed-off-by: Romain Jufer <romain.jufer@kudelskisecurity.com>

Kubernetes-commit: 0a98875e9572d998fbdf3bcdaef4961715b8bc06
2022-01-17 15:28:44 +01:00
Kubernetes Publisher
b70ee0aa9a Merge pull request #105142 from pacoxu/cespare-2.1.2
upgrade github.com/cespare/xxhash/v2 to v2.1.2

Kubernetes-commit: 8d0d428ddd1cdc5f7ec9ead400921fb697aced95
2022-01-21 01:22:16 +00:00
Kubernetes Publisher
909a4591e8 Merge pull request #107559 from liggitt/invalid-selectors
Handle invalid selectors properly

Kubernetes-commit: 184daed0dbb6b9adac82b7b8b58f5cee0935d152
2022-01-20 01:21:48 +00:00
-e
ae5b2b8fbf upgrade prometheus/client_golang to v1.12.0(common to v0.32.1)
Kubernetes-commit: 8a4e66049edd6ade4e9107b4ea092580b626545a
2022-01-19 22:30:33 +08:00
Ismayil Mirzali
664b1a6c8c client-go: refactor: Fix styling issues (#107248)
* client-go: Remove unreachable return

Due to the way the switch statement is done,
the return at the end of the function will neverbe reached.

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

* client-go: Refactor for clarity

Fixed one instance where the error message should be lowercase.
Made the fields in the struct literal more explicit

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

Kubernetes-commit: 75c0987de3cb9a0380873745f68dea2f0835a7a2
2022-01-18 12:03:08 +02:00
Kubernetes Publisher
3618ec55f4 Merge pull request #107551 from wojtek-t/remove_unused_selflink_test_references
Remove unused selflink references in different testing-related files

Kubernetes-commit: a4931cc411002f2e992caadb8e128e807dc2d672
2022-01-15 01:21:43 +00:00
Kubernetes Publisher
092b54e6e5 Merge pull request #107565 from jiahuif-forks/deps/structured-merged-diff
upgrade sigs.k8s.io/structured-merge-diff/v4 to v4.2.1

Kubernetes-commit: cf18d80d035780739575b8cc889e8f26bf36779f
2022-01-14 21:25:08 +00:00
Jiahui Feng
61ce20e08d generated: ./hack/update-vendor.sh
Kubernetes-commit: 31205dc7d9b271ede68ef90d09f416588ea3afdd
2022-01-14 10:31:44 -08:00
Jiahui Feng
3c9082ae5b upgrade sigs.k8s.io/structured-merge-diff/v4 to v4.2.1
Kubernetes-commit: 821912a75198f0d516fc2744bed335afac8034e9
2022-01-14 10:30:23 -08:00
Jordan Liggitt
aab0bb899e Handle invalid selectors properly
Kubernetes-commit: c0af728f43025bb47b209ebbb45604f9c0424354
2022-01-14 11:41:07 -05:00
Kubernetes Publisher
07be351f6b Merge pull request #105387 from howardjohn/metadata-client/tracker
Make metadata fake client implement testing.FakeClient

Kubernetes-commit: 35c8975710e9cc50a0fc14383d1004dde86c854e
2022-01-14 05:25:34 +00:00
Kubernetes Publisher
23e2d9e87e Merge pull request #107293 from dims/jan-1-owners-cleanup
Cleanup OWNERS files - Jan 2021 Week 1

Kubernetes-commit: 3bd422dc76559c1e03e8aea894c6143d32ebd644
2022-01-13 21:21:38 +00:00
Wojciech Tyczyński
a806c6e4fd Remove selflink references in different testing-related files
Kubernetes-commit: 551790729f1d26d75c1d3fa1411e341eb367f9f3
2022-01-13 11:33:26 +01:00
Davanum Srinivas
3bf0eac274 OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9682b7248fb69733c2a0ee53618856e87b067f16
2022-01-03 10:59:47 -05:00
Kubernetes Publisher
b025abaeaa Merge pull request #107420 from 21kyu/fix-typos
fix typos in comment

Kubernetes-commit: ba82add41a06d1fceeaf01fc71d3d5da910c41d9
2022-01-10 09:20:52 +00:00
wq
3480737c9e fix typos in comment
Kubernetes-commit: 3e2932179084fa322ba1bc53997d44e1d383db00
2022-01-08 23:39:23 +09:00
Kubernetes Publisher
255c796513 Merge pull request #93709 from ash2k/ash2k/interruptible-sleep
Make RetryWatcher sleep interruptible

Kubernetes-commit: 04f2beea8abfb8ece2fb4fdd4e3ecc694caf2494
2022-01-05 17:20:55 +00:00
Kubernetes Publisher
6524542499 Merge pull request #106547 from astraw99/fix-log-typo
Fix log blank typo to avoid en/decode issues

Kubernetes-commit: 6d6ebfbe2473e405e6cf2607f38b1b72a38024cc
2022-01-05 09:20:46 +00:00
Kubernetes Publisher
8344b1c856 Merge pull request #107311 from fasaxc/fix-resource-ver-match
client-go: Clear the ResourceVersionMatch on paged list calls

Kubernetes-commit: b0f0aad2cedc1168bc44387e5a3d6d7745ae580b
2022-01-04 21:21:10 +00:00
Shaun Crampton
5754d8fddf client-go: Clear the ResourceVersionMatch on paged list calls
API server rejects continuations with ResourceVersionMatch set.

Kubernetes-commit: 8ac5e9b065cd9aef1543080cce1cf99cc8bb4ce9
2022-01-04 16:05:32 +00:00
Kubernetes Publisher
782ff783b6 Merge pull request #107103 from pohly/log-klog-update
dependencies: update klog to v2.40.1

Kubernetes-commit: 38ec822b46853acfb3c3dc7e386a8d4636c67e03
2021-12-22 01:20:41 +00:00
Arda Güçlü
a6257fdee4 Enable setting proxyurl in kubeconfig via kubectl config (#105566)
* Enable setting proxyurl in kubeconfig via kubectl config

This PR enables setting `proxy-url` in kubeconfig via kubectl config.

* Add godoc for proxy-url unit tests

Kubernetes-commit: afdde383210294c3da573decc44b5ce55cffcb94
2021-12-20 21:21:02 +00:00
Patrick Ohly
416ac20107 dependencies: update klog to v2.40.1
The new release adds support for multi-line string output (required for
contextual logging) and Verbose.InfoSDepth (required to properly attach
verbosity to some log messages in helper code).

Kubernetes-commit: cb17b76d4d0a1c8021b427cd15b5d504bb468ee6
2021-12-17 14:23:59 +01:00
Kubernetes Publisher
d7ed9408c8 Merge pull request #106436 from dims/cleanup-owners-files-no-activity-in-a-year
Cleanup OWNERS files (No Activity in the last year)

Kubernetes-commit: 1426587e0874cbbddee4dc6a13bb5213b0a7609b
2021-12-15 21:27:35 +00:00
Kubernetes Publisher
6096096391 Merge pull request #106934 from spencer-p/spencer-master
Document when workqueue metrics are dropped

Kubernetes-commit: a88462e901710ab5df1fa6e99a046aa921dcdd55
2021-12-15 01:20:40 +00:00
Kubernetes Publisher
056a9de353 Merge pull request #106568 from liggitt/json-fieldpath
include field paths in unknown/duplicate errors

Kubernetes-commit: 66ca4b0a70a3d43c45603ba441b2a368dcb38722
2021-12-13 17:19:58 +00:00
Jordan Liggitt
df7985199b bump sigs.k8s.io/json
Kubernetes-commit: 0c5ed62c792826a547dd5a55639de150080c355b
2021-12-13 09:38:11 -05:00
Davanum Srinivas
73f2731e23 Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Kubernetes Publisher
80a3c86bdd Merge pull request #106949 from cpanato/update-golang-xnet
dependencies: Update golang.org/x/net to v0.0.0-20211209124913-491a49abca63

Kubernetes-commit: b0eb3e1ec2d4268604d9a2c3403f0580a3bda2ec
2021-12-10 17:24:25 +00:00
Kubernetes Publisher
6919fc571d Merge pull request #106458 from dims/lint-yaml-in-owners-files
Lint/Beautify yaml in OWNERS files

Kubernetes-commit: 1d66302c42eb2ecf53b29cafb0c9f751bfbd1cd3
2021-12-10 17:24:22 +00:00
Carlos Panato
b63089930a dependencies: Update golang.org/x/net to v0.0.0-20211209124913-491a49abca63
Signed-off-by: Carlos Panato <ctadeu@gmail.com>

Kubernetes-commit: 37dda91186924fc29acc16c1c0743ed747cf6d6c
2021-12-10 12:54:55 +01:00
Kubernetes Publisher
b945f6e77e Merge pull request #106921 from dims/update-x/tools-to-v0.1.8
Update golang.org/x/tools to a specific tag (v0.1.8) and avoid SHA

Kubernetes-commit: cc6f12583f2b611e9469a6b2e0247f028aae246b
2021-12-10 09:31:31 +00:00
Davanum Srinivas
70f09c4943 Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
Spencer Peterson
5a537879c2 Document when workqueue metrics are dropped
Two simple choices for workqueues do not document that they do not emit
metrics. Using their named variants fixes this, but was undocumented.

Change-Id: I100ad08a4859513987941ed35d12abb4cbb39873

Kubernetes-commit: f468bee672b0ccf9b97a85f17ec1f5645aced926
2021-12-09 16:59:54 -08:00
Kubernetes Publisher
096f1fdd87 Merge pull request #106852 from wojtek-t/remove_legacy_leader_election
Remove support for Endpoints and ConfigMaps lock from leader election

Kubernetes-commit: 12b4bef7bd7ccd6cecd01d3b0b5b8fd31dba9535
2021-12-09 21:10:38 +00:00
Davanum Srinivas
464c8e2c41 Update golang.org/x/tools to a specific tag and avoid SHA
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 627c50661e988ad8ac0708b1d94fdfc385e88449
2021-12-09 14:20:03 -05:00
Kubernetes Publisher
cbd965eeb4 Merge pull request #106850 from MadhavJivrajani/deprecate-clock-pkg
Deprecate types in k8s.io/apimachinery/util/clock

Kubernetes-commit: c16b2afc1d3c32462f068ea08cdc4791bd97b947
2021-12-09 17:09:23 +00:00
Madhav Jivrajani
110639035d Bump k8s.io/utils
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 4ca13e6f0ee3ee66d863203cb2d042842dc88cd7
2021-12-09 16:16:27 +05:30
Kubernetes Publisher
8bffd27f0a Merge pull request #106473 from Dingshujie/fix_inotify_memory_leak
update k/utils to v0.0.0-20211116205334-6203023598ed to fix inotify memory leak

Kubernetes-commit: a8e06cf2bfd2ecdde0f2f49af4df29f70e07f20e
2021-12-09 05:10:34 +00:00
Kubernetes Publisher
c713f38723 Merge pull request #106153 from hyschumi/refactor_thread_safe_store
refactor: remove dup code

Kubernetes-commit: e9fc46750f6da84d9434a8066d7d2ba1531c5d67
2021-12-08 05:04:35 +00:00
Margo Crawford
2b59dabd4c Check whether static cert is already configured in UpdateTransportConfig
- Also update test-cmd.sh to pass a signing ca to the kube controller
  manager, so CSRs work properly in integration tests.

Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: f015fd66ce95d02cd66efc263eb9e5441b42a17d
2021-12-07 15:58:46 -08:00
Wojciech Tyczyński
276ea3ed97 Remove support for Endpoints and ConfigMaps lock from leader election
Kubernetes-commit: 29d9683cd0fb3cc81810a8b39715e5eb4c68b00e
2021-12-07 16:38:32 +01:00
Kubernetes Publisher
d85d0d914a Merge pull request #106774 from SergeyKanzhelev/grpcFieldRename
Grpc field rename

Kubernetes-commit: 0fe049cb93683e488b9829316ac889bc4c2e42fc
2021-12-03 09:07:26 +00:00
Sergey Kanzhelev
2f5ae78650 generated files for the grpc field rename
Kubernetes-commit: 4c9d77d724069ec56140b686d3e8e280f5ab0274
2021-12-01 18:25:37 +00:00
Kubernetes Publisher
91177d7e4d Merge pull request #106716 from aojea/http1_flake_timeout
bump TestHTTP1DoNotReuseRequestAfterTimeout timeout

Kubernetes-commit: c1153d3353bd4f4b68d85245d53d2745586be474
2021-11-29 13:23:22 -08:00
Antonio Ojea
115ee0e475 bump TestHTTP1DoNotReuseRequestAfterTimeout timeout
the test TestHTTP1DoNotReuseRequestAfterTimeout has to wait for
request to time out to assert that subsequent requests does not
reuse the TCP connection.

It seems that current value of 100ms causes issues on some CI
environments and bumping the timeout seems to solve this flakiness,

We can bump the timeout value because is really low compared to real
scenarios and the bump still keeps it in the millisecond order.

Kubernetes-commit: 85797eba7075d83b116b5c91ff3b17c2d5118d01
2021-11-29 15:37:31 +01:00
Kubernetes Publisher
1218545a5b Merge pull request #106660 from liggitt/smd-merge
Revert sigs.k8s.io/structured-merge-diff/v4 to v4.1.2

Kubernetes-commit: aff056d8a197f6a404ad5e02210ca662d16c3dbe
2021-12-03 09:07:23 +00:00
DingShujie
c8a8ad54a6 update k/utils to v0.0.0-20211116205334-6203023598ed
Kubernetes-commit: 25cf49770c8a91a837aa7e791eb2b177305d9610
2021-11-25 09:29:03 +08:00
Jordan Liggitt
38ad836227 Revert sigs.k8s.io/structured-merge-diff/v4 to v4.1.2
Kubernetes-commit: ed68909177eca588731bc153d2f69dd235e8fe10
2021-11-24 10:32:24 -05:00
Kubernetes Publisher
0e6a989bc4 Merge pull request #99728 from mattcary/control
StatefulSet PVC auto-delete implementation

Kubernetes-commit: b8af116327cd5d8e5411cbac04e7d4d11d22485d
2021-12-03 09:07:22 +00:00
astraw99
a8ff96d887 fix log typo
Kubernetes-commit: abce7ab534d0c667dd1438ff24bb3130d17d3f6e
2021-11-19 11:06:14 +08:00
hyschumi
547d6c809a refactor: remove dup code
Signed-off-by: hyschumi<msliudongsheng@gmail.com>

Kubernetes-commit: da5d0a72d9d2a0948e21b746a8c6951dc40c0ce9
2021-11-04 21:11:53 +08:00
John Howard
f582d43dbd Make metadata fake client implement testing.FakeClient
This mirrors most (maybe all?) other fake clients. Example of a real
world use case this would have been useful:
https://github.com/istio/istio/pull/35434

Kubernetes-commit: 86c9fef160b37ce834b680e49cf237917d2e5c6c
2021-09-30 16:32:23 -07:00
Mikhail Mazurskiy
7a08020ed2 Make sleep interruptible
Kubernetes-commit: b705a521d8814b38faabea218097cac65d6ab5c5
2021-08-21 12:20:30 +10:00
Matthew Cary
b4c5f2944a tests for statefulset PersistentVolumeClaimDeletePolicy api change
Kubernetes-commit: f1d5d4df5a786a3387e1f39f59941f2c6fb4299d
2021-03-01 16:10:16 -08:00
Sergey Kanzhelev
f1d7f5c8cd Merge pull request #106463 from SergeyKanzhelev/grpcProbe
Implement grpc probe action

Kubernetes-commit: e4952f32b79b69bfa9333ff9da26a2da13859148
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-02 20:41:52 -05:00
Kubernetes Publisher
ad95a77727 Merge pull request #106660 from liggitt/smd-merge
Revert sigs.k8s.io/structured-merge-diff/v4 to v4.1.2

Kubernetes-commit: aff056d8a197f6a404ad5e02210ca662d16c3dbe
2021-11-24 23:25:22 +00:00
Jordan Liggitt
a1540622fe Revert sigs.k8s.io/structured-merge-diff/v4 to v4.1.2
Kubernetes-commit: ed68909177eca588731bc153d2f69dd235e8fe10
2021-11-24 10:32:24 -05:00
Kubernetes Publisher
10e087ca39 Merge pull request #99728 from mattcary/control
StatefulSet PVC auto-delete implementation

Kubernetes-commit: b8af116327cd5d8e5411cbac04e7d4d11d22485d
2021-11-18 15:25:16 +00:00
Matthew Cary
475f2c775f tests for statefulset PersistentVolumeClaimDeletePolicy api change
Kubernetes-commit: f1d5d4df5a786a3387e1f39f59941f2c6fb4299d
2021-03-01 16:10:16 -08:00
Kubernetes Publisher
2a70348ebb sync: update go.mod 2021-11-17 23:36:44 +00:00
Kubernetes Publisher
51a4fd4aee Merge pull request #106448 from aojea/hlee/issue-103721/staticcheck
use golangci-lint

Kubernetes-commit: 1367cca8fd67b09606b01c0a9e46cef59aef3424
2021-11-17 19:25:29 +00:00
Kubernetes Publisher
cc8a98c5db Merge pull request #103526 from brianpursley/kubectl-686
Close connection and stop listening when port forwarding errors occur so that kubectl can exit

Kubernetes-commit: cd6ffff85d257ff9067d59339f2ffdbcc66dc164
2021-11-17 19:25:27 +00:00
Kubernetes Publisher
3f38fd30fc Merge pull request #105623 from ash2k/ash2k/resettable-rest-mapper
ResettableRESTMapper to make it possible to reset wrapped mappers

Kubernetes-commit: 165b581759794157b4f4b8d7dfe2501d0e965ff4
2021-11-17 03:24:57 +00:00
Kubernetes Publisher
e2c9d634d6 Merge pull request #105057 from jiahuif-forks/feature/enum-types-feature-enablement
Add Support for OpenAPIEnum in OpenAPI v2

Kubernetes-commit: e14bdbaa1c4ed2b31dbce1b03160402483d26889
2021-11-17 03:24:55 +00:00
brianpursley
f5d063cf7a close streamConn and stop listening when an error occurs while port forwarding
Kubernetes-commit: 4a35e6c5641ee36291548c9c24b5b85663d5cd07
2021-11-16 21:05:43 -05:00
Kubernetes Publisher
d9ceca5871 Merge pull request #106154 from gnufied/recover-expansion-failure-123
Recover expansion failure

Kubernetes-commit: f151a40d8d8ac92b0b49fbdf3a9d3a1f8b3282bb
2021-11-16 23:25:31 +00:00
Antonio Ojea
34c99305b5 remove unused fakeUpgradeConnection
Kubernetes-commit: bf9ce7fd76068903e909358d2b25b05da7e4a431
2021-11-16 22:54:18 +01:00
Kubernetes Publisher
28b1932f62 Merge pull request #104844 from aojea/clientgo_close_idle
CloseIdleConnections of wrapped Transport RoundTrippers

Kubernetes-commit: 45f77ca4bab08da88bdda267be2157dc10bc64ac
2021-11-16 19:25:14 +00:00
Antonio Ojea
d62dc4e20e no lint unused variables
Kubernetes-commit: 0019f986130fdd8ca17c6e5511b15168d9181b1e
2021-11-16 19:00:31 +01:00
Antonio Ojea
2e69bf9be0 fix unassigned error on client-go test
Kubernetes-commit: 01a0fba3620c433f49120d82f908069281482a17
2021-11-16 16:58:52 +01:00
Antonio Ojea
5b8ad0da8e migrate nolint coments to golangci-lint
Kubernetes-commit: d126b1483840b5ea7c0891d3e7a693bd50fae7f8
2021-11-16 16:57:58 +01:00
Jiahui (Jared) Feng
0ed96f33a9 generated: ./hack/update-vendor.sh
Kubernetes-commit: 73ffb492032896c1c87edfa1d85de5fc74bb526c
2021-11-15 15:54:59 -08:00
Kubernetes Publisher
2f764f976b Merge pull request #106399 from justinsb/populate_event_typemetad
leaderelection: populate the apiVersion/kind when reporting events

Kubernetes-commit: ed3d9f7b48290d26ea617b2af40188e397987ac6
2021-11-15 09:05:00 -08:00
Justin SB
ecfd45a4d9 leaderelection: populate the apiVersion/kind when reporting events
This avoids the assumption that the kinds are populated in the schema,
and is arguably a little more efficient also.

Kubernetes-commit: 3bf06ff3a15a2f1fefeb7a70373a92cb4b94818f
2021-11-13 11:14:02 -05:00
Hemant Kumar
c643e47235 Implement API changes necessary for recovery from resize failure
Kubernetes-commit: 63fffd37b1f39a661d00b5ed11097c616850a80d
2021-11-12 11:00:57 -05:00
Kubernetes Publisher
e627be7959 Merge pull request #106234 from jpbetz/cel-libs
Add wired off code for Validation rules for Custom Resource Definitions using the CEL expression language

Kubernetes-commit: 6b41d75794381487ef7204b016faa75e350a32b7
2021-11-11 07:32:27 +00:00
Joe Betz
8d0429e649 Pin new dependency: github.com/google/cel-go v0.9.0
Kubernetes-commit: d73403dc12ad1d9576d65b5c65e30a87d17ad314
2021-11-01 14:08:09 -04:00
Kubernetes Publisher
843baa6c33 Merge pull request #106240 from tkashem/client-retry
client-go: add jitter to flowcontrol.Backoff

Kubernetes-commit: 5a81905f772c28dc4c8f5d2cb2e5bfc48c422f41
2021-11-10 15:27:04 +00:00
Kubernetes Publisher
0f292167c6 Merge pull request #106181 from ulucinar/aru/consume-kube-openapi
Bump k8s.io/kube-openapi to commit ee342a809c29

Kubernetes-commit: f59b0a56c6ebc1a1891435ba5b094b9afe8c1c3c
2021-11-10 11:26:29 +00:00
Kubernetes Publisher
5d42009b66 Merge pull request #102534 from wangyysde/create-hpav2stable
Create HPA v2 Stable API

Kubernetes-commit: 8e02b788737aec63629e9c9329b064ab96826016
2021-11-09 20:48:05 +00:00
Abu Kashem
4b3bec4f5d client-go: add jitter to flowcontrol.Backoff
Kubernetes-commit: ec93e854ca0924b7f984641b0bbdefc12b269f2b
2021-11-08 19:30:03 -05:00
Alper Rifat Ulucinar
50900ef0b5 Bump k8s.io/kube-openapi to commit ee342a809c29
Updates to consume the aggregated OpenAPI spec lazy-marshaling behaviour
introduced with: https://github.com/kubernetes/kube-openapi/pull/251

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

Kubernetes-commit: 38f888bdd14b8eddb86ec8ca8461267fe7f8ded1
2021-11-05 14:10:09 +03:00
Mikhail Mazurskiy
c5a1393028 ResettableRESTMapper to make it possible to reset wrapped mappers
Kubernetes-commit: de4598d0db5e2babe89dd334407b2ba8024ec9a1
2021-10-13 16:15:24 +11:00
Antonio Ojea
f34af1a39f CloseIdleConnections for wrapped Transport
It iterates over the wrapped transports until it finds one
that implements the CloseIdleConnections method and executes it.

add test for closeidle http1 connections

add test for http1.1 reconnect with inflight request

add test to reuse connection request

add test for request connect after timeout

add test for client-go request concurrency

Kubernetes-commit: b9d865a8185b62d83e9ff81b0e3499a26ac6960d
2021-09-10 15:27:23 +02:00
wangyysde
607f5b2679 rename v2beta2 to v2
Signed-off-by: wangyysde <net_use@bzhy.com>

Generation swagger.json.

Use v2 path for hpa_cpu_field.

run update-codegen.sh

Signed-off-by: wangyysde <net_use@bzhy.com>

Kubernetes-commit: d2abddd9096e30a6c47c72e3e43a033e99c1c149
2021-07-06 16:02:42 +08:00
Kubernetes Publisher
6d69eb8ad6 Merge pull request #105794 from margocrawf/master
--as-uid flag in kubectl and kubeconfigs.

Kubernetes-commit: c9baa14d708415225ed030e520970b3e1b6e4349
2021-11-08 16:39:18 +00:00
Kubernetes Publisher
9b0b23a8ad Merge pull request #106177 from aojea/RoundTripperWrapper
client-go token source transport implement RoundTripperWrapper interface

Kubernetes-commit: d2aa5fc100cc7499a5d80badd1366afb8d0ad63b
2021-11-05 16:42:25 +00:00
Antonio Ojea
06eaec4d00 assert RoundTripperWrapper interface
Kubernetes-commit: 938cc5445dc6e8b723542036e97e1d2023bb3002
2021-11-05 14:53:22 +01:00
Antonio Ojea
26d331c399 client-go token source transport implement RoundTripperWrapper interface
Kubernetes-commit: ef190f860a90df36b415e16f0de16bfeedc17d21
2021-11-05 12:22:23 +01:00
Kubernetes Publisher
6d49694c44 Merge pull request #105983 from jiahuif-forks/dep/bump-smd
Upgrade sigs.k8s.io/structured-merge-diff/v4 to v4.2.0

Kubernetes-commit: 8e2d7a3d64976eb23e1a4fdc8c068f5210014da6
2021-11-04 00:38:36 +00:00
Kubernetes Publisher
980663e185 Merge pull request #105819 from tosi3k/client-go-traces
Add more info to the ListAndWatch trace

Kubernetes-commit: 63c4a22ae9ebb616c564ee5b9e314c5f30e3cfe2
2021-11-03 20:38:47 +00:00
Kubernetes Publisher
e57f40404f Merge pull request #102945 from chenchun/fake
Pass DeleteOptions down to the Reactor

Kubernetes-commit: 9be67806cdecc18a07750eacd796f7885644def1
2021-11-02 16:39:07 +00:00
Jiahui Feng
871103e613 generated: ./hack/update-vendor.sh
Kubernetes-commit: a4f6152743af5201fdbb48bda6730797d3c8f572
2021-11-01 10:00:00 -07:00
Kubernetes Publisher
2f5d8b0c52 Merge pull request #106014 from enj/enj/i/unwrap_exec
client-go exec: make sure round tripper can be unwrapped

Kubernetes-commit: 934f96d07d908f9964d672b17e9740f9d90c46cc
2021-10-29 21:56:15 -07:00
Monis Khan
d92ef13286 client-go exec: make sure round tripper can be unwrapped
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 249aefebe340ce4de4a67446c8b6b43c2121044e
2021-10-29 17:59:52 -04:00
Tim Hockin
fd0a0345b3 De-share the Handler struct in core API (#105979)
* De-share the Handler struct in core API

An upcoming PR adds a handler that only applies on one of these paths.
Having fields that don't work seems bad.

This never should have been shared.  Lifecycle hooks are like a "write"
while probes are more like a "read". HTTPGet and TCPSocket don't really
make sense as lifecycle hooks (but I can't take that back). When we add
gRPC, it is EXPLICITLY a health check (defined by gRPC) not an arbitrary
RPC - so a probe makes sense but a hook does not.

In the future I can also see adding lifecycle hooks that don't make
sense as probes.  E.g. 'sleep' is a common lifecycle request. The only
option is `exec`, which requires having a sleep binary in your image.

* Run update scripts

Kubernetes-commit: 11a25bfeb6fd6e8e5c42e316b17cea15a702041c
2021-10-29 20:37:55 +00:00
Kubernetes Publisher
5be956ba48 Merge pull request #104693 from ravisantoshgudimetla/add-podOS-field
Add pod os field

Kubernetes-commit: bb24c265ce725c90f0e82b01e7c1ccbffb695d14
2021-10-29 08:39:53 +00:00
Chun Chen
dd4008cc8e Auto generated
Kubernetes-commit: 888c049df636712baadd46ead20194c437d3b6e6
2021-10-28 20:10:49 +08:00
Antoni Zawodny
9af7db3c25 Add more info to the ListAndWatch trace
Kubernetes-commit: 093aa210be67f45efb1005f273d8d68444156473
2021-10-21 14:33:57 +02:00
Margo Crawford
5fca705b7d --as-uid flag in kubectl and kubeconfigs.
This corresponds to previous work to allow impersonating UIDs:
* Introduce Impersonate-UID header: #99961
* Add UID to client-go impersonation config #104483

Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: 7e079f5144474cae05802771f604df2b748d781f
2021-10-19 16:12:31 -07:00
ravisantoshgudimetla
c64db8cfcf generated: Add os field to Pod Spec
Kubernetes-commit: 41f8f95fc5dee7613673dc6edd98a85c2c1d4c18
2021-10-14 23:45:20 -04:00
Kubernetes Publisher
c151c2c688 Merge pull request #104915 from alculquicondor/job-ready
Track ready pods in Job status

Kubernetes-commit: 6edcb60d9f854903d341dc5155a78ff8221ad64e
2021-10-28 16:38:48 +00:00
Kubernetes Publisher
651ddcb5a2 Merge pull request #105896 from zqzten/upgrade-json-patch
upgrade json-patch to v4.12.0

Kubernetes-commit: 18cb34ebb2b64a7607057c7dea80427e2af387f3
2021-10-27 00:38:26 +00:00
Zach Zhu
1e6b5d960d upgrade github.com/evanphx/json-patch to v4.12.0
Fix partial negative indice support in json patch

Kubernetes-commit: 20cc72344e653ab90c1a851816bb206b715fd231
2021-10-26 11:20:45 +08:00
Kubernetes Publisher
56656ba0e0 Merge pull request #104877 from pohly/json-kobj
component-base: test and fix JSON output for KObj

Kubernetes-commit: a5cd438b9fbf49e013453f4d6c9b2e935a78071c
2021-10-22 20:38:33 +00:00
Patrick Ohly
816febed68 klog 2.30.0, logr 1.2.0, zapr 1.2.0
The new releases fix logging of KObj in JSON output: klog implements the new
logr.Marshaler interface and zapr uses it instead of Stringer when logging the
ObjectRef created by KObj.

Kubernetes-commit: 169e8b65a00b45ef8bbc7a14cd985df1c835953b
2021-10-22 15:13:47 +02:00
Kubernetes Publisher
d8ccb0e454 Merge pull request #105030 from liggitt/json-stdlib
switch from json-iterator to forked stdlib json decoder

Kubernetes-commit: cc25656b00baa33168b7a9bc574101a06788efea
2021-10-22 04:36:23 +00:00
Kubernetes Publisher
4154d814be Merge pull request #105490 from aojea/restclient-shared-transport
client-go: share the same transport for generated clientsets

Kubernetes-commit: 881980a5c67b7636fd983c481b2648bc4e00c242
2021-10-20 20:37:03 +00:00
Kubernetes Publisher
88713b741f Merge pull request #105405 from verb/1.23-ec-beta
Promote EphemeralContainers to beta

Kubernetes-commit: 18104ecf1f57362ae6b33f01ce6413d7fec4f715
2021-10-20 16:37:34 +00:00
Antonio Ojea
4d53a8ddbb updated generated
Kubernetes-commit: 032d0d6ea944d0e1845cbdbd9b72ded017deaaed
2021-10-20 06:30:30 +02:00
Antonio Ojea
30025c3fbc expose NewForConfigAndClient for the metadata client
Kubernetes-commit: 909a1738fdf7b33513a1409860289a3d38d77267
2021-10-19 16:00:53 +02:00
Antonio Ojea
12956a0d53 expose NewForConfigAndClient for the dynamic client
Kubernetes-commit: b584195e5cc0a1094318ba886a9aecd2f675d59c
2021-10-19 15:58:58 +02:00
Antonio Ojea
bb294ffaf0 NewDiscoveryClientForConfigAndClient constructor
Kubernetes-commit: f519ab25ab0e7dd8eb4fd72da53daecb9e48211e
2021-10-09 00:21:38 +02:00
Antonio Ojea
fd09dceb88 RESTClient contructors for config and http client
Add two new constructors for versioned and unversioned RESTClients.

These new constructors allow to pass an http.Client to the RESTClient,
taking precence over the transport Config parameters.

Add a new helper function to generate an http.Client from the RESTClient
Config object.

Co-authored-by: Jordan Liggitt <liggitt@google.com>

Kubernetes-commit: 80fbc817263de1c46e1493819aca35b1ef8e3d09
2021-10-09 00:17:04 +02:00
Lee Verberne
7159ac8cf1 Generated code for EphemeralContainers beta
Kubernetes-commit: b34e710972969a388e4691bb67be0a2e4d34676f
2021-10-01 17:48:21 +02:00
Kubernetes Publisher
fa4ee2502f Merge pull request #104327 from sxllwx/fix/dynamic-client
set the content-type Header when the dynamic client sends the request

Kubernetes-commit: a78e3133a0d0401fa592ae1c4a1daf4e30e2efdf
2021-10-18 12:36:48 +00:00
Kubernetes Publisher
7697067af7 Merge pull request #105603 from shawnhanx/eventstructuredlogging
Support SetStructuredLogging with the new events library

Kubernetes-commit: 668c666fce30e648b08f3607d299e36ca8ecb94e
2021-10-11 16:38:15 +00:00
shawnhanx
93595145a2 Support SetStructuredLogging with the new events library
Kubernetes-commit: 230cb00ddd989ae2359696f6aa09a71253936a49
2021-10-11 16:16:46 +08:00
Kubernetes Publisher
3511ef41b1 Merge pull request #105156 from aojea/clientgo_trace
Enhance client-go url timing logging with http statistics

Kubernetes-commit: b7da9ef49f82ac8b54d28931a5b3e1de30accfd3
2021-10-05 16:37:11 +00:00
Kubernetes Publisher
1cbb8e6f55 Merge pull request #105312 from Karthik-K-N/fix-reatelimite-testfail
Fix for TestWithMaxWaitRateLimiter test case failure

Kubernetes-commit: 9fdcc4b1999c273d7e156880df646ac905b8adf0
2021-10-05 00:36:54 +00:00
Kubernetes Publisher
f71d2554c3 Merge pull request #104653 from astraw99/fix-word-comment
Fix word most `comment` to `common` and typo

Kubernetes-commit: ca08978c2d809d77ad746401bad9710052252fe7
2021-10-01 16:36:50 +00:00
Kubernetes Publisher
dbfa30b9d9 Merge pull request #105372 from MadhavJivrajani/vendor-clock-utils
Vendor in k8s.io/utils

Kubernetes-commit: eebeff9f7e0fccf1d220ce809eaea7f7f9248ce0
2021-10-01 00:37:00 +00:00
Madhav Jivrajani
235fd365ab run hack/{pind-dependency.sh, update-vendor.sh}
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: a43fca76ea7ff6fb08153c9081f7858cd4d06dd8
2021-09-30 19:15:35 +05:30
Kubernetes Publisher
b3f71e47c4 Merge pull request #105330 from liggitt/importboss-doc
Make package paths referenced by import boss valid

Kubernetes-commit: d551560a78292e1d4cac1de2ae684c803ddea183
2021-09-30 00:36:35 +00:00
Kubernetes Publisher
fe0e5b13da Merge pull request #103900 from ash2k/ash2k/cache-mapper-and-client
Cache rest mapper and discovery client

Kubernetes-commit: fafbe3aa51473a70980e04ae19f7db2d32d7365b
2021-09-29 12:36:03 +00:00
Kubernetes Publisher
6d070ad4a8 Merge pull request #105315 from wzshiming/test/events-expansion
Add unit test coverage for events expansion

Kubernetes-commit: c9b9c401092209767bde7d831fe8a3a771ea6a29
2021-09-29 08:36:29 +00:00
Kubernetes Publisher
9bea344c4a Merge pull request #104300 from wojtek-t/converting_informer
Create TransformingInformer

Kubernetes-commit: 66e1d27a59208f3f90016e0790a13e2602fecdeb
2021-09-29 00:36:47 +00:00
Kubernetes Publisher
f1b4ce1ec0 Merge pull request #105234 from wojtek-t/optimize_indexer
Optimize indexer

Kubernetes-commit: 3b2b23cee707f3407b997db412547f692db59870
2021-09-28 20:36:18 +00:00
Jordan Liggitt
93c09c3155 Make package paths referenced by import boss valid
Kubernetes-commit: f6b831aeaca2ff1481074e05c6771050f2b40516
2021-09-28 13:06:39 -04:00
Shiming Zhang
a0628957da Add unit test coverage for events expansion
Kubernetes-commit: 13fe94f136a15dd45b75262517a36b14d1e094a9
2021-09-28 18:07:34 +08:00
Shiming Zhang
439294e1c4 Update comments
Kubernetes-commit: f63c135e1fe5c443eae47f6b7f1d04cb0ba2a71a
2021-09-28 16:23:52 +08:00
Karthik K N
881e30ae78 Changes to fix the flake test case in ratelimiter
Kubernetes-commit: 7134657304a6d5b3a62c51cad82af6ca703d40c4
2021-09-28 12:23:27 +05:30
Kubernetes Publisher
b7ec70cb33 Merge pull request #104507 from wzshiming/fix/match
Check namespaces match in UpdateWithEventNamespace

Kubernetes-commit: 04f3d19bea10072b6d01e0c1306735f1e30f3ea0
2021-09-27 19:43:20 +00:00
Kubernetes Publisher
372575c38a Merge pull request #104483 from margocrawf/master
Add UID to client-go impersonation config

Kubernetes-commit: 48d844ec64bd83a378418d420ba455fa28043cbc
2021-09-27 15:43:34 +00:00
wojtekt
e61d0d5d52 Optimize index updating
Kubernetes-commit: 75273a0689250f4861ea41405e6402c6191563a8
2021-09-24 15:24:01 +02:00
wojtekt
463b3d12bb Optimize indexer
Kubernetes-commit: 27c94a49c80202790e195dde3a258cc62110c1e5
2021-09-24 14:46:56 +02:00
wojtekt
c702a411d1 Create TransformingIndexerInformer
Kubernetes-commit: 56ffb4e2b056622210bbf5ce845cf63ca18e85ce
2021-09-23 09:09:59 +02:00
Kubernetes Publisher
7cbd2d5c7a Merge pull request #105162 from MadhavJivrajani/migrate-clock-pkg
migrate k8s.io/apimachinery/util/clock -> k8s.io/utils/clock

Kubernetes-commit: bf77f8ff4354bea48bb41d7724428df84734d97b
2021-09-21 08:44:24 -07:00
Madhav Jivrajani
721036c908 migrate k8s.io/apimachinery/util/clock -> k8s.io/utils/clock
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: fed2ec99c652550ed4a8c00b7cfc6c93abbc4ade
2021-09-21 15:53:43 +05:30
Antonio Ojea
3a10028e85 client-go httpstats
enhance client-go DebugURLTiming roundtripper using golang httptrace
to provide timing statistics for:
- dns lookup
- tcp dialing
- tls handshake
- time to get a connection from the pool
- time to process a request

Kubernetes-commit: 72c35be086fed5f70fd11dc96ca34298573bff05
2021-09-21 10:38:43 +02:00
Kubernetes Publisher
79916c54e1 Merge pull request #104578 from MadhavJivrajani/refactor-rate-limiters
Move client-go/tools/record tests away from `IntervalClock` to `SimpleIntervalClock`

Kubernetes-commit: 775c9314adb82419aaffea39f671d8dcee133a3f
2021-09-21 07:43:04 +00:00
Kubernetes Publisher
191e5dc23b Merge pull request #105095 from wojtek-t/migrate_clock_3
Unify towards k8s.io/utils/clock - part 3

Kubernetes-commit: 353f0a5eabe4bd8d31bb67275ee4beeb4655be3f
2021-09-21 07:43:02 +00:00
Kubernetes Publisher
4fc3881b7f Merge pull request #104655 from luyou86/client-go-bucket-rate-limiter-add-maxDelay
client-go bucket rate limiter add maxDelay

Kubernetes-commit: 232bc67b221e8af2bb3494c36e59b006881f6b1d
2021-09-20 15:49:04 +00:00
Kubernetes Publisher
cc7616029c Merge pull request #105031 from howardjohn/q/memory-leak
workqueue: fix leak in queue preventing objects from being GCed

Kubernetes-commit: a73f45dd96d01bbb2e8b2071a3aafdcdaeed0582
2021-09-18 07:42:55 +00:00
Kubernetes Publisher
98470c83bc Merge pull request #105080 from smira/client-error-wrapping
fix: wrap errors correct when validating kubeconfig

Kubernetes-commit: 35ae8c9fe4589bbe99e174929f78f8228c2da528
2021-09-17 23:51:32 +00:00
Kubernetes Publisher
efdf0580f0 Merge pull request #105026 from wojtek-t/migrate_clock_2
Unify towards k8s.io/utils/clock - part 2

Kubernetes-commit: 9918aa1e035a00bc7c0f16a05e1b222650b3eabc
2021-09-17 11:55:44 +00:00
Kubernetes Publisher
0866d96687 Merge pull request #104949 from Karthik-K-N/json-iterator-version-update
Updated json-iterator version to 1.1.12 from 1.1.11

Kubernetes-commit: 6a49ed41eab79d745c53723ce7f134222279545e
2021-09-17 11:55:42 +00:00
wojtekt
01243dd50e Migrate to k8s.io/utils/clock in client-go
Kubernetes-commit: bb7dac443a2039f97c822f610e78d4b65482c56d
2021-09-17 11:36:09 +02:00
Andrey Smirnov
8f8a83c908 fix: wrap errors correct when validating kubeconfig
This allows to check for specific errors using `errors.Is`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>

Kubernetes-commit: a5647fa417de6d17ba200f1b4bcd2bb28cceb22c
2021-09-16 22:56:08 +03:00
wojtekt
608b5216df Migrate to k8s.io/utils/clock in client-go - part 1
Kubernetes-commit: 950f655bdd19c5af275846cf1940d767a5ec0115
2021-09-15 10:58:56 +02:00
Kubernetes Publisher
7e5e2e0743 Merge pull request #104991 from hzxuzhonghu/mem-leak
Fix workqueue memory leak

Kubernetes-commit: 4c014e5ca41fe9efbbb568609f1f8d1a6a51263b
2021-09-15 07:44:16 +00:00
John Howard
eb364c77d8 workqueue: fix leak in queue preventing objects from being GCed
See https://github.com/grpc/grpc-go/issues/4758 for a real world example
of this leaking 2gb+ of data.

Basically, when we do `q.queue[1:]` we are just repositioning the slice.
The underlying array is still active, which contains the object formerly
known as `q.queue[0]`. Because its referencing this object, it will not
be GCed. The only thing that will trigger it to free is eventually when
we add enough to the queue that we allocate a whole new array.

Instead, we should explicitly clear out the old space when we remove it
from the queue. This ensures the object can be GCed, assuming the users'
application doesn't reference it anymore.

Kubernetes-commit: 2a34801168dc1c70ba25b1d4200b534bf515cbc2
2021-09-14 15:51:09 -07:00
Jordan Liggitt
dfce9f4527 vendor sigs.k8s.io/json
Kubernetes-commit: 434ce4336ab06b3c34208822d558c0432ada3ad3
2021-09-14 18:20:36 -04:00
Kubernetes Publisher
2ed3e42c43 Merge pull request #104874 from wojtek-t/migrate_clock_1
Unify towards k8s.io/utils/clock - part 1

Kubernetes-commit: 047a6b9f861b2cc9dd2eea77da752ac398e7546f
2021-09-14 03:35:12 +00:00
Kubernetes Publisher
a5f006eba4 Merge pull request #104969 from liggitt/crd-error-validation
Fix conversion of literal null JSON values

Kubernetes-commit: 9c147baa70c31afc966329df73302e9b52d8e432
2021-09-14 03:35:10 +00:00
Kubernetes Publisher
bf0611c8ec Merge pull request #104399 from tkashem/apf-v1beta2
apf: introduce v1beta2

Kubernetes-commit: cdcf2a239e211c66c84efaedea1a4eb5eb4c409d
2021-09-14 03:35:08 +00:00
xuzhonghu
2f21912570 Fix workqueue memory leak
Kubernetes-commit: 25060beef0c536e80b53507ec445695a7305db00
2021-09-14 09:53:53 +08:00
Kubernetes Publisher
29730ab4f5 Merge pull request #104045 from ravisantoshgudimetla/promote-minReadySec-sts-beta
Promote min ready sec sts beta

Kubernetes-commit: 62a6df9e0b8ed3fe9fad96c8a9a0bde4a3224f35
2021-09-13 23:35:38 +00:00
Jordan Liggitt
5960e3c05a Propagate conversion errors
Kubernetes-commit: ba1ca0d4591f06f796ea2d93463a4c5caaa33cc7
2021-09-13 11:49:17 -04:00
Kubernetes Publisher
45fb834fed Merge pull request #104853 from kitianFresh/feature/avoid-sharedIndexInformer-run-more-than-once
avoid sharedIndexInformer run more than once, avoid more cache and me…

Kubernetes-commit: dcfe8f5d5c9531e3196eb5036a86643c728eafe7
2021-09-13 15:34:27 +00:00
Kubernetes Publisher
b36b60b678 Merge pull request #104725 from NoicFank/master
Improve DeltaFIFO function 'ListKeys'

Kubernetes-commit: 170f64d58bdf08be5dfd7711c505f36f2503b1c2
2021-09-13 15:34:25 +00:00
Karthik K N
e4babf5864 Updated vendor files and pinned versions
Kubernetes-commit: c5b4e05834d8edceac94ab1a91c3153581534393
2021-09-13 15:42:42 +05:30
Kubernetes Publisher
9b97591456 Merge pull request #101928 from alexanderConstantinescu/drain-workqueue
client-go/workqueue: Drain work queue on shutdown

Kubernetes-commit: 8ac95264750ad1d93ec92b58b9956cd8f6a0a738
2021-09-11 03:33:57 +00:00
Kubernetes Publisher
9026029b9a Merge pull request #104841 from h4ghhh/deltafifo_rv
client-go: para 'resourceVersion' in DeltaFIFO.Replace is not used, so remove it

Kubernetes-commit: 34003c5aeee45e244a81f499472759be0cda205c
2021-09-10 11:42:30 +00:00
wojtekt
8d49a0b940 Migrate to k8s.io/utils/clock in flowcontrol backoff
Kubernetes-commit: 4ce452989bef21ab6d15bc659f463d8c706ad33e
2021-09-10 09:37:30 +02:00
Kubernetes Publisher
92773dec00 Merge pull request #104103 from pohly/logr-1.0
klog 2.20.0, logr v1.1.0, zapr v1.1.0

Kubernetes-commit: 5b49d125b76b4d92d5f782630b75b911fee75aaa
2021-09-09 23:33:48 +00:00
wojtekt
14a51589c3 Migratet to k8s.io/utils/clock in workqueue
Kubernetes-commit: 392292ba81964e6ee7badec360a800b1f8645f2f
2021-09-09 16:38:59 +02:00
Kubernetes Publisher
dbb2afa6ab Merge pull request #104812 from astraw99/fix-sharedInformer-doc
Fix comment of `processorListener.requestedResyncPeriod`

Kubernetes-commit: c964fe6001376c8ad209656175bd3c4087ce5d71
2021-09-09 11:43:43 +00:00
kitianFresh
f0bcda0dce avoid sharedIndexInformer run more than once, avoid more cache and memory consume
Kubernetes-commit: 305c13faca48d1a6ea4d263e262ebc8df0387c84
2021-09-09 13:37:25 +08:00
Kubernetes Publisher
84f9a96f06 Merge pull request #103023 from tiloso/staticcheck-apiserver-clientgo
Fix staticcheck in k8s.io/{apiserver/pkg/storage,client-go/rest/watch}

Kubernetes-commit: 95390e6476fca15b0f55cde2c142ec18ca57aee0
2021-09-09 03:33:24 +00:00
Aldo Culquicondor
0659305cf9 Add ready field to Job status
to keep a count of the pods that have the ready condition.

Also:
- Add feature gate JobReadyPods.
- Add Ready to describe.

Change-Id: Ib934730a430a8e2a2f485671e345fe2330006939

Kubernetes-commit: 1bff5eb44d9897e12aff3ea10f5a856580158278
2021-09-08 14:31:59 -04:00
00255991
c209a2e2bc para 'resourceVersion' in DeltaFIFO.Replace is not used, so remove it
Kubernetes-commit: 2949045ec47163485118c25c40907eb43c090fac
2021-09-08 19:10:40 +08:00
astraw99
33e23edf09 fix sharedInformer doc
Kubernetes-commit: 9d84ffafd06e6ca455aa279bd513758696e8e875
2021-09-07 16:45:07 +08:00
Dingzhu Lurong
b86695770f Improve DeltaFIFO function 'ListKeys'
In function ListKeys, it better to use ‘queue’ instead of 'items' to get all the keys.

Kubernetes-commit: f0ce8755287b1cad087b61abfcccd79c9f151828
2021-09-02 14:02:54 +08:00
Kubernetes Publisher
a31b18a6ac Merge pull request #104573 from sxllwx/refine/clear-comments-for-metaclient
Explain the reason why metaclient special processing metav1.DeleteOptions encoding

Kubernetes-commit: 7a0638da76cb9843def65708b661d2c6aa58ed5a
2021-09-01 08:07:46 +00:00
Kubernetes Publisher
ce70fecbf8 Merge pull request #104172 from atiratree/revert-jsonpath-fix
revert "fix wrong output when using jsonpath"

Kubernetes-commit: db4f2014c8937754db2d21214465239c95ca39b9
2021-08-31 16:07:13 +00:00
astraw99
1816a40bbb fix word comment to common
Kubernetes-commit: 3e31933471e015a860e1967acfe730bb35422f17
2021-08-29 19:06:04 +08:00
luyou86
a6277bbabf client-go bucket rate limiter add maxDelay
Kubernetes-commit: 57ec8336195702dd0d5f6f19fd3907e2a6a615a8
2021-08-29 17:45:58 +08:00
Kubernetes Publisher
b350fc31ce Merge pull request #104231 from astraw99/fix_unified_workers
Unify controller worker num param `threadiness` to `workers`

Kubernetes-commit: fca3175df7a453c24eec3c11b632090c49472c9d
2021-08-27 20:06:52 +00:00
atiratree
e529a15dbc add a test for jsonpath template parsing to prevent regressions
This behaviour was broken by commit
39cfe232325d66bcdbc935af7aaf7022562e7010 and PR kubernetes#98057

Kubernetes-commit: b79859cb12b19222fffc17481e1fe006819de63c
2021-08-26 14:49:58 +02:00
Madhav Jivrajani
b9fa896d5d Refactor client-go/util/flowcontrol/throttle.go RateLimiter
- Introduce PassiveRateLimiter which implements all methods of previous RateLimiter except Accept() and Wait()
- Change RateLimiter interface to extend PassiveRateLimiter by additionally implementing Accept() and Wait()
- Make client-go/tools/record use PassiveRateLimiter

Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator

- EventSourceObjectSpamFilter, EventAggregator, EventCorrelator use clock.PassiveClock now.
	- This won't be a breaking change because even if a clock.Clock is passed, it still implements the clock.PassiveClock interface.
- Extend clock.PassiveClock through Clock.
- Replace pacakge local implementation of realClock with clock.RealClock
- In flowcontrol/throttle.go split tokenBucketRateLimiters to use Clock and clock.PassiveClock.
- Migrate client-go/tools/record tests from using IntervalClock to using SimpleIntervalClock (honest implementation of clock.PassiveClock)

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: ac5c55f0bd853fcf883d9b8e1f5ef728a2fb5309
2021-08-25 21:56:26 +05:30
scott
0c4682e956 explain the reason why metaclient special processing metav1.DeleteOptions encoding
metaclient explicitly specifies the Content-Type when executing Delete and DeleteCollection, and add test for that

Kubernetes-commit: 8976f6f6d9af22ad40df891565c19e4dfd67f591
2021-08-25 17:55:25 +08:00
Kubernetes Publisher
3dc80a3333 Merge pull request #103692 from justaugustus/go117
[go1.17] Update to go1.17

Kubernetes-commit: c1e69551be1a72f0f8db6778f20658199d3a686d
2021-08-25 04:07:38 +00:00
Shiming Zhang
6e9eb81c44 Check namespaces match in UpdateWithEventNamespace
Kubernetes-commit: 0f2e202ff4f3cca1c068792f6eb79b48cf3c9bf9
2021-08-23 10:36:29 +08:00
Abu Kashem
0c0d853c0f apf: regenerate for v1beta2
Kubernetes-commit: 2f19f8c2df640b6c6bf00c97752053b9b0a7f09b
2021-08-16 17:07:24 -04:00
Stephen Augustus
624e6827e6 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
scott
61ae14a896 set the content-type Header when the dynamic client sends the request
Kubernetes-commit: 2ad09c6a87b9150598c6119d653acc983c5c7a11
2021-08-12 20:17:07 +08:00
Stephen Augustus
484a294726 generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0be115722bf30f42c7a954d5cdd4b48efd70ae77
2021-08-11 18:03:39 -04:00
Stephen Augustus
e311efc923 [go1.17] Bump golang.org/x/... dependencies
hack/pin-dependency.sh golang.org/x/crypto master
hack/pin-dependency.sh golang.org/x/net master
hack/pin-dependency.sh golang.org/x/oauth2 master
hack/pin-dependency.sh golang.org/x/sync master
hack/pin-dependency.sh golang.org/x/sys master
hack/pin-dependency.sh golang.org/x/term master
hack/pin-dependency.sh golang.org/x/time master
hack/pin-dependency.sh golang.org/x/tools master

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 0e9881a9dc9d06aaf93723b4dfc7f4e1cb92e215
2021-08-11 18:02:07 -04:00
Kubernetes Publisher
b1403d113a Merge pull request #104504 from astraw99/fix_typo_CRED
Fix typo `CRED` to `CRUD`

Kubernetes-commit: 62828b24f35cb27e871755a2c201b91ce9ff7de0
2021-08-24 16:07:36 +00:00
astraw99
f100d86401 fix typo CRED to CRUD
Kubernetes-commit: f8b82e189cfdc3aca7b9d789cc6f3131897f0ebc
2021-08-22 21:19:30 +08:00
Kubernetes Publisher
590eaed90a Merge pull request #104373 from astraw99/fix_typo_rate_limiter
Fix typo of rate limiter

Kubernetes-commit: 40f05cec281bca57b898c3bf629dbc056eccf3da
2021-08-20 20:07:23 +00:00
Kubernetes Publisher
e88163c224 Merge pull request #104368 from aojea/ruleguard
golang 1.17 fails to parse IPs with leading zeros

Kubernetes-commit: b0bc8adbc2178e15872f9ef040355c51c45d04bb
2021-08-20 16:06:55 +00:00
Antonio Ojea
a6edfabde7 run hack/update-netparse-cve.sh
Kubernetes-commit: 0cd75e8fec62a2531637e80bb950ac9983cac1b0
2021-08-20 01:16:14 +02:00
Kubernetes Publisher
9c45b4b2bf Merge pull request #104466 from stbenjam/bump-utils
vendor: bump k8s.io/util to get fix for LRU cache

Kubernetes-commit: 7fcecc077dae36071901472d12fa26e5af99010c
2021-08-20 04:06:59 +00:00
Stephen Benjamin
284a0d5a73 vendor: bump k8s.io/util to get fix for LRU cache
This updates the k8s.io/util to pull in the fix for
https://github.com/kubernetes/kubernetes/issues/104452.

Commands run:

  ./hack/pin-dependency.sh k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
  ./hack/update-vendor.sh

Kubernetes-commit: c2532351525c2822daab61303eb4f94942a017e6
2021-08-19 17:11:35 -04:00
Kubernetes Publisher
2961e1de2c Merge pull request #104413 from liggitt/openapi-ipvalidation
Bump k8s.io/kube-openapi

Kubernetes-commit: cde45fb161c5a4bfa7cfe45dfd814f6cc95433f7
2021-08-17 20:07:04 +00:00
Jordan Liggitt
d2b8b64fb6 Regenerate applyconfigurations
Kubernetes-commit: 5e03a1f070ec0556fd6a809026efcdddb4026c8c
2021-08-17 11:41:47 -04:00
Jordan Liggitt
a3cb704425 Bump k8s.io/kube-openapi
Updates to preserve openapi ipv4 validation compatibility with pre-go1.17 behavior

Kubernetes-commit: b15c2130aad497add782820c415c59952b4e75a8
2021-08-17 10:13:40 -04:00
astraw99
9d15ff74ca fix typo of rate limiter
Kubernetes-commit: 7953cf0ce9f890b6cba7de3325a7ce68609832a0
2021-08-15 17:48:37 +08:00
Kubernetes Publisher
d6c83109f0 Merge pull request #103912 from Iceber/fix-event-recorder
client-go/events: avoid referencing a nil related object

Kubernetes-commit: e7efe219f8a5fcdff9647d45639696048c1f6147
2021-08-12 12:05:55 +00:00
Kubernetes Publisher
19db02e788 Merge pull request #103918 from olagacek/master
Allow customizing spam filtering in event client library

Kubernetes-commit: 582c6f6df71d8c59de5b8b5a2363d13ffcc42b14
2021-08-11 16:06:03 +00:00
Kubernetes Publisher
044192f4ee Merge pull request #104279 from liggitt/add-staging-golang-license
Copy golang license to staging copies

Kubernetes-commit: 5a732dcfe1d4ec0e8ee2871b106605b7f8a69b98
2021-08-11 04:05:56 +00:00
Kubernetes Publisher
81fcb4fde1 Merge pull request #104258 from coderanger/patch-3
Typo in a comment.

Kubernetes-commit: 01f83db11942d0dd8f30658a505c440404fa5d44
2021-08-11 04:05:55 +00:00
Jordan Liggitt
21ff407b62 Copy golang license to staging copies
Kubernetes-commit: c4ecdad5708262d5be1d6cce4cbad3a3b820924b
2021-08-10 17:37:28 -04:00
Noah Kantrowitz
e89f211c9a Typo in a comment.
Kubernetes-commit: 86c6e25016a3385394503efc9bb29f4dfe79163c
2021-08-09 21:21:45 -07:00
Kubernetes Publisher
150ce54105 Merge pull request #102913 from pacoxu/upgrade-promotheus-common
upgrade prometheus/common to v0.28.0

Kubernetes-commit: 4b4d12f8a68e224c78d00e8fd2bf3c87aff90a9a
2021-08-09 16:05:56 +00:00
astraw99
a9a86ad864 unify worker num to workers
Kubernetes-commit: e6df935fd30c56a8ece0da6152c60fc725d942b7
2021-08-09 10:48:53 +08:00
Kubernetes Publisher
b7569257b2 Merge pull request #102872 from barkbay/client/fix-discovery-error
Return StatusError 404 in fake client when resource is not found

Kubernetes-commit: f8023d60f2c30836154e7f7a294cfbe9eb8d3e8a
2021-08-06 20:17:05 +00:00
Kubernetes Publisher
0f5acb8c39 Merge pull request #103917 from aojea/slow_handlers
client-go: deltaFIFO trace slow handlers

Kubernetes-commit: ec663ada4be14d0afd45e0414b8711d4380ec289
2021-08-06 00:06:00 +00:00
atiratree
496c390182 revert "fix wrong output when using jsonpath"
This partially reverts commit 39cfe232325d66bcdbc935af7aaf7022562e7010and PR #98057

the original problem was caused by not using {end} at the end of the range

Kubernetes-commit: 5c3de9f1de913d1251ce2183991a845edc01d123
2021-08-05 18:39:43 +02:00
Kubernetes Publisher
fa98c04850 Merge pull request #103657 from dgrisonnet/fix-event-doc
Update Events version in the documentation of the events package

Kubernetes-commit: 7e99f3d7490d11438b9834a7bd6b0e8b7eb0bec1
2021-08-05 08:05:52 +00:00
Kubernetes Publisher
2d8e761048 Merge pull request #103564 from kevindelgado/unstr-extr-poc
ExtractItems for unstructured apply configurations

Kubernetes-commit: 0a704f9e1f6685f3ae39114435d23593a900e74c
2021-08-05 08:05:51 +00:00
Kubernetes Publisher
3c86d4a920 Merge pull request #100406 from tomkukral/retry-doc
fix typo in retry doc

Kubernetes-commit: bf22025950c0af15f3bbf92f3ff085dbe5b087a7
2021-08-05 04:05:53 +00:00
Patrick Ohly
90bee32800 klog 2.20.0, logr v1.1.0, zapr v1.1.0
This replaces the experimental logr v0.4 with the stable v1.1.0
release. This is a breaking API change for some users because:
- Comparing logr.Logger against nil is not possible anymore:
  it's now a struct instead of an interface. Code which
  allows a nil logger should switch to *logr.Logger as type.
- Logger implementations must be updated in lockstep.

Instead of updating the forked zapr code in json.go, directly using
the original go-logr/zapr is simpler and avoids duplication of effort.

The updated zapr supports logging of numeric verbosity. Error messages
don't have a verbosity (= always get logged), so "v" is not getting
added to them anymore.

Source code logging for panic messages got fixed so that it references
the code with the invalid log call, not the json.go implementation.

Finally, zapr includes additional information in its panic
messages ("zap field", "ignored key", "invalid key").

Kubernetes-commit: cb6a65377775110631bc865acc06c3f957592813
2021-08-03 17:31:39 +02:00
Margo Crawford
e0129e64d4 Introduces Impersonate-Uid to client-go.
* Updates ImpersonationConfig in rest/config.go to include UID
  attribute, and pass it through when copying the config
* Updates ImpersonationConfig in transport/config.go to include UID
  attribute
* In transport/round_tripper.go, Set the "Impersonate-Uid" header in
  requests based on the UID value in the config
* Update auth_test.go integration test to specify a UID through the new
  rest.ImpersonationConfig field rather than manually setting the
  Impersonate-Uid header

Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: d9ddfb26e10ee353fc4617b66d2c9274bf6d1c08
2021-07-30 15:50:51 -07:00
ravisantoshgudimetla
aade4d8106 api: Promote statefulset MinReadySeconds to beta
Kubernetes-commit: bcc288eeeeaa34083319f9a27a352b98d4e6b3d8
2021-07-30 12:38:14 -04:00
Tim Hockin
bcf88f084d Update golang.org/x/time/rate (#104014)
* Add failing test case

* Update golang.org/x/time/rate

* Call update-internal-modules from update-vendor

Kubernetes-commit: 09dc055984e9532f29f37acae7aea7a979ded764
2021-07-30 02:27:36 +00:00
Kevin Delgado
dfebd379cf fix boilerplate and staticcheck
Kubernetes-commit: 3628065b455f17cf3da5a5021c9603f89daf20bc
2021-07-27 22:31:38 +00:00
Kevin Delgado
ba2f26324b fix vendor
Kubernetes-commit: 85bc3c4f857090899e82eb2c7c3f6aebc9f4eeaf
2021-07-27 21:23:49 +00:00
Kevin Delgado
d4454993f4 remove apiserver impor from client-go
Kubernetes-commit: af11c4ac9be74115dfd35ce6f18cfa0440fc3458
2021-07-27 20:46:40 +00:00
Kevin Delgado
10ec231914 wrap extractor errors
Kubernetes-commit: 479e2ae307c0ca7e0a826e54df6bcc7676445e35
2021-07-27 01:25:03 +00:00
Aleksandra Gacek
23071d64f0 Allow customizing spam filtering in event client library
Kubernetes-commit: 00080d400fe27f11795b654ad1e124311831a0fc
2021-07-26 16:05:18 +02:00
Antonio Ojea
c63d830a92 client-go: deltaFIFO trace slow handlers
If the informers handlers are slow processing the objects, the deltaFIFO
blocks the queue and the streamWatchers can not add new elements to the
queue, creating contention and causing different problems, like high
memory usage.
The problem is not easy to identify from a user perspective, typically
you can use pprof to identify a high memory usage on the StreamWatchers
or some handler consuming most of the cpu time, but users should not
have to profile the golang binary in order to know that.

Metrics were disabled on the reflector because of memory leaks, also
monitoring the queue depth can't give a good signal, since it never goes high

However, we can trace slow handlers and inform users about the problem.

Kubernetes-commit: d38c2df2c4b945bcf1f81714fc6bfd01bbd0f538
2021-07-26 16:00:31 +02:00
Iceber Gu
3e35ef93c0 client-go/events: avoid referencing a nil related object
Kubernetes-commit: 822eb29b6f333317798e5b88fc43fb28b5f33b69
2021-07-26 18:15:22 +08:00
Mikhail Mazurskiy
0ae31f68fd Cache rest mapper and discovery client
They are both stateful so it is beneficial for performance to cache them.

Kubernetes-commit: 037ed11f649f356efc4363db32b9f85ef02ca106
2021-07-25 19:31:58 +10:00
Kevin Delgado
b5bb80748a Revert caching in favor of simple ttl
Kubernetes-commit: 1122091b065b5ce37a93b1048174acaff243bf74
2021-07-21 22:57:57 +00:00
Kevin Delgado
784e3fbb2f remove commented out code
Kubernetes-commit: 53582a0104fb88aacb5f9512e60136e59fc25f8c
2021-07-20 21:59:37 +00:00
Kevin Delgado
305b0bc3db Address PR feedback around gvk parser generation ergonomics
Kubernetes-commit: c9e97de46bb76cf868fcb172f286127b9894fbe9
2021-07-20 21:29:02 +00:00
Kubernetes Publisher
ac207faedf Merge pull request #103747 from mattcary/noapi
Revert #99378

Kubernetes-commit: 7303b2ce4e0de8d97e677eee880fa12b4d4939c1
2021-07-20 14:27:25 +00:00
Kevin Delgado
1b1afde6e1 Restructure caching logic
Kubernetes-commit: 9b9925f56db9f483e838606b632064b13c84a2bb
2021-07-19 22:06:43 +00:00
Kevin Delgado
6728ebaf13 comments
Kubernetes-commit: 7cb18e84f1396338ebea825677de772a862a2743
2021-07-19 20:50:50 +00:00
Kevin Delgado
f316b7b5f5 rename cache, add to integration test
Kubernetes-commit: 604db6eb2ada446e78152685943253455b5ec888
2021-07-19 20:04:27 +00:00
Kevin Delgado
4389b4f36a Add HasOpenAPISchemaChanged to DiscoveryInterface
Kubernetes-commit: 235a57a29e5d232f411a23148643533140e646d1
2021-07-16 22:53:39 +00:00
Matthew Cary
2406d2208b Revert "tests for statefulset PersistentVolumeClaimDeletePolicy api change"
This reverts commit b259686b367ffef89310a71875834a97befc5b4b.

Change-Id: I25cc8ae8a9aa77d0bc483147d3f8fb65616a2b2b

Kubernetes-commit: aeb82243fc863c44c3603f0d3bf4d8910774765e
2021-07-15 17:15:50 -07:00
Kubernetes Publisher
d3b97581d2 Merge pull request #103689 from enj/enj/t/exec_metrics
client-go exec: fix metrics related to plugin not found

Kubernetes-commit: 6609899398d35d22a7482f687ed05fb19093b762
2021-07-14 22:29:33 +00:00
Kevin Delgado
5d4570c9e0 basic caching working
Kubernetes-commit: 7b9757faa4924422bec746b689233ed1ea790b1b
2021-07-14 18:54:16 +00:00
Monis Khan
ef1d5d2691 client-go exec: fix metrics related to plugin not found
These were missed because our tests did not pass in the correct test
data input (the command to execute).

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: a6ac42082b4d7c0057b52900736bd7fbc2c44241
2021-07-14 12:34:56 -04:00
Damien Grisonnet
398a64c25b client-go/tools: update events version in doc
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: d02568aab52c1003f3625a00ff4e29fcb81bbda6
2021-07-13 08:50:40 +02:00
Kubernetes Publisher
7a90b08589 Merge pull request #102928 from dprotaso/dynamic-client-backwards-compatible
Simplify construction of the fake dynamic client

Kubernetes-commit: fc4e7c17f4aead0bc953be03178c4e3caee1015f
2021-07-08 21:48:10 +00:00
Kubernetes Publisher
f0bc45ffb4 Merge pull request #98817 from alculquicondor/job-completion-api
Add Job.status.uncountedTerminatedPods for Job tracking

Kubernetes-commit: b76549665070beb2cc1a0410a6c7f66d8007f76b
2021-07-08 21:48:09 +00:00
Kubernetes Publisher
69e00b04ba Merge pull request #103548 from dims/drop-hashicorp-lru
Drop hashicorp lru - switch to the lru impl in k8s.io/utils

Kubernetes-commit: 9c4905e7af0d070d139c06638ab9868fd3521883
2021-07-08 09:46:36 +00:00
Kevin Delgado
7525c0e37a Manually set GVK in extract, add commentary to extractor
Kubernetes-commit: dda31bbf2e7a94624e3679e3db56c95e66509ce0
2021-07-08 01:56:58 +00:00
Davanum Srinivas
266e43aa73 update to new k8s.io/utils
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 3a221b3332464d7947aacee91e661880208ef901
2021-07-07 13:39:19 -04:00
Kubernetes Publisher
8abac606c4 Merge pull request #103487 from novahe/fix/fixture-data-race
client-go: fix fixture data race

Kubernetes-commit: 075ce33452879fe90f0893e008e5b5111e6b55fa
2021-07-08 01:46:45 +00:00
Kubernetes Publisher
b267864032 Merge pull request #103276 from NetApp/data-source-ref
Add DataSourceRef field to PVC spec

Kubernetes-commit: eaba61b4de9db615c73f868468ae2f816a4fe1c4
2021-07-07 17:49:30 +00:00
Kubernetes Publisher
4339f1ba5f Merge pull request #102181 from enj/enj/i/deprecate_gcp_azure
Deprecate azure and gcp in-tree auth plugins

Kubernetes-commit: 60475ee5c2dffd48a30018745ad7a2bafdf97bac
2021-07-07 05:46:37 +00:00
Kubernetes Publisher
68cb2ddef9 Merge pull request #102890 from ankeesler/exec-plugin-v1
exec credential provider: add v1 struct

Kubernetes-commit: 3392f16908a84dd96a29d52d2edee159fcb6711f
2021-07-06 21:46:29 +00:00
novahe
b7e5fce706 client-go: copying object to fix data race (#103148)
Kubernetes-commit: ce257266aa7f3f104e656b722310be32e95a9cb5
2021-07-05 21:55:55 +08:00
Kevin Delgado
690f06e07a Initial UnstructuredExtract without caching
Kubernetes-commit: 6e481c5db19cda1ef1b7506c22c0046e440c7fe2
2021-07-03 00:05:11 +00:00
Kubernetes Publisher
ca3a47f0b4 Merge pull request #99494 from enj/enj/i/not_after_ttl_hint
csr: add expirationSeconds field to control cert lifetime

Kubernetes-commit: 659c7e709f3b7f5f2a25e456525cd8747f2e68cc
2021-07-02 09:46:07 +00:00
pacoxu
9a97b38632 upgrade google.golang.org/api to v0.45.0
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: 2926b4572e687a761fe09a4dad2ee3579d330329
2021-07-02 11:34:32 +08:00
paco
e679b1fb37 upgrade github.com/prometheus/common to v0.28.0
Kubernetes-commit: 18d583653c67dbfafc9c5b09d9d6189705fdde85
2021-07-07 16:22:05 +08:00
Kubernetes Publisher
843bb800b1 Merge pull request #103176 from CaoDonghui123/updatemod
Update golang.org/x/net

Kubernetes-commit: c14017b270d21e6a7e79c0b8872a580f43a67220
2021-07-01 05:45:55 +00:00
Kubernetes Publisher
e9d2f61609 Merge pull request #103318 from jpbetz/fix-102749
Bump SMD to v4.1.2 to pick up #102749 fix

Kubernetes-commit: 0dad7d1c47c41f232b21cdd5c21be6683e545e9d
2021-06-30 21:46:05 +00:00
Kubernetes Publisher
45d107794c Merge pull request #99378 from mattcary/api
StatefulSet PersistentVolumeClaimDeletePolicy

Kubernetes-commit: 98d20f552bf93e268868c4211c9eed533a508415
2021-06-30 21:46:02 +00:00
Joe Betz
83ade40bcb Bump SMD to v4.1.2 to pick up #102749 fix
Kubernetes-commit: b790cf388ce1fce140c80bb0f7f9669288408b7a
2021-06-29 19:33:00 -07:00
Andrew Keesler
f00874ad93 exec credential provider: update tests+metadata for v1
Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 20e1c4d7548de0b39a2d70a748ca0b9aab28f631
2021-06-28 10:58:02 -04:00
Andrew Keesler
dba1c9aa68 promote client.authentication.k8s.io to v1
Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 30a6812aa13d11422b7d03b7d662b4857bddf24f
2021-06-28 10:56:57 -04:00
Kubernetes Publisher
e68c673b3c Merge pull request #103026 from sanposhiho/fix/typo-on-ExtractHoge
Fix typo on ExtractHoge documentation.

Kubernetes-commit: 49ac765b67cafcf881c01354195456a4a683b6ba
2021-06-28 11:45:32 +00:00
caodonghui
68518116c3 Update golang.org/x/net to v0.0.0-20210520170846-37e1c6afe023
Kubernetes-commit: c1d5a3a99e120281c618d6573d7b424138dfb5a9
2021-06-25 15:25:52 +08:00
Kubernetes Publisher
dae61bee3a Merge pull request #95472 from ahmedtd/lru-remove-mpl
Remove MPL-licensed dep from lruexpirecache

Kubernetes-commit: 89ebe77aebf2b5f0c9526f474b003358655dbac5
2021-06-24 23:45:54 +00:00
Kubernetes Publisher
f54e1433f8 Merge pull request #102540 from jpbetz/apply-client-docs
Add doc.go explaining client-go apply support

Kubernetes-commit: b27ad157792e9c306cbbc1a287d7905670d9836b
2021-06-24 23:45:52 +00:00
Monis Khan
e56c7dcd36 Generated
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 29b3fa782631ab65c7e1f48fecef58c5365577c8
2021-06-23 17:55:14 -04:00
Monis Khan
30cd4e9a49 csr: add expirationSeconds field to control cert lifetime
This change updates the CSR API to add a new, optional field called
expirationSeconds.  This field is a request to the signer for the
maximum duration the client wishes the cert to have.  The signer is
free to ignore this request based on its own internal policy.  The
signers built-in to KCM will honor this field if it is not set to a
value greater than --cluster-signing-duration.  The minimum allowed
value for this field is 600 seconds (ten minutes).

This change will help enforce safer durations for certificates in
the Kube ecosystem and will help related projects such as
cert-manager with their migration to the Kube CSR API.

Future enhancements may update the Kubelet to take advantage of this
field when it is configured in a way that can tolerate shorter
certificate lifespans with regular rotation.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: cd91e59f7c351fce47c064a5162c2cb79075159c
2021-06-25 22:08:10 -04:00
Joe Betz
50ffc02e9b Split documentation according to both mechanisms available for migration
Kubernetes-commit: 7f893f6bd62357e52ee77ddc64dd163a4a5f1224
2021-06-23 10:30:58 -07:00
Joe Betz
acf46abf8c Apply suggestions from code review
Co-authored-by: Daniel Smith <dbsmith@google.com>

Kubernetes-commit: 5d461adb3b8f8192695b3a3cd76d903347d3285a
2021-06-23 10:18:17 -07:00
Kubernetes Prow Robot
5a30221e6a Merge pull request #990 from nikhita/revert-direct-pr
Revert "Merge pull request #982 from sprutner/patch-1"
2021-06-22 01:13:58 -07:00
Nikhita Raghunath
18b053fa9a Revert "Merge pull request #982 from sprutner/patch-1"
This reverts commit e7ebdbcfc7, reversing
changes made to 3fae6f05ac.
2021-06-22 13:41:22 +05:30
Kubernetes Prow Robot
e7ebdbcfc7 Merge pull request #982 from sprutner/patch-1
Update README.md
2021-06-22 00:33:58 -07:00
sanposhiho
c374b402a0 Fix: typo with hack/update-codegen.sh
Kubernetes-commit: a2a8080169a3a52d6c6d5d613da4d92d579eedc9
2021-06-21 00:52:43 +09:00
tiloso
04efcfc452 Fix staticcheck in apiserver and client-go pkgs
Kubernetes-commit: 830a137d2ea70663cd94403595313b95ac40ffe8
2021-06-19 22:03:46 +02:00
Kubernetes Publisher
3fae6f05ac Merge pull request #103010 from BenTheElder/ansi-386-overflow
update Azure/go-ansiterm to v0.0.0-20210617225240-d185dfc1b5a1

Kubernetes-commit: 2ff70c77c98fdd3230ade470b319309f34909215
2021-06-19 07:19:03 +00:00
Benjamin Elder
eadbc45beb update Azure/go-ansiterm to v0.0.0-20210617225240-d185dfc1b5a1
fixes constant overflow on windows/386

Kubernetes-commit: 35e9d97f3e02a8757e5cc698142037c5a95487d9
2021-06-18 15:11:48 -07:00
Kubernetes Publisher
ca46d47734 Merge pull request #103007 from smira/error-wrapping
fix: properly wrap errors when reading response body in the client

Kubernetes-commit: d283d92121e88d282d4158d7834a7eccdb8774dc
2021-06-18 14:48:05 -07:00
Andrey Smirnov
c8b4c1e4bd fix: properly wrap errors when reading response body in the client
As `%v` doesn't allow error unwrapping, checks like `errors.Is` are not
working properly.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>

Kubernetes-commit: 6c0463bd2b616d0f22f47905bb26d66fa3b04e37
2021-06-18 23:35:31 +03:00
Kubernetes Publisher
848310b833 Merge pull request #102783 from mcbenjemaa/update-dep-gnostic
Update gnostic to the latest version

Kubernetes-commit: e9c6ec639cc5ca93a3f6e01ff4215f6b68d6142d
2021-06-18 19:19:10 +00:00
Kubernetes Publisher
0634aae869 Merge pull request #102946 from ahmed-mez/patch-1
Fix ServerGroupsAndResources docs typo

Kubernetes-commit: 48b7492f92997ac8cbb8b6c559a0c68cba3021ab
2021-06-18 04:36:04 -07:00
Mohamed chiheb Ben jemaa
68eb0a2b5d update vendor
Kubernetes-commit: 9571b1f884480879de54d5ff993ca336d61874b2
2021-06-17 17:24:43 +01:00
Ahmed Mezghani
eecff020f2 Fix ServerGroupsAndResources docs typo
Rename ServerResources -> ServerGroupsAndResources in ServerGroupsAndResources's doc-string.

Kubernetes-commit: c673e166383abff887f63900d3aff8bb2b58fb55
2021-06-17 12:26:05 +02:00
Chun Chen
d478a5752d Pass DeleteOptions down to the Reactor
Co-authored-by: Mo Khan <theenjeru@gmail.com>

Kubernetes-commit: 621970476f8f06419716325d573580be7b3378d9
2021-06-17 18:06:47 +08:00
Kubernetes Publisher
0a7756a242 Merge pull request #102441 from feiskyer/update-vendor
Update Azure Go SDK to v55.0.0

Kubernetes-commit: 122d6352452f3f4a2d52bdb8b114b6e0ec49358e
2021-06-17 02:01:31 +00:00
dprotaso
c6c0ca0e1e Simplify use of the fake dynamic client
With the introduction of GVK to the fake dynamic client it made using
the fake much more cumbersome.

Specifically:
- requires manual registration of list types
- mismatch between scheme types and passed in fixtures would result in errors

The PR changes the constructor method NewSimpleDynamicClient to do the following:
- rewire the schemes to unstructured types
- typed fixtures are converted to unstructured types
- automatically register fixture gvks with the scheme

This should make the dynamic client 'flexible' with it's inputs like it was
before

Kubernetes-commit: 418fa71b6b1d1fba930daaba1f8ecf55070b4bdf
2021-06-16 14:51:00 -04:00
Michael Morello
728eec7196 Return StatusError 404 in fake client when resource is not found
Kubernetes-commit: a93ad421ee949ef0ba6e3cd1c701a91dfefa62f6
2021-06-16 08:27:15 +02:00
Mohamed chiheb Ben jemaa
77d744302e Update github.com/googleapis/gnostic to v0.5.5 and updating transitive dependencies go-cmp, protobuf,, to adapt the latest gnostic release which cosists of [Update protos for Go protoc plugin compatibility]
Kubernetes-commit: c691386fef727a5494e3ab02b99196d8f6418241
2021-06-13 17:25:55 +01:00
Seth Rutner
d5f964d7ae Update README.md
This won't work if the ImagePullPolicy is not set to never as it tries to pull it.
2021-06-09 12:43:39 -07:00
Kubernetes Publisher
25e061e062 sync: remove Godeps/ 2021-06-09 11:58:24 +00:00
Kubernetes Publisher
3ecbde32b7 Merge pull request #102454 from wzshiming/clean/remove-godeps
Remove Godeps

Kubernetes-commit: 09a9e612947bb2d940224245890048d3e60d4c5d
2021-06-08 23:48:38 +00:00
Kubernetes Publisher
27d803afea Merge pull request #102606 from tkashem/revert-102581
Bring back "client-go: add retry logic for Watch and Stream" and fix test flake

Kubernetes-commit: b429c4c9e1b3004953dfa42e46ac901bdc9e4460
2021-06-07 23:48:53 +00:00
Kubernetes Publisher
ded678f91e Merge pull request #102412 from andrewsykim/kill-service-topology
Remove deprecated alpha Service topologyKeys field

Kubernetes-commit: 7ed2ed1b454fe8f09adf729c6cb814611634fea1
2021-06-04 19:56:50 +00:00
Abu Kashem
fc210d907d client-go: fix flake in test TestRequestWatchWithRetry
Kubernetes-commit: e797a5a1989373275311b745faf0ff97f5d61000
2021-06-04 15:12:48 -04:00
Abu Kashem
bbd71da939 Revert "Merge pull request #102581 from liggitt/revert-watch-retry"
This reverts commit 5a59a43957c6743995dac67fdda42bf8e0a9ca77, reversing
changes made to 81b9789eaa7bc067f417b5e74d5695dd6dd88a46.

Kubernetes-commit: 892d4fabb845e2461e3655aa414beb6ac322fc99
2021-06-04 13:45:26 -04:00
Kubernetes Publisher
742abf77bc Merge pull request #100939 from wzshiming/feat/subresource-match
Feature support FakeClientset match subresource

Kubernetes-commit: 5c137f1af94e23a71e7a7a3dad037f1193147778
2021-06-04 11:48:38 +00:00
Kubernetes Publisher
7801ce34b4 Merge pull request #102581 from liggitt/revert-watch-retry
Revert "client-go: add retry logic for Watch and Stream"

Kubernetes-commit: 5a59a43957c6743995dac67fdda42bf8e0a9ca77
2021-06-04 11:48:37 +00:00
Kubernetes Publisher
71f81dc715 Merge pull request #102467 from pacoxu/json-patch-5.5.0
upgrade json-patch to v4.11.0

Kubernetes-commit: 81b9789eaa7bc067f417b5e74d5695dd6dd88a46
2021-06-04 11:48:35 +00:00
Kubernetes Publisher
2a923d5fc6 Merge pull request #102059 from jsafrane/fix-consistentread
Retry reading /proc/mounts when unable to get a consistent read

Kubernetes-commit: 38783bfeb70f5d25262d195a779fbcfb72c73633
2021-06-04 07:48:48 +00:00
pacoxu
8e66c0aa21 upgrade gopkg.in/evanphx/json-patch to v4.11.0
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: 6e0650e3e132a5145a83b287fb90a30b5581bcac
2021-06-04 13:15:09 +08:00
Jordan Liggitt
5ba99a7f80 Revert "client-go: add retry logic for Watch and Stream"
This reverts commit 607d3819498e64d969407c3d7cbbb8f53d98f0d4.

Kubernetes-commit: e35af41a1236943b6510a25cfb8cb47855aaa16e
2021-06-04 01:11:25 -04:00
Kubernetes Publisher
fd12ff341f Merge pull request #102572 from JonZeolla/remove-insecure-curl-suggestion
Remove -k from toCurl output

Kubernetes-commit: be5874f959b6bc0122aa005e365943cb84f669a2
2021-06-03 15:53:02 -07:00
Jon Zeolla
a3215d72fd Remove -k from toCurl output
Kubernetes-commit: 5bf7bb52fe4c95e09b812e6c43eeed7abdd6d90f
2021-06-03 15:11:03 -04:00
Joe Betz
9ffcd1697f Add doc.go for client-go apply support
Kubernetes-commit: f94391789f14ec6bf534696afa2a61a357c817a2
2021-06-02 12:23:25 -07:00
Kubernetes Publisher
09dbda0b38 Merge pull request #102063 from tdihp/fix/azure-auth-refresh
Azure auth forwarding adal refresh error to azureTokenSource

Kubernetes-commit: eee6e54ecf364ee0529788eb5ad72d4ffaccf1b4
2021-06-02 03:48:13 +00:00
Kubernetes Publisher
caa2ddeb89 Merge pull request #102409 from dims/bump-golang.org/x/text-to-v0.3.6
Bump golang.org/x/text to v0.3.6

Kubernetes-commit: e0cb30170415cc122226360f722126930b451f88
2021-06-01 19:48:40 +00:00
Kubernetes Publisher
56494c9682 Merge pull request #102107 from tkashem/client-go-retry
client-go: add retry logic for Watch and Stream

Kubernetes-commit: 9c2684150c4d4aed99c6f950f4bc4c0754720897
2021-06-01 15:48:31 +00:00
Pengfei Ni
5e7391919a Update Azure Go SDK to v55.0.0
Kubernetes-commit: b98824c55d95b8b3a1cf79adac44154bd1702e46
2021-06-01 01:30:43 +00:00
Kubernetes Publisher
ef2d8844e4 Merge pull request #102897 from liggitt/etcd-ga
Update to etcd v3.5.0 client

Kubernetes-commit: f5cf74ddff818236b8435370afa41a51f23dd532
2021-06-16 06:01:16 +00:00
Jordan Liggitt
ead3c96c7d Update to etcd v3.5.0 client
Kubernetes-commit: 6448181d95c8d6486ba8e9a2a92b4a8172ca1f8f
2021-06-15 19:01:32 -04:00
Kubernetes Publisher
80617fc032 Merge pull request #100488 from liggitt/protobuf
update etcd, grpc, protobuf dependencies

Kubernetes-commit: 3a47ddccdfb09e73758cebb2690ad2a014f67e23
2021-06-15 22:01:06 +00:00
Kubernetes Publisher
d412730e5f Merge pull request #99310 from ankeesler/exec-plugin-interactive
exec credential provider: InteractiveMode support

Kubernetes-commit: 37da905c0c673c9cb07ca724384d37e725602a0c
2021-06-15 09:46:01 -07:00
Jordan Liggitt
0ba74ec6bf Update protobuf,grpc,etcd dependencies
1. Updated etcd/protobuf/grpc dependencies:

echo "
hack/pin-dependency.sh github.com/golang/protobuf latest
hack/pin-dependency.sh google.golang.org/protobuf latest
hack/pin-dependency.sh go.etcd.io/etcd/api/v3 v3.5.0-rc.0
hack/pin-dependency.sh go.etcd.io/etcd/client/v3 v3.5.0-rc.0
hack/pin-dependency.sh go.etcd.io/etcd/client/pkg/v3 v3.5.0-rc.0
hack/pin-dependency.sh go.etcd.io/etcd/pkg/v3 v3.5.0-rc.0
hack/pin-dependency.sh go.etcd.io/etcd/server/v3 v3.5.0-rc.0
hack/pin-dependency.sh go.etcd.io/etcd/tests/v3 v3.5.0-rc.0
hack/pin-dependency.sh google.golang.org/grpc latest
" | bash

2. Linted transitive dependencies until versions are clean:

hack/lint-dependencies.sh  | grep "  hack/pin-dependency.sh" | bash

3. Linted dependencies until dropped versions are clean:

hack/lint-dependencies.sh  | grep "dropreplace" | bash

4. Updated vendor and internal modules:

hack/update-vendor.sh
hack/update-internal-modules.sh

Repeated steps 2-4 until clean

Kubernetes-commit: 5cfc39ef5e90002080ff1f2bc4b7ade674c225f1
2021-06-15 10:06:09 -04:00
Andrew Keesler
37ed584bed exec credential provider: InteractiveMode support
The value here is that the exec plugin author can use the kubeconfig to assert
how standard input is treated with respect to the exec plugin, e.g.,
- an exec plugin author can ensure that kubectl fails if it cannot provide
  standard input to an exec plugin that needs it (Always)
- an exec plugin author can ensure that an client-go process will still call an
  exec plugin that prefers standard input even if standard input is not
  available (IfAvailable)

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: cd83d89ac94c5b61fdd38840098e7223e5af0d34
2021-06-14 17:15:36 -04:00
Kubernetes Publisher
1bccfc8c60 Merge pull request #102788 from pohly/reflector-log-level
client-go: reduce log level of reflector again

Kubernetes-commit: 60a4cbfdf617b94a28a76b302fd4cf04a704667c
2021-06-11 01:40:49 +00:00
Patrick Ohly
67de95ce2f client-go: reduce log level of reflector again
https://github.com/kubernetes/kubernetes/pull/87795 most likely
unintentionally increased the log level of "Starting reflector" and
"Stopping reflector", with the result that since Kubernetes 1.21
clients have printed that message by default. This is undesirable, we
should use the original level 3 again.

Kubernetes-commit: fd972934e4916879b04508686302659ce82cfa75
2021-06-10 20:36:02 +02:00
Shiming Zhang
b7739d8a13 Remove Godeps
Kubernetes-commit: 1431eab36d3e0468482aa234651ab878022a49e1
2021-05-31 17:44:41 +08:00
Andrew Sy Kim
cc4f429c89 apis: update generated code after removing Service topologyKeys
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>

Kubernetes-commit: f119b8df5f2fb88f73fbbd1a20e7aa397fe3f5eb
2021-05-28 12:20:07 -04:00
Davanum Srinivas
f2bdce0a84 Bump golang.org/x/text to v0.3.6
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: f924906173740342253bbae16fab695709d711ee
2021-05-28 11:07:25 -04:00
Kubernetes Publisher
ccac415190 Merge pull request #100842 from ravisantoshgudimetla/add-minReadySeconds-ss
api: Add min ready seconds & availablereplicas for statefulsets

Kubernetes-commit: a98d3d0700f6bea05711260d67603accb23ad143
2021-05-26 22:56:11 +00:00
Ben Swartzlander
0cb2597950 Add DataSourceRef field to PVC spec
Modify the behavior of the AnyVolumeDataSource alpha feature gate to enable
a new field, DataSourceRef, rather than modifying the behavior of the
existing DataSource field. This allows addition Volume Populators in a way
that doesn't risk breaking backwards compatibility, although it will
result in eventually deprecating the DataSource field.

Kubernetes-commit: 00dba76918e8ce5b5cff6719bbd64c2cd38ad4e2
2021-05-26 15:10:26 -04:00
Kubernetes Prow Robot
507a20486c Merge pull request #974 from dims/drop-outdated-broken-widgets
Drop outdated/broken widgets in README
2021-05-26 11:39:38 -07:00
Davanum Srinivas
f5566ffc0e Drop outdated/broken widgets in README
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-05-26 14:31:24 -04:00
Kubernetes Publisher
fe090a55f1 Merge pull request #102332 from pacoxu/klog-2.9.0
Bump klog to 2.9.0, fixing byte array display

Kubernetes-commit: 3726309bf9d59bccf28b9e22e1573764a5dd3fb5
2021-05-26 15:01:37 +00:00
Kubernetes Publisher
07ab04df8d Merge pull request #98077 from jayunit100/jay-netpol-win
NetworkPolicy E2E enablement for Windows

Kubernetes-commit: 494dc731d73df8ee71888516821b3c7f229ba3bb
2021-05-26 15:01:34 +00:00
pacoxu
6b087d20f4 upgrade klog to v2.9.0
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: 876174125bc0e0dda67fbe3d7ec7c4eb41ac5f69
2021-05-26 19:16:06 +08:00
jay vyas
7a25584131 Implement a windows Netpol NewModel
Kubernetes-commit: 8651fcb25a7a432c429d00ffa975555ad002010f
2021-05-25 10:03:21 -04:00
Kubernetes Publisher
39cb8cd8c1 Merge pull request #102217 from tkashem/client-go-refactor-retry
client-go: refactor retry logic so it can be reused

Kubernetes-commit: a8985871f9d8e069efdc6b82f41dbed8a39389ee
2021-05-24 18:56:28 +00:00
Kubernetes Publisher
228dada995 Merge pull request #102241 from lunhuijie/optimizationReturn
simplify returning boolean expression in staging/src/k8s.io/client-go/tools

Kubernetes-commit: d8e9f93358fe1e2e9603242dc5c0795e7e339812
2021-05-24 15:12:06 +00:00
Jan Safranek
50a473ddd5 Bump k8s.io/utils
To get io/ConsistentRead updates.

Kubernetes-commit: 1d16f934b9410496238b74b0664bd466f64277b3
2021-05-24 12:14:36 +02:00
刁浩 10284789
5b0c7191ef simplify returning boolean expression in staging/src/k8s.io/client-go/tools
Signed-off-by: 刁浩 10284789 <diao.hao@zte.com.cn>

Kubernetes-commit: 9173414da6d1c70436b256d6068e3737a7434f6a
2021-05-24 07:15:36 +00:00
Kubernetes Publisher
614c59d0d6 Merge pull request #102175 from ankeesler/exec-plugin-with-basic-auth
exec credential provider: don't run exec plugin with basic auth

Kubernetes-commit: 863e22cc9378942b2494aa9749626d1c90986ce9
2021-05-21 19:15:14 +00:00
Peri Thompson
dab51bb570 Add netpol tests for windows
Co-authored-by: Jay Vyas <jvyas@vmware.com>

Kubernetes-commit: 69019a03d3ac43823e7a739c01d3eeac86d699c0
2021-05-21 16:13:32 +01:00
Abu Kashem
239ec44d74 client-go: refactor retry logic so it can be reused
Kubernetes-commit: 5fdf196b4e9bbba036a43f4c3b5d9ed8af1672cc
2021-05-20 16:54:19 -04:00
Monis Khan
e2b531141a Deprecate azure and gcp in-tree auth plugins
With the client-go credential plugin functionality going GA in 1.22,
it is now time to deprecate these legacy integrations.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 6bfaeaf91658835aeea267500299de1c4a35a248
2021-05-20 11:54:16 -04:00
Andrew Keesler
9edbd9bed3 exec credential provider: don't run exec plugin with basic auth
If a user specifies basic auth, then apply the same short circuit logic
that we do for bearer tokens (see comment).

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 9dee2b95c27a9d61c2bade8fe67f120b5853c4d6
2021-05-20 09:17:17 -04:00
Kubernetes Publisher
d1fa200aef Merge pull request #102147 from kolyshkin/update-runc-rc94-take-II
vendor: bump runc to rc95

Kubernetes-commit: 5de1a754c8f875cacfa49b9c5ed63c6c35b7e9e5
2021-05-21 07:12:12 +00:00
Kubernetes Publisher
dd8d430f4c Merge pull request #99576 from marosset/windows-host-process-work
Windows host process work

Kubernetes-commit: 6e4e32985a1eef3c5bcc6fff8e10e4bfef770d08
2021-05-20 23:12:04 +00:00
Kubernetes Publisher
13cd91989c Merge pull request #102090 from mengjiao-liu/fix-data-race-csi
Prevent data race condition  in csi unit tests

Kubernetes-commit: 150675b1642e4769f029b4c4054b458e8a6e3700
2021-05-20 03:11:37 +00:00
Kubernetes Publisher
b0c8a7cef1 Merge pull request #102111 from dims/update-testing-related-deps-for-1.22
Update testing related dependencies (ginkgo|gomega|testify)

Kubernetes-commit: bacab40a9f9380e968406e91483bdc81f1b41bb0
2021-05-19 19:11:42 +00:00
Kir Kolyshkin
c7a06444ea vendor: bump runc to rc95
runc rc95 contains a fix for CVE-2021-30465.

runc rc94 provides fixes and improvements.

One notable change is cgroup manager's Set now accept Resources rather
than Cgroup (see https://github.com/opencontainers/runc/pull/2906).
Modify the code accordingly.

Also update runc dependencies (as hinted by hack/lint-depdendencies.sh):

        github.com/cilium/ebpf v0.5.0
        github.com/containerd/console v1.0.2
        github.com/coreos/go-systemd/v22 v22.3.1
        github.com/godbus/dbus/v5 v5.0.4
        github.com/moby/sys/mountinfo v0.4.1
        golang.org/x/sys v0.0.0-20210426230700-d19ff857e887
        github.com/google/go-cmp v0.5.4
        github.com/kr/pretty v0.2.1
        github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kubernetes-commit: f3cdfc488e88714f2fe695e35ad0d3f8e45ddc25
2021-05-19 09:59:29 -07:00
Davanum Srinivas
36ff79f048 update testing related dependencies
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 0803ea49b95579195fc55b4a64a6e859932dba7f
2021-05-18 19:31:47 -04:00
Kubernetes Publisher
03f765c56a Merge pull request #102094 from liggitt/revert-runc
Revert "Merge pull request #101888 from kolyshkin/update-runc-rc94"

Kubernetes-commit: 1295b2c4b59b8bba58186294eb2d76a7ecb4987e
2021-05-18 19:22:54 +00:00
Abu Kashem
55854fadb1 client-go: add retry logic for Watch and Stream
Kubernetes-commit: 607d3819498e64d969407c3d7cbbb8f53d98f0d4
2021-05-18 15:15:28 -04:00
Jordan Liggitt
940ff81aa0 Revert "Merge pull request 101888 from kolyshkin/update-runc-rc94"
This reverts commit b1b06fe0a4d80ac0fd67fae56f29a3710934a256, reversing
changes made to 382a33986b043f78a42d3d865d0ca383687bf171.

Kubernetes-commit: 4b45d0d921051627c43d5fc014e383a6cb872ade
2021-05-18 09:12:04 -04:00
Kubernetes Publisher
da281643cf Merge pull request #101888 from kolyshkin/update-runc-rc94
vendor: bump runc to rc94

Kubernetes-commit: b1b06fe0a4d80ac0fd67fae56f29a3710934a256
2021-05-18 10:29:38 +00:00
Kubernetes Publisher
253f58be50 Merge pull request #101817 from cndoit18/add-events-expansion
Add fieldSelector builder function to events.

Kubernetes-commit: a8f68f9aba47261c22ef178b58b615e00b6726d0
2021-05-18 10:29:35 +00:00
Mengjiao Liu
8cb6ac7646 Prevent data race condition in csi unit tests
Kubernetes-commit: 92d0f8e6cc3b3d40194759afa4c7f2880dd5ada4
2021-05-18 18:00:03 +08:00
Ping He
88929e8a2b Azure auth forwarding adal refresh error to tokenSource, fixes error when token refresh fails.
Signed-off-by: Ping He <tdihp@hotmail.com>

Kubernetes-commit: e105611d3a732a5b7bf34cf48f60b5a785181e6f
2021-05-17 22:02:52 +08:00
ravisantoshgudimetla
906f6d916e generated: Changes for api introduced
Kubernetes-commit: 5464b649812f08c7edaa1f5c39c93ce1e96cfbb4
2021-05-17 08:23:22 -04:00
Alexander Constantinescu
22aa998def [queue] Implement ShutDownWithDrain allowing the queue to drain when shutting down
Signed-off-by: Alexander Constantinescu <aconstan@redhat.com>

Kubernetes-commit: 5b740f430e0a4892e9db3a1fea9f349a06267755
2021-05-12 02:26:22 +02:00
Kir Kolyshkin
56ee358fec vendor: bump runc to rc94
One notable change is cgroup manager's Set now accept Resources rather
than Cgroup (see https://github.com/opencontainers/runc/pull/2906).
Modify the code accordingly.

Also update runc dependencies (as hinted by hack/lint-depdendencies.sh):

	github.com/cilium/ebpf v0.5.0
	github.com/containerd/console v1.0.2
	github.com/coreos/go-systemd/v22 v22.3.1
	github.com/godbus/dbus/v5 v5.0.4
	github.com/moby/sys/mountinfo v0.4.1
	golang.org/x/sys v0.0.0-20210426230700-d19ff857e887
	github.com/google/go-cmp v0.5.4
	github.com/kr/pretty v0.2.1
	github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kubernetes-commit: b49744f177087173d43d7771588d83b9df5a3c0b
2021-05-10 18:12:04 -07:00
cndoit18
39e54e70d0 Add fieldSelector builder function to events.
Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: 678e10f990ec187052a5a984e6ab180c13a7365e
2021-05-08 08:40:45 +08:00
Kubernetes Publisher
3cca9d72c1 Merge pull request #98057 from zerodayz/wrong-output-with-jsonpath
[jsonpath] fix wrong output when using jsonpath

Kubernetes-commit: 586ea8a482a2b5c01831b083ff6bd7b25d657f11
2021-05-18 10:29:31 +00:00
Kubernetes Publisher
9a82c6a51a Merge pull request #100940 from markusthoemmes/fake-client-interface
Implement a FakeClient interface

Kubernetes-commit: 8da9d2ff55ad98a685978dd690d66dfb4eb9c1fd
2021-05-18 10:29:28 +00:00
Kubernetes Publisher
2ed8b30810 Merge pull request #101707 from enj/enj/i/bad_cadata
client-go transport: assert that final CA data is valid

Kubernetes-commit: 9126048c9c47cc51f15f977da51c6023229a02b5
2021-05-18 10:29:24 +00:00
Monis Khan
776e602643 client-go transport: assert that final CA data is valid
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 440ea3ef49e0ac77353ceeaebc2aad6c995d5b35
2021-05-03 10:11:54 -04:00
Yusuke Tsutsumi
db078d2f1b client-go: NewSelfSignedCACert makes Go 1.15+ compatible cert (#100324)
* NewSelfSignedCACert makes Go 1.15+ compatible cert

As of Go 1.15, X.509 certificates without a SAN no longer
fall back to the CommonName of the certificate.

https://golang.org/doc/go1.15#commonname

Updating NewSelfSignedCACert to produce certificates that
work with this change.

* add missing license

Kubernetes-commit: a41a3ed4ae77a7902577bdb50b35fc5f42ed7c60
2021-05-18 10:29:21 +00:00
Kubernetes Publisher
341f59a1cb Merge pull request #101535 from adjika/feature/client-go_documentation
Fixes formatting and typos in client-go docs

Kubernetes-commit: a489c5a1f048d05cd234c52bbd7b78a06f4d79a6
2021-05-18 10:29:18 +00:00
kfu
6db26dd413 Fixes formatting and typos in client-go docs
Kubernetes-commit: d0de4483d51c5811202f1731a835c75d8fc8b30e
2021-04-27 21:28:23 +02:00
Kubernetes Publisher
c850435001 Merge pull request #101252 from smarterclayton/certificate_logging_upstream
Add type logging to certificate manager

Kubernetes-commit: 4f36038c0bc575cd33bc53017ed1e20184efae73
2021-05-18 10:29:15 +00:00
Kubernetes Publisher
e1f818cd3b Merge pull request #93412 from thinpark/fix.vardoc
[k8s.io/client-go/discovery/discovery_client]: CustomResourceDefinition

Kubernetes-commit: a8124860d2211943ba955d5953c01452b4bacfee
2021-05-18 10:29:13 +00:00
Kubernetes Publisher
b401b11652 Merge pull request #101002 from GreenApple10/feature/mod_timer
Change time.Now().Sub(x) to time.Since(x) for cleanup

Kubernetes-commit: 7cad93ac63126d68c0d12aa07a3aca2f6faf6287
2021-05-18 10:29:11 +00:00
Kubernetes Publisher
47b3cad4de Merge pull request #100496 from jpbetz/extract-subresources
Add subresource support to client-go apply extract

Kubernetes-commit: 10f7e189c2b07888211bc5a2b216b186a9e7e8a9
2021-05-18 10:29:09 +00:00
Kubernetes Publisher
d3fbdeba9a Merge pull request #101357 from feiskyer/update-vendor
Update Azure Go SDK version to v53.1.0

Kubernetes-commit: 253685779f15d2bf1ebf8354474761752edd8d6e
2021-05-18 10:29:06 +00:00
Kubernetes Publisher
9c26abce64 Merge pull request #97964 from sxllwx/avoid/alloc_array
modify the elements in the array directly without allocating a new array

Kubernetes-commit: c1336094a3ccaa497c8074c888f92d4093aa3360
2021-05-18 10:29:04 +00:00
Kubernetes Publisher
cfd0d8a109 Merge pull request #94120 from Dean-Coakley/fix-listWatchUntil-comment
Remove outdated comment on `wait.Until`

Kubernetes-commit: 74b290a77ca8799684f808b8446c24148849d161
2021-05-18 10:29:01 +00:00
Kubernetes Publisher
071918f6b2 Merge pull request #101034 from verb/1.22-ec-api
Switch alpha Pod ephemeralcontainers API to use Pod kind

Kubernetes-commit: 972ee2d425333d0b30f340328ef6c7dc40fd2715
2021-05-18 10:28:59 +00:00
Kubernetes Publisher
d696ff0aad Merge pull request #101162 from ihcsim/fix-malformed-request-logs
Fix Client-Side Request Throttling Malformed Logs

Kubernetes-commit: d3fbbfab5f928afe74ac9a6554b57008f3366d8f
2021-05-18 10:28:56 +00:00
Kubernetes Publisher
ae85206fc5 Merge pull request #101234 from gautierdelorme/rm-go-openapi-spec
eliminate dependency on go-openapi/spec

Kubernetes-commit: 565d5f456242fcc79b7540a4c4913c7577cbfc7d
2021-05-18 10:28:54 +00:00
Pengfei Ni
bee3e6b192 Update Azure Go SDK version to v53.1.0
Kubernetes-commit: bee44da7a258bbe3996ad3cc38d905ae9a28271e
2021-04-22 11:45:39 +08:00
Gautier Delorme
d60baad65c bump k8s.io/kube-openapi
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>

Kubernetes-commit: bcdde6bf75c7e177b44e58c5313e405c22d8d46d
2021-04-20 17:43:59 +02:00
Kubernetes Publisher
4e3d560817 Merge pull request #101269 from 3Xpl0it3r/master
remove duplicatd description in comment

Kubernetes-commit: 425859b7d6cf805a177e77c3e14faf5f95935aed
2021-05-18 10:28:50 +00:00
Kubernetes Publisher
db0131be28 Merge pull request #101174 from lojies/cleanupcertificate_manager_test
code cleanup:remove repeated package import in client-go

Kubernetes-commit: 2c1b0573c479d213f64db0e83c7d93d7895b8b4b
2021-05-18 10:28:48 +00:00
Kubernetes Publisher
bfec2914ea Merge pull request #100490 from howardjohn/gnostic-v051
Update kube-openapi and gnostic dependencies

Kubernetes-commit: c555b23f1c84bcdd1d87a7ae831675281f5c0c94
2021-05-18 10:28:47 +00:00
Kubernetes Publisher
10997424fc Merge pull request #100737 from Iceber/fix-delta-fifo
client-go/cache: fix the AddIfNotPresent method of the DeltaFIFO

Kubernetes-commit: 1c9563d5d5e6345fc2f1a835b456a8ce916474bf
2021-05-18 10:28:43 +00:00
3Xpl0it3r
abc6b41ce3 remove duplicatd description in comment
Kubernetes-commit: 21c15d197348987a572d0048e469ab860f409fa1
2021-04-20 13:44:58 +08:00
Kubernetes Publisher
8c8fa70f7a Merge pull request #100970 from apelisse/add-subresource-managedfields
Add subresource managedfields

Kubernetes-commit: 0f1d105f8d3e114f0bf47307513fe519a71351a2
2021-04-17 15:57:31 +00:00
卢振兴10069964
b1c481c6d5 code cleanup:remove repeated package import in client-go
Kubernetes-commit: 243dab458753002dae5741042840b21f9b831fbc
2021-04-16 08:40:30 +08:00
Ivan Sim
c8704063ca Fix the missing format specifier error in log output
The message argument is mistakenly used as the format specifier, if it
contains the special '%' characters. This causes many '[%d|%s](MISSING)'
errors in the API server logs.

Signed-off-by: Ivan Sim <isim@redhat.com>

Kubernetes-commit: b1d0d401875b2076e73183f8468ecb95c3fe61aa
2021-04-15 15:26:57 -07:00
Clayton Coleman
3faf506116 Add type logging to certificate manager
Kubelet cert rotation involves two certificate manager instances
(one for client and one for server certs) and the log lines are
identical and confusing. Since certificate manager is a utility
library it is also inappropriate to simply assume klog output is
sufficient.

certificate.Manager now accepts a Name and Logf function on its
config struct to identify the purpose of the manager and to
provide a way to redirect where output should go. If Name is
absent, the name is defaulted from the SignerName, and if that
is not found then the name is set to "client auth" if that is
a provided key usage, or "certificate" otherwise. If Logf is
not provided it defaults to klog.V(2). as today. The name is printed
in "foo: bar" form on every line, but can be converted to structured
logging in the future. The log level is not customizable and it
is up to the caller to decide whether that is an issue.

Some log messages are slightly cleaned up to more clearly indicate
their intent. One log message is removed in a utility function that
was already at v(4) and less likely to be needed.

The default behavior of the certificate manager is as before and
the kubelet now identifies the server and client signerName as
separate entities:

I0414 19:07:33.590419    1539 certificate_manager.go:263] kubernetes.io/kube-apiserver-client-kubelet: Rotating certificates
E0414 19:07:33.594154    1539 certificate_manager.go:464] kubernetes.io/kube-apiserver-client-kubelet: Failed while requesting a signed certificate from the master: cannot create certificate signing request: Post "https://...

Kubernetes-commit: 64c669bd0ac8fda39ba97f48ef887ac1f77fb014
2021-04-14 13:30:46 -04:00
Lee Verberne
2d8ed52d60 Generated code for Pod-based ephemeralcontainers
Kubernetes-commit: d8ee5ab09e0a0f476e2fe07014a453f572fb53a3
2021-04-12 17:28:29 +02:00
c00522440
ca138c86e8 Change time.Now().Sub(x) to time.Since(x) for cleanup
Kubernetes-commit: 878548ceac9c109881c379911b8b0d8fce5ea68e
2021-04-12 10:27:54 +08:00
Lee Verberne
0e8029b277 Switch ephemeralcontainers SR to Pod Kind
This changes the `/ephemeralcontainers` subresource of `/pods` to use
the `Pod` kind rather than `EphemeralContainers`.

When designing this API initially it seemed preferable to create a new
kind containing only the pod's ephemeral containers, similar to how
binding and scaling work.

It later became clear that this made admission control more difficult
because the controller wouldn't be presented with the entire Pod, so we
updated this to operate on the entire Pod, similar to how `/status`
works.

Kubernetes-commit: d22dc5cb72a627341f4004b5d58d275f3d8773b3
2021-04-09 13:53:13 +02:00
Shiming Zhang
87154808e1 Support subresource match
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>

Kubernetes-commit: 58833d652d59229d49f001256f6ade4a46ae53ca
2021-04-09 12:55:57 +08:00
Shiming Zhang
ce9fcb2fe0 Add test
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>

Kubernetes-commit: 2c9f02c3290ce7e8bcdc94bea7d96edf92834cd7
2021-04-09 13:07:46 +08:00
Iceber Gu
8269e41416 client-go/cache: fix the AddIfNotPresent method of the DeltaFIFO
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>

Kubernetes-commit: c75bd4a535123f5032f78ffb246ed62b79617b44
2021-04-01 13:44:16 +08:00
John Howard
4b5d87d34b Update kube-openapi and gnostic dependencies
Pulling in https://github.com/kubernetes/kube-openapi/pull/220

Kubernetes-commit: a849c8998c1ed71f25387a560f8359596aec8bd3
2021-03-23 08:33:15 -07:00
Joe Betz
0fd603dad0 Re-generate extract functions
Kubernetes-commit: a24e8acc32d7c0380a7b2c8a2f500b48891a9987
2021-03-19 15:28:20 -07:00
Tomáš Kukrál
5783ea1040 fix typo in retry doc
Kubernetes-commit: 1dc4a29a1aed89b598cb728986526d00390cdadc
2021-03-19 17:28:28 +01:00
Markus Thömmes
3579fb3012 Implement a FakeClient interface
Kubernetes-commit: cf26825e3d9b89526e13bb53f74354593477205c
2021-03-15 14:47:24 +01:00
Matthew Cary
dba85b7a7b tests for statefulset PersistentVolumeClaimDeletePolicy api change
Change-Id: I07c8e31a8c76a6a1022c08fb749af7e353b731de

Kubernetes-commit: b259686b367ffef89310a71875834a97befc5b4b
2021-03-01 16:10:16 -08:00
Andrea Nodari
6767d6d397 Generated code
Kubernetes-commit: 93dffdc1af7f9cef48864e7764ffda16e230cab9
2021-02-28 11:10:41 +01:00
Kubernetes Publisher
f19995f46d sync: update go.mod 2021-04-17 03:49:25 +00:00
Kubernetes Publisher
d974964d12 Merge pull request #100768 from Iceber/fix-nested-key-error
client-go/cache: support errors.Unwrap for KeyError

Kubernetes-commit: 9b9a67ad530daeb397b1b74c0104e65b14d3ca21
2021-04-16 19:49:32 +00:00
Kubernetes Publisher
4e267f6cae Merge pull request #100724 from liggitt/eviction-v1beta1
Add policy/v1 Eviction support

Kubernetes-commit: 27a625cf8921007eaf115425b6d61587eb253e92
2021-04-16 19:49:31 +00:00
Kubernetes Publisher
0c029ff945 Merge pull request #100503 from jpbetz/patch-3
Add jpbetz to client-go reviewers

Kubernetes-commit: 1fc5eb3bf2a42a70272d32ed270ff9ccebb61607
2021-04-15 23:50:04 +00:00
Kubernetes Publisher
f7d41dd5f9 Merge pull request #101086 from enj/enj/i/auth_owners_gen
Prune stale entries from OWNERS files

Kubernetes-commit: 24350a922ea2b1b2a8aeba58e150fa90370a282b
2021-04-15 15:49:53 +00:00
Monis Khan
7998e982ab Prune stale entries from OWNERS files
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 91241eac9b7a7e62cc31e663147294bf6dc8f875
2021-04-07 10:38:27 -04:00
Kubernetes Publisher
44bedf8611 Merge pull request #100885 from enj/enj/i/auth_owners
Update sig-auth OWNERS

Kubernetes-commit: d51f15ed0d47aa81c572076877c69e3107ad3bfc
2021-04-13 07:21:13 +00:00
Huang Huang
0cfeb7fda9 Fix staticcheck failures for vendor/k8s.io/client-go/transport (#100429)
* Fix staticcheck failures for vendor/k8s.io/client-go/transport

* avoid the possibility of a hang

Kubernetes-commit: 02d20442a5a5f5e1d3f1ef8e6fb14945462bc36c
2021-04-11 11:29:15 +08:00
Kubernetes Publisher
945ba71363 Merge pull request #100878 from wojtek-t/backoff_watches_on_429
Handle 429 errors from watch requests in reflector library.

Kubernetes-commit: 860dfe112eafa40cab93fbb66ee8622faff70887
2021-04-11 03:21:19 +00:00
Kubernetes Publisher
196e360f9b Merge pull request #100873 from Iceber/events-cache-typo
fix typo in comment for EventAggregatorByReasonFunc

Kubernetes-commit: d0017afe771ecaeac1b15f008885f1e2a66b3217
2021-04-11 03:21:18 +00:00
Kubernetes Publisher
0bb6464b13 Merge pull request #100784 from kevindelgado/smd-to-4-1-1
Update structured-merge-diff to v4.1.1

Kubernetes-commit: 442b3218b3d3eecdd9e55bffcb2c6b135f3084b7
2021-04-11 03:21:17 +00:00
Kubernetes Publisher
980164c05c Merge pull request #100684 from Jefftree/atomic
Tag structs as atomic

Kubernetes-commit: 081ac6b5a9004b7c6cfe6a8b8f83e60eca58a010
2021-04-09 15:24:20 +00:00
Kubernetes Publisher
ebfab03aeb Merge pull request #100570 from tiloso/staticcheck-clientgo-discovery
Fix staticcheck in k8s.io/client-go/discovery

Kubernetes-commit: 3fd31f12ee51ec02bdbd1aebf8b1f71da6207285
2021-04-09 15:24:17 +00:00
Kubernetes Publisher
eaeb6e789c Merge pull request #100458 from yliaog/master
added yliaog as approver

Kubernetes-commit: 9f6c5db697537711475c22eb925b0e28c8e3ad49
2021-04-09 07:33:05 +00:00
Kubernetes Publisher
2f4b7a2220 Merge pull request #100355 from onesafe/master
Replace deprecated NewDeltaFIFO with NewDeltaFIFOWithOptions

Kubernetes-commit: 84da9397527ff41bcb0b12b55e72f2e3b90b5f0d
2021-04-09 07:33:04 +00:00
Kubernetes Publisher
af56ae8bf9 Merge pull request #100217 from 0daryo/fix-example-workqueue-option-readme
Remove non-existent log option in workqueue example

Kubernetes-commit: 49092ff7906f29ec7e1c47dcaa2666fee00e37c3
2021-04-09 07:33:00 +00:00
Kubernetes Publisher
064bf3ddb9 Merge pull request #100085 from markusthoemmes/add-tracker-for-dynamic
Add Tracker() function to fake dynamic client

Kubernetes-commit: c6e826a79fb96b1c3cb88363a7d410cbe3c116f8
2021-04-09 03:21:05 +00:00
Kubernetes Publisher
4841142cdc Merge pull request #99849 from jpbetz/apply-subresources
Add subresource apply support to client-go

Kubernetes-commit: 7807bb03ba566effea20782f754e82c035fa54c4
2021-04-08 23:21:25 +00:00
Kubernetes Publisher
50af76e8cd Merge pull request #99839 from saschagrunert/portforward-stream-cleanup
Cleanup portforward streams after their usage

Kubernetes-commit: 4fae6ae5d211f1a45998c30d4ec765668a8361aa
2021-04-08 23:21:22 +00:00
Kubernetes Publisher
ea390324ae Merge pull request #97989 from Danil-Grigorev/atomic-label-selectors
Make selectors atomic

Kubernetes-commit: 1e05d25890afa9b4547c5585d0978ef56dcf07ca
2021-04-08 23:21:21 +00:00
Kubernetes Publisher
c71768cb91 Merge pull request #97419 from d-kuro/d-kuro/fix-data-race
Fix the data race in the leaderelection package

Kubernetes-commit: 93314d84b1ef1ea53c15e5bb86de47cf58f83178
2021-04-08 23:21:18 +00:00
Kubernetes Publisher
c36b96a74b Merge pull request #95897 from roycaihw/doc/fake-client-with-informer
Fake client example: document how to handle a race with informer

Kubernetes-commit: 6f8a058e2c29680dccffd9df07765c10e1f69b53
2021-04-08 23:21:17 +00:00
Monis Khan
4f026b62ab Update auth OWNERS files to only use aliases
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: bca4993004953041c91ad56e37ef195b32066c27
2021-04-07 10:42:00 -04:00
Iceber Gu
d39ae5d18d fix typo in comment for EventAggregatorByReasonFunc
Kubernetes-commit: 70d795ff65667eb3f26dc1e9c46bc2a56892350a
2021-04-07 15:06:14 +08:00
Kevin Delgado
54f0cda234 Update structured-merge-diff to v4.1.1
Kubernetes-commit: 5f1b146852124e6c5ebfc2b69aee7dfa4fe6d158
2021-04-02 17:42:54 +00:00
Iceber Gu
fc03592e80 client-go/cache: support errors.Unwrap for KeyError
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>

Kubernetes-commit: 85fa121f84ee33bdc8d77e7a35d1f4d2c063c28f
2021-04-02 10:17:57 +08:00
Jordan Liggitt
4c82a566d3 Generated files
Change-Id: Ibd7ac0392fd52ae7ce2f6864aefb47bf1b74f8c3

Kubernetes-commit: e22cd7dbc4d6b2c2de844811d15ed630312d2201
2021-03-31 15:39:55 -04:00
Jordan Liggitt
36954f768c Register Eviction v1
Kubernetes-commit: 40f8fb222491de331bb578413684a3388608e708
2021-03-31 15:39:41 -04:00
Kubernetes Publisher
67a7335497 Merge pull request #100660 from dims/common-auth-plugins-should-always-be-available
Common auth plugins should always be available

Kubernetes-commit: 3d48f0d1dd14216860adebd741550a8c955ab40b
2021-03-30 07:11:57 -07:00
Davanum Srinivas
3da4c9cb25 Common auth plugins should always be available
Whether `providerless` is present or not, the OIDC plugin
should be available.

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

Kubernetes-commit: b1e9fc4935e60092b4823bd67e82c4d2bfb1a7fc
2021-03-30 06:09:56 -04:00
Kubernetes Publisher
c8af929f7f Merge pull request #100606 from dims/providerless-tag-for-client-go-auth-plugins
Providerless tag for client go auth plugins

Kubernetes-commit: 26fc02a9e237025c59144872fcd123f1d880be57
2021-03-29 15:26:28 +00:00
Davanum Srinivas
6c816ada5f providerless tag for client-go auth plugins
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 1ac2d6f7fa45616ec968c39e66fbc526809edab7
2021-03-28 20:05:32 -04:00
tiloso
4820b53777 Fix staticcheck in k8s.io/client-go/discovery
Kubernetes-commit: dc16cf42852e25a70e1062b51b23c990f7f40c8a
2021-03-25 22:29:37 +01:00
Joe Betz
0d358cdc27 Add jpbetz to client-go reviewers
Kubernetes-commit: 7fa9da2cd6c6d56e9822a8eeee73a7232fa5c779
2021-03-23 16:49:17 -04:00
Yu Liao
1e560af237 added yliaog as approver
Kubernetes-commit: 1dbd5875e234e36a139fbee64072932aad8a75f6
2021-03-22 09:52:03 -07:00
Wang Yiping
aa707b1f81 Replace deprecated NewDeltaFIFO with NewDeltaFIFOWithOptions
Kubernetes-commit: 8dc45c8e0ecdefa37df8c118f38fa0767c5c52b0
2021-03-18 08:30:29 +08:00
wojtekt
03ebb2739b Handle 429 errors from watch requests in reflector library.
Kubernetes-commit: a9daa46d470e87ed328688bebd9314cc5ac0fc4a
2021-03-13 12:29:44 +01:00
Kubernetes Publisher
f6ce18ae57 Merge pull request #100156 from ehashman/issue-100155
Upgrade klog to avoid panics crashing components

Kubernetes-commit: 998f218606a149048e7b564ef27478bacab0f90f
2021-03-13 03:04:03 +00:00
Kubernetes Publisher
5f0702fefa Merge pull request #99375 from ehashman/probe-kep-2238
Add Probe-level terminationGracePeriodSeconds

Kubernetes-commit: faa5c8ccd4cb34c95d67b24bb35354a205ceee15
2021-03-12 10:58:23 +00:00
Elana Hashman
e5c17fcdd1 Bump klog to 2.8.0, fixing nil panics in KObj
Kubernetes-commit: 6b70c8bd8db844a5c2c26d2814b3306d83204a7a
2021-03-11 16:56:56 -08:00
Elana Hashman
2407de6b73 Generated changes for probe terminationGracePeriodSeconds
Kubernetes-commit: 7df1259d091322f2817b2db243f76470f61a3a7e
2021-03-11 16:40:40 -08:00
Kubernetes Publisher
a5722b416f Merge pull request #99759 from jpbetz/apply-extract
Add Extract support to client-go apply builders

Kubernetes-commit: eb0c118a9d7a15801ec0389448a5e1bffdaa5e72
2021-03-11 10:44:46 +00:00
Joe Betz
9cd23e7ffc Generate openapi and proto files
Kubernetes-commit: 5d86cff7c0518cd225b52794c51d2eae0dc75d1f
2021-03-10 21:07:09 -08:00
Markus Thömmes
57471dea7c Add Tracker() function to fake dynamic client
Kubernetes-commit: 4c4c78fd398899b4349c486063be6f4935cd92ce
2021-03-10 14:16:51 +01:00
Joe Betz
476d5f996a Generated apply configurations
Kubernetes-commit: e5a98bba6144935279509ec4defbb120d387e3fb
2021-03-07 14:49:10 -08:00
0daryo
2de7d23dca Remove non-existent log option
Kubernetes-commit: 3fbd3cf1cd55f99970a984f106006a02cce2c97b
2021-03-06 16:23:06 +09:00
Joe Betz
c36776731d Generate ApplyScale client support
Kubernetes-commit: 7a37df6d1ab8926a95574f0aab3a9978d20d4e35
2021-03-05 09:04:10 -08:00
Joe Betz
dbebceadf4 Add apply subresource support to client-go's typed client
Kubernetes-commit: 29423501f068d98d3e9addb9d56dd8fcf6ce4075
2021-03-05 08:09:32 -08:00
Sascha Grunert
0f6528b1f9 Cleanup portforward streams after their usage
This implements a stream cleanup when using portforwardings. Before
applying this patch, the streams []httpstream.Stream within
`spdy/connection.go` would fill-up for each streaming request. This
could result in heavy memory usage. Now we use the stream identifier to
keep track of them and finally remove them again once they're no longer
needed.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Kubernetes-commit: 6459ed6717d1851f9ca28e3f245672a6a62aa0bf
2021-03-05 13:39:04 +01:00
Joe Betz
9e347785cf Add extract apply function generation
Kubernetes-commit: 987657a80f12df5724e0d9cfb2d25d6c2bddd910
2021-02-26 14:17:39 -08:00
Joe Betz
982571f05a Bump SMD to v4.1.0
Kubernetes-commit: 5bc72f37a44fdfbf23ef1b29f2ec3a3efda2b5cc
2021-03-02 14:21:12 -08:00
Kubernetes Publisher
d6fad70fcf Merge pull request #99643 from pohly/generic-ephemeral-volume-beta
generic ephemeral volume beta

Kubernetes-commit: 410d092d8a13cc78ee9044e0aad194abbba1952b
2021-03-10 02:44:51 +00:00
Kubernetes Publisher
6085ad09f2 Merge pull request #99290 from mortent/PromotePDBsToGA
Promote PodDisruptionBudget to policy/v1

Kubernetes-commit: 046ad61479df0bfde00a25dff9d49c8025fa4f06
2021-03-09 22:47:50 +00:00
Kubernetes Publisher
814c68cfbc Merge pull request #99522 from robscott/topology-hints
Adding support for Topology Aware Hints

Kubernetes-commit: 207c75c6f7f25b1661e2063b7db6fc1a10bb58aa
2021-03-09 18:39:40 +00:00
Kubernetes Publisher
67d8c554b3 Merge pull request #99495 from wojtek-t/cleanup_describe_8
Move ownership of core events test to sig-instrumentation

Kubernetes-commit: 16e9c682ff48c8954ac956013a1622b3acff0c37
2021-03-09 14:39:34 +00:00
Kubernetes Publisher
db49dde90f Merge pull request #98973 from YoyinZyc/add_context_outside_apiserver
Apply context to restclient and serviceaccount metrics

Kubernetes-commit: 9457a5c3d8dd3892bb1133faa58d20399e05e871
2021-03-09 10:54:49 +00:00
Kubernetes Publisher
57d5462f1c Merge pull request #98946 from monopole/upgradeKustomize
Upgrade kustomize-in-kubectl to v4.0.5

Kubernetes-commit: ff3ccc58cd926260731c5e6f4a9405d595916369
2021-03-09 10:54:48 +00:00
Morten Torkildsen
fa732dd427 generated
Kubernetes-commit: 621aed4d323ef3064a77277e6396c4a6dd0a0fc5
2021-03-08 21:54:58 -08:00
monopole
1ae4d6910a until stable: pin-dependency, update-vendor, update-bazel, lint-dep
Kubernetes-commit: ba39d22e3976540d66fde0a650a7a463d75d5b17
2021-03-08 13:28:13 -08:00
Kubernetes Publisher
c2779356a2 Merge pull request #98727 from adtac/suspend
batch API: add suspended job

Kubernetes-commit: a0341d7471c238acd03e1923161b4a2671a7fe2d
2021-03-09 10:54:44 +00:00
Kubernetes Publisher
aa6ddc8e87 Merge pull request #99641 from pohly/storage-capacity-beta
CSIStorageCapacity beta API

Kubernetes-commit: 14c25eed8d07acdfaf882674f58fd2aa4cc7afe6
2021-03-09 10:54:41 +00:00
Adhityaa Chandrasekar
5ca42dac08 batch: add suspended job
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>

Kubernetes-commit: a0844da8f799e6f360193ecfd02c84d61a62958b
2021-03-08 11:50:02 +00:00
Rob Scott
9c787714aa Adding Hints to EndpointSlice API
Kubernetes-commit: 11f0944dbc70089e005f55b43d6507503a0491c5
2021-03-05 12:05:05 -08:00
wojtekt
4c5ab17317 Add sig-instrumentation approvers to events libraries OWNERS
Kubernetes-commit: 569626109af6d2dd40271efc9da84ea69308fccb
2021-03-05 16:45:20 +01:00
Patrick Ohly
37e7f4ab73 generic ephemeral volume: generate code
This is the result of "make update" minus the testdata update which
will be committed separately.

Kubernetes-commit: 52b758c9b634fa56ab923c31dbf9e312b1a0c171
2021-03-03 18:09:55 +01:00
Patrick Ohly
9f9bfd997e CSIStorageCapacity: generated files for beta
Kubernetes-commit: 2b062a62812ab3f33df5bc8839f0201b9087aa93
2021-03-03 12:44:52 +01:00
Kubernetes Publisher
7fc57bbd48 Merge pull request #96600 from maplain/internal-traffic-policy
Service Internal Traffic Policy

Kubernetes-commit: 2783f2f76ec57b9831b91e6c4b35d35cee4345e7
2021-03-08 21:24:58 +00:00
marosset
5d46949a09 API support for Windows host process containers
Co-authored-by: James Sturtevant <jstur@microsoft.com>

Kubernetes-commit: 93da0fd45d98176dc7f0def1e26530f99f9d9f08
2021-02-26 12:26:01 -08:00
Morten Torkildsen
62b9b26f6e Promote PDBs to GA
Kubernetes-commit: 21fba79d453b0bab7153f46916126c754d10341e
2021-02-20 12:56:31 -08:00
yoyinzyc
6a42ca30ba add context to restclient metrics
Kubernetes-commit: 69d40a1de7bc765647d8ef392fe406429fded807
2021-02-04 18:23:26 -08:00
Aldo Culquicondor
3bb4101a36 Add Job.status.uncountedPodUIDs
For tracking Job Pods that have finished but are not yet counted as failed or succeeded

And feature gate JobTrackingWithFinalizers

Change-Id: I3e080f3ec090922640384b692e88eaf9a544d3b5

Kubernetes-commit: bb56a0bd04891ae0a4aebeaeb4d145b32d9ad2d9
2021-01-18 13:36:03 -05:00
Robin Černín
b6d16d4e18 [jsonpath] fix wrong output when using jsonpath
Fix range loop when using jsonpath

Without patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running
 is Running

With patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running

Kubernetes-commit: 39cfe232325d66bcdbc935af7aaf7022562e7010
2021-01-14 19:53:59 +10:00
Danil-Grigorev
11ceec1b24 Make selectors atomic
Ensure that all label selectors are treated as atomic values,
to exclude situations when selectors are being corrupted by
different actors attempting to apply their overlapping definition
for this field with server-side-apply.

Kubernetes-commit: d8a7764b6396b90313ae7bd50a845f4da4705d67
2021-01-12 18:29:56 +01:00
scott
c7901fa3e4 modify the elements in the array directly without allocating a new array
Kubernetes-commit: 238fce9357634502badbcc3704b0655cf8c378c3
2021-01-12 19:58:21 +08:00
d-kuro
b4027a90c4 Fix data race for leaderelection package
Kubernetes-commit: 8eda5521c041bbcd5ad19b3cfff49202e7eb5d22
2020-12-21 22:21:42 +09:00
Fangyuan Li
9baafcd261 Implements Service Internal Traffic Policy
1. Add API definitions;
2. Add feature gate and drops the field when feature gate is not on;
3. Set default values for the field;
4. Add API Validation
5. add kube-proxy iptables and ipvs implementations
6. add tests

Kubernetes-commit: 7ed2f1d94d694c6c4fdb4629638c38b1cbda7288
2020-11-15 23:59:58 -08:00
Kubernetes Publisher
fa8f4cc307 Merge pull request #99214 from jpbetz/apply-client-go-builders2-typedclient
Add Apply to client-go's typed client

Kubernetes-commit: e688f22da07465a88728210412470e14330f1563
2021-03-07 09:24:16 +00:00
Kubernetes Publisher
b4932b529f Merge pull request #99907 from liggitt/cache-test-timeout
Add test timeout to mutation detector test

Kubernetes-commit: dc493bb553c846719dff0075df174ecaa5d9f97b
2021-03-07 05:27:16 +00:00
Kubernetes Publisher
8df02b312c Merge pull request #99662 from swetharepakula/eps-ga-api-changes
Graduate EndpointSlice API to GA

Kubernetes-commit: 36244f31ef78dd3dd6bfbb74e1b15b4d01edcd6c
2021-03-07 05:27:15 +00:00
Kubernetes Publisher
d2a6442e7d Merge pull request #99275 from hbagdi/feat/ingress-class-namespaced-params
Add namespace scoped ParametersReference to IngressClass

Kubernetes-commit: 4bf85032f3c391ff710390c41996642cd4134c40
2021-03-07 05:27:12 +00:00
Jordan Liggitt
21ee617309 Add test timeout to mutation detector test
Kubernetes-commit: 877d889ac2c78b1c8c94dc2839351aad4136f908
2021-03-06 18:16:42 -05:00
Harry Bagdi
9db6403e9d Add namespace scoped ParametersReference to IngressClass
Kubernetes-commit: a7fc92089a42aff0c2f10d56b0ee290440adfbc4
2021-03-06 03:03:20 +05:30
Kubernetes Publisher
75a1e7fffe Merge pull request #99423 from soltysh/cronjob_controller
Switch cronjob controller to batch/v1

Kubernetes-commit: 06a4b6f3421b11a3df4653e07bcee8b2cfcc1b12
2021-03-06 13:33:22 +00:00
Kubernetes Publisher
1745c9faaa Merge pull request #99817 from liggitt/zero-value
Fix zero-value custom resource validation with go1.16

Kubernetes-commit: feab32b220cd39699696d832020f8808a70bb412
2021-03-06 13:33:19 +00:00
Kubernetes Publisher
fcacc4b270 Merge pull request #98277 from XudongLiuHarold/add-loadbalancerclass-field
Add LoadBalancerClass field in service

Kubernetes-commit: 66cbf0196bd5ed0f06d7c40fccba887aae5405d8
2021-03-05 13:22:13 +00:00
Kubernetes Publisher
4f212856ea Merge pull request #98127 from mortent/AddConditionsToPDBs
Add conditions to PDB status

Kubernetes-commit: 7a4914014521369be9e5162b869476fdfc7ea2f9
2021-03-05 13:22:11 +00:00
Morten Torkildsen
da66d1b7ed generated
Kubernetes-commit: b08eb95168a482c315b5c1c9e869ca41325f32c1
2021-03-04 19:03:00 -08:00
Kubernetes Publisher
503eb33ae5 Merge pull request #99782 from liggitt/race-tests
Fix or remove tests that don't work in race mode

Kubernetes-commit: 110b9272f27c97e1bf3fd5335124de063c3e9a48
2021-03-05 05:22:11 +00:00
Kubernetes Publisher
ec8fb0246c Merge pull request #99012 from jpbetz/apply-client-go-builders2
Apply Builders for client-go's typed client

Kubernetes-commit: 03d242665dbe39b3ceeb8562850602480e5788b8
2021-03-05 01:26:19 +00:00
Jordan Liggitt
d21dde2a15 Update k8s.io/kube-openapi
Kubernetes-commit: 5515157f82ceb1a9f9a267f32629add6d8f522f7
2021-03-04 19:45:51 -05:00
Jordan Liggitt
0693903770 Fix or remove tests that don't work in race mode
Kubernetes-commit: 68bb8b827b3827cbee61d3fcc560738beba3e110
2021-03-04 09:51:52 -05:00
Swetha Repakula
2eb8aff5d3 Graduate EndpointSlice API to GA
* Removes discovery v1alpha1 API
  * Replaces per Endpoint Topology with a read only DeprecatedTopology
  in GA API
  * Adds per Endpoint Zone field in GA API

Kubernetes-commit: a9891b4b9b909b76533a50812c21575cd96c43b1
2021-03-03 06:47:10 +00:00
Joe Betz
a793842303 Generate typed clients with Apply support
Kubernetes-commit: 08d5565b9b3892032ae98fe1592413e1703c2e3e
2021-02-18 13:07:36 -08:00
Joe Betz
f146f0fa13 generate applied configurations
Kubernetes-commit: c541c6933123ee7a9e66e2443f212b8829b29b3c
2021-02-11 17:05:24 -05:00
Kubernetes Publisher
9409f5796d Merge pull request #99741 from liggitt/client-go-install
Update client-go install instructions

Kubernetes-commit: 4d5868afc3f2ba2f9fb6a31fd9c47a04784a07fc
2021-03-04 13:22:06 +00:00
Kubernetes Publisher
a71c2f1241 Merge pull request #98892 from ankeesler/exec-plugin-metrics
exec credential provider: add rest_client_exec_plugin_call_total metric

Kubernetes-commit: cd54b1931d015df7c1609043d81b1f8308f2187d
2021-03-04 09:23:07 +00:00
Kubernetes Prow Robot
a5abe9cdbf Merge pull request #937 from liggitt/update-readme
Update readme installation instructions
2021-03-03 19:51:59 -08:00
Kubernetes Publisher
1cfb136f90 Merge pull request #99654 from ankeesler/exec-plugin-interactive-fix
exec credential provider: use stdin to detect user interaction

Kubernetes-commit: e2eb9f000528556cc7af2a3db4259a60b61a3f6f
2021-03-04 01:22:14 +00:00
Jordan Liggitt
e0f03ac11e Update client-go install instructions
Kubernetes-commit: 41c12a847ce601a5bad7f7c64277a6ef46f234d4
2021-03-03 19:24:07 -05:00
Jordan Liggitt
2dec69cc24 Update readme installation instructions 2021-03-03 19:23:07 -05:00
Kubernetes Publisher
a337294871 Merge pull request #98572 from justaugustus/go116
[go1.16] Update to go1.16

Kubernetes-commit: e4e9c31218becac11f176cc824f5cc6b7a8036ac
2021-03-03 09:26:32 +00:00
Andrew Keesler
149c501b92 exec credential provider: use stdin to detect user interaction
We are not sure why this was stdout, since stdin is what the user uses to pass
information to the exec plugin.

There is a question of backwards compatibility here. Our take is that this is a
bug, and so we are ameliorating behavior instead of breaking behavior. There are
2 main cases to consider with respect to backwards compatibility:

1. an existing exec plugin depended on stdin being hooked up to them if stdout
   was a terminal (e.g., echo foo | client-go-command-line-tool); we believe
   this is an anti-pattern, since the client-go-command-line-tool could be using
   stdin elsewhere (e.g., echo foo | kubectl apply -f -)

2. an existing exec plugin depended on stdin not being hooked up to them if
   stdout was not a terminal (e.g., client-go-command-line-tool >/dev/null);
   hopefully there are very few plugins that have tried to base logic off of
   whether stdin returned EOF immediately, since this could also happen when
   something else is wrong with stdin

We hope to apply a stronger fix to this exec plugin user interaction stuff in a
future release.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: aea995c45ff057406b586144e28bd9575162b8df
2021-03-02 14:30:42 -05:00
Stephen Augustus
b13f594878 Fixup golang.org/x/term staticcheck warnings
Errors from staticcheck:
cmd/preferredimports/preferredimports.go:38:2:
  package golang.org/x/crypto/ssh/terminal is deprecated:
  this package moved to golang.org/x/term.  (SA1019)
vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go:36:2:
  package golang.org/x/crypto/ssh/terminal is deprecated:
  this package moved to golang.org/x/term.  (SA1019)
vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go:26:2:
  package golang.org/x/crypto/ssh/terminal is deprecated:
  this package moved to golang.org/x/term.  (SA1019)

Please review the above warnings. You can test via:
  hack/verify-staticcheck.sh <failing package>
If the above warnings do not make sense, you can exempt the line or
file. See:
  https://staticcheck.io/docs/#ignoring-problems

generated:
- hack/update-internal-modules.sh
- hack/lint-dependencies.sh
- hack/update-vendor.sh

Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: d9435800b65d6787beaf061546599d757b8e87c9
2021-03-02 00:14:47 -05:00
Jordan Liggitt
768a62f124 [go1.16] bump golang.org/x/... dependencies
hack/pin-dependency.sh golang.org/x/crypto latest
hack/pin-dependency.sh golang.org/x/net latest
hack/pin-dependency.sh golang.org/x/exp latest
hack/pin-dependency.sh golang.org/x/sys latest
hack/pin-dependency.sh golang.org/x/time latest
hack/pin-dependency.sh golang.org/x/tools latest

hack/lint-dependencies.sh
hack/pin-dependency.sh dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037
hack/pin-dependency.sh golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f
hack/pin-dependency.sh golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449

hack/lint-dependencies.sh

hack/update-internal-modules.sh
hack/update-vendor.sh

Co-authored-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: ecef45df84a082c71dd3d96e6adb181a2c5b3790
2021-02-25 10:13:12 -05:00
Stephen Augustus
0ea7217dc7 generated: Run hack/lint-dependencies.sh and hack/update-vendor.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 7216970cf25a39ad2e1208ad1eb5006599ca41ca
2021-02-25 09:25:53 -05:00
Stephen Augustus
36b22fd96c [go1.16] go.mod: update to go1.16
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 3c2824e3dbed6069dabddac7816239de9cb2a6ee
2021-02-15 04:46:56 -05:00
Kubernetes Publisher
fcbadc8b41 Merge pull request #99561 from BenTheElder/remove-bazel
Remove Bazel

Kubernetes-commit: 5498ee641b3459a0da1d4b2d42d502a318194189
2021-03-01 21:22:23 +00:00
Benjamin Elder
13e6cd336d hack/update-bazel.sh
Kubernetes-commit: 56e092e382038b01c61fff96efb5982a2cb137cb
2021-02-28 14:17:42 -08:00
Kubernetes Publisher
6a251876df Merge pull request #99324 from zshihang/master
reset token if got Unauthorized in KCM

Kubernetes-commit: 3cde6b199900ebc6d6dc415a6036d6fa8fcc1ae0
2021-02-27 01:22:16 +00:00
Kubernetes Publisher
c3c3d406ff Merge pull request #99377 from liggitt/version-sha
Switch gitVersion format to non-abbreviated hash

Kubernetes-commit: ab221b5d9f98833da2cbb5754fc2e7685bf80298
2021-02-26 21:22:12 +00:00
Kubernetes Publisher
8f8241f9ef Merge pull request #99195 from pacoxu/structurelog/watch-retry-timeout-1
migrate "client-go retry-watcher watch" to structured logging

Kubernetes-commit: f41aeffffbbaebc29d36492482a46d6e0ee179f2
2021-02-24 05:22:04 +00:00
Jordan Liggitt
1a6e9022ba Switch gitVersion format to non-abbreviated hash
Kubernetes-commit: b5efddb393e7beafc14bb2c3bd50598eb7a1b807
2021-02-23 16:14:29 -05:00
Shihang Zhang
3d6ec322f2 reset token if got Unauthorized in KCM
Kubernetes-commit: 5e7b60ba5fe218d8ac59496350dfdb9f43785d98
2021-02-22 15:38:18 -08:00
Kubernetes Publisher
12449b5492 Merge pull request #99193 from zhijianli88/subresource
request.go: correct subresource referencing

Kubernetes-commit: e16c6cc3483989899961c623518a1150e9078495
2021-02-19 05:21:55 +00:00
Kubernetes Publisher
fa31d62bd0 Merge pull request #99111 from databus23/patch-5
Return error when persister fails to modify config

Kubernetes-commit: a4f412dc769643723f42aa78dcea60b827d7bf55
2021-02-19 01:21:56 +00:00
pacoxu
06efd86142 Migrate client-go retry-watcher to structured logging
Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

Kubernetes-commit: c4dc34e8cbad41968c50763f79280e7cd14dabee
2021-02-18 19:06:34 +08:00
Li Zhijian
bb1d67da92 request.go: correct subresource referencing
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>

Kubernetes-commit: 678e4ebaf6534e9b15fc4cc8602caadbead2e40e
2021-02-18 17:51:55 +08:00
Kubernetes Publisher
21dd7eaeef Merge pull request #99079 from tkashem/throttle-message
add more context to client-go request throttling message

Kubernetes-commit: 83e140125c96bf9dbde46f4c13ebccb3909951cc
2021-02-17 21:33:28 +00:00
Kubernetes Publisher
10def0e245 Merge pull request #99063 from ZxYuan/patch-1
Fix typo in client-go/rest/client.go

Kubernetes-commit: 7e2e928f3920825f17096c959500f7b72dc51f8e
2021-02-17 21:33:27 +00:00
Kubernetes Publisher
7279fc64d8 Merge pull request #96987 from soltysh/drop_batch-alpha
Drop batch/v2alpha1

Kubernetes-commit: 4f1dd5d2fbe42f39a841016796c5646711946ad1
2021-02-17 17:21:42 +00:00
Kubernetes Publisher
df50762b9f Merge pull request #99014 from apelisse/update-smd
Update sigs.k8s.io/structured-merge-diff to v4.0.3

Kubernetes-commit: 93252fa433214462e61495a63e792b756fd6777a
2021-02-17 01:23:14 +00:00
Kubernetes Publisher
39da007993 Merge pull request #99110 from nikhita/clean-up-owners-jan-2021
Remove inactive members from OWNERS - Jan 2021

Kubernetes-commit: 47d076610681d027c9c7e28ca08e29e6dd49a138
2021-02-16 17:27:02 +00:00
Fabian Ruff
a125444d4d Return error when persister fails to modify config
Kubernetes-commit: 9efd1fd12f646b0a328702cca4c52fdf0966212d
2021-02-16 08:45:59 +01:00
Nikhita Raghunath
1d0cb03f5a *: remove nikhiljindal from OWNERS
Kubernetes-commit: 6cef3a4e33c10c27bb301a1070ea3ff4cdad0c39
2021-02-16 10:50:50 +05:30
Nikhita Raghunath
e8ab2528ca *: remove madhusudancs from reviewers
Kubernetes-commit: 6b12c96a9b7fe4d7c03d0dfed447edd6b1055067
2021-02-16 10:40:42 +05:30
Nikhita Raghunath
4c4207ac6f *: move gmarek to emeritus_approvers
Kubernetes-commit: b11516d69f2131327931a2cf7452d5e891d7e520
2021-02-16 10:31:19 +05:30
ZxYuan
a9fe1e1ae9 Fix typo in client-go/rest/client.go
Kubernetes-commit: cd63fd4543b99a45d0920421d0bd23af6f762dc8
2021-02-14 00:18:41 +08:00
Abu Kashem
d1fdbcd4dc client-go: add more context to request throttle message
Kubernetes-commit: bc66d3d137d3600b117be390ccb253a9dbcde25e
2021-02-12 14:39:44 -05:00
Antoine Pelisse
508a193d5a Update sigs.k8s.io/structured-merge-diff to v4.0.3
Kubernetes-commit: 707612732a7b43aa12e329b0cd6308116ff4af4d
2021-02-11 17:01:23 -08:00
Maciej Szulik
627c12d005 Generated changes
Kubernetes-commit: 1fc8fe0f7d9b2cea395a297c4ebbde9b5937b460
2021-02-10 14:52:27 +01:00
Kubernetes Publisher
20732a1bc1 Merge pull request #98889 from jkaniuk/leaderelection-simplify
Simplify leader election code

Kubernetes-commit: 93d288e2a47fa6d497b50d37c8b3a04e91da4228
2021-02-09 07:50:49 -08:00
Andrew Keesler
8aa3e0f684 exec credential provider: add rest_client_exec_plugin_call_total metric
Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 31eec29b098f790cd96fd6d2441e68938f15363b
2021-02-08 15:20:15 -05:00
Jacek Kaniuk
0eaf14c16e Simplify leader election code
Kubernetes-commit: c891207ab7c9e8e2ffb75edf41e6525d57543773
2021-02-08 19:28:55 +01:00
Kubernetes Publisher
100613764a Merge pull request #98790 from jkh52/master
Bump konnectivity-client to v0.0.15

Kubernetes-commit: 96a98e50afa7641d6f0e4fb324041126ff5a4ec2
2021-02-06 01:11:12 +00:00
Joseph Anttila Hall
bf60d3faed Bump konnectivity-client to v0.0.15
$ ./hack/pin-dependency.sh \
  sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15
$ ./hack/update-vendor.sh

Kubernetes-commit: 6499d4a730f8e6159da3e6c43f8ea6b13c5f46e5
2021-02-04 19:42:20 -08:00
Kubernetes Publisher
93ce9718ff Merge pull request #98671 from liggitt/kubeconfig-env
Isolate TestModifyContext from $KUBECONFIG

Kubernetes-commit: edd4576510445fae06cab29ba6dbd286a99987fd
2021-02-03 04:12:31 +00:00
Kubernetes Publisher
3c12da5d77 Merge pull request #98324 from atosatto/export-debug-roundripper
client-go: export NewDebuggingRoundTripper function and DebugLevel

Kubernetes-commit: 27104f159557da6bec20cf8227b468b1f22cd884
2021-02-03 00:20:23 +00:00
Kubernetes Publisher
3147a30d7b Merge pull request #98477 from palnabarun/update-gogo/protobuf
Update gogo/protobuf to v1.3.2

Kubernetes-commit: 4d3ed163a0ed45e8790801d74503fe300d05daa0
2021-02-02 20:12:39 +00:00
Jordan Liggitt
b620e827ab Isolate TestModifyContext from $KUBECONFIG
Kubernetes-commit: ce7e1e214a9b690f2222397c82c14c0d10905940
2021-02-01 14:03:07 -05:00
Kubernetes Publisher
ab82d40f6e Merge pull request #98488 from pohly/klog-2.5.0
klog 2.5.0 + logr 0.4.0 update

Kubernetes-commit: 76ead99a5601d89ac83a6a633cd2f828145adbff
2021-01-30 04:12:07 +00:00
Kubernetes Publisher
c8e0107904 Merge pull request #98565 from adisky/move-spdystream
Move dependency docker/spdystream to moby/spdystream

Kubernetes-commit: 64a6ee4321d37740b84a5c5c7aaa67e0bf6b6508
2021-01-29 20:12:47 +00:00
Aditi Sharma
b8b770f6b7 Update dependency docker/spdystream to moby/spdystream
docker/spdystream has been moved to moby/spdystream.

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>

Kubernetes-commit: c5c938a056abdf9961962554013632d6cfd3bbd4
2021-01-29 12:03:46 +05:30
Kubernetes Publisher
6329432013 Merge pull request #98496 from lavalamp/connrotation
Remove unbounded connection creation; also change worst case delay from 50s to 5s

Kubernetes-commit: 9f2f1b8c460b4b5ec8bfcd34490fb259ebad65b0
2021-01-28 08:12:11 +00:00
Daniel Smith
5985bbb560 Fix unbounded connection creation & 50s of delay
Kubernetes-commit: 80c3ec4c6a62486b0993b2e2f51c3e6f9bd6413a
2021-01-27 16:47:04 -08:00
Patrick Ohly
362c4854a6 logging: support call depth via logr, structured logging
The new releases of klog (via klogr) and logr expose support for call
traces via a new WithCallDepth API in logr.

The new klogr can be configured to pass structured log entries into
klog instead of turning them into a single text message.

Kubernetes-commit: 562a39a2e1e26854c06ac2b317f6f8a4ebb23ac1
2021-01-27 20:36:56 +01:00
Nabarun Pal
28611520a9 update gogo/protobuf to v1.3.2
gogo/protobuf@v1.3.2 fixes https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3121

Ref: https://github.com/kubernetes/client-go/issues/927

Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>

Kubernetes-commit: 9cada2ec3ba793597606a1df1375ff8e8311ccf3
2021-01-27 18:01:27 +05:30
Andrea Tosatto
ef84e47785 Re-run gofmt against staging/src/k8s.io/client-go/transport/
Kubernetes-commit: 1449af17555eb5148d11556ee205c42b83821af0
2021-01-27 00:08:07 +00:00
Andrea Tosatto
e87f4d8d19 Remove unexpected updates to go.mod and go.sum
Kubernetes-commit: 961fa25dd4468cad40274258c701e5d48fa02c5e
2021-01-26 23:49:25 +00:00
Andrea Tosatto
9d369ea084 Update bazel BUILD file
Kubernetes-commit: bdd2da5c7eb98e4f7ce02977793b7268c717d98a
2021-01-26 23:31:42 +00:00
Andrea Tosatto
84db31c178 Address golint warnings
Kubernetes-commit: 675cefa1d15cadc5d1772d0ced16a3e843488347
2021-01-26 23:29:32 +00:00
Andrea Tosatto
8d3dc9e9ef Run gofmt against staging/src/k8s.io/client-go/transport/round_trippers_test.go
Kubernetes-commit: e87349f3caa810b96ed86fac7aec6bd0e73dacb1
2021-01-26 23:14:56 +00:00
Andrea Tosatto
2bce1731eb Run gofmt against staging/src/k8s.io/client-go/transport/round_trippers.go
Kubernetes-commit: 9cb5580ac6584cc787a2b2061c6c61656d065392
2021-01-26 22:04:52 +00:00
Andrea Tosatto
5c01a03456 client-go: export NewDebuggingRoundTripper function and DebugLevel
`debuggingRoundTripper` is a useful throbleshooting tool to debug of Kubernetes API requests and their timing.

Unfortunately, as of today, it can only be used via the `DebugWrappers` function, which automatically adjust the amount of debug information exposed by the roundTripper based on the configured `klog` verbosity.

While `DebugWrappers` definitely fits the purpose for clients using `klog`, this is currently hard to be used for controllers using `controller-runtime`, which uses `github.com/go-logr/logr` for logging.

In this PR we change the visibility of `newDebuggingRoundTripper` and `debugLevel` in order to be directly accessible from users of the `k8s.io/client-go/transport` package.

In particular, the changes proposed in this PR allow users of `controller-runtime` to use the `debuggingRoundTripper` to intercept Kubernetes API requests as follows

```go
import (
        ctrl "sigs.k8s.io/controller-runtime"
)

func init() {
	ctrl.SetLogger(zap.New())
}

func main() {
        // wrap the http transport used by the Kubernetes client
	restConfig, err := ctrl.GetConfig()
	checkError(setupLog, err, "unable to get kubernetes client config")

        restConfig.Wrap(func(rt http.RoundTripper) http.RoundTripper {
		return transport.NewDebuggingRoundTripper(rt, transport.DebugJustURL)
	})

        ...
}
```

Kubernetes-commit: 8de53ce96cb58d56fd00e91d8bcf7761ab498b83
2021-01-22 14:57:14 +01:00
Kubernetes Publisher
b72204b244 Merge pull request #95664 from DirectXMan12/bug/non-racy-recorder-shutdown
Don't spawn a goroutine for every event recording

Kubernetes-commit: 9d99dbc357ed85bcc963fc4bab8a4a3089c910b2
2021-01-21 07:15:29 +00:00
Xudong Liu
32850001d5 Add LoadBalancerClass field in service
KEP-1959: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/1959-service-lb-class-field

Kubernetes-commit: 72da0b1bb06607f3f3e067f1bb5ce329ec861e1b
2021-01-20 16:56:07 -08:00
Kubernetes Publisher
fc034b4b76 Merge pull request #96552 from pandaamanda/klog_fmt
use klog.Info and klog.Warning when had no format

Kubernetes-commit: 8bf42039e62d001f5d0331753bd99790b70d51eb
2021-01-16 05:01:05 +00:00
Kubernetes Publisher
537eda74d8 Merge pull request #98058 from jprzychodzen/le-comment
[Leader election] Add documentation to function

Kubernetes-commit: a16df75344c6036730e1fba42b25c64c704b1494
2021-01-14 13:04:07 +00:00
Kubernetes Publisher
25e8b5f54c Merge pull request #97083 from knight42/feat/enable-spdy-ping
feat: enable SPDY pings on connections

Kubernetes-commit: a3bf53a0a5031f69389a835a8e13e783090b35a7
2021-01-14 01:01:00 +00:00
Jakub Przychodzeń
eae461ddf8 [Leader election] Add documentation to function
Kubernetes-commit: 852075b23c1854d538582e3940dff36947de2907
2021-01-13 17:34:07 +01:00
Jian Zeng
479dd01de2 feat: enable SPDY pings on connections
Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>

Kubernetes-commit: d0dce7035832f0673d87ae44503560204f3d3d46
2020-12-05 22:31:52 +08:00
Kubernetes Publisher
623741e9c1 Merge pull request #97909 from adamzhoul/fix-chan-bug
fix unit test "TestSPDYExecutorStream" flaking problem

Kubernetes-commit: 9caf675ed1a055ebce18cf34e8284028a729fd00
2021-01-12 05:01:01 +00:00
Kubernetes Publisher
2192138125 Merge pull request #97095 from sabbox/fix-panic-azure-oidc-auth-plugins
fix: Azure/OIDC auth panics when no AuthProviderConfigPersister is nil

Kubernetes-commit: 31e89372716a1414495594ce1a65368e4124db26
2021-01-12 05:00:59 +00:00
Andrey Viktorov
b804f9f657 add noop persister to plugin loader
Kubernetes-commit: 2dd86fe8c2cc7b655085b773bd1a06bc2ab54bbd
2021-01-12 00:08:42 +02:00
Kubernetes Publisher
f80da32721 Merge pull request #97255 from chotiwat/patch-1
Fix stale object causing a panic on DELETE event

Kubernetes-commit: d2575b7ddb374d8ce915fe095fa5b7a5b3df138e
2021-01-11 21:01:20 +00:00
Kubernetes Publisher
224c1c6ff4 Merge pull request #97857 from liggitt/exec-auth-reuse-dialer
Track opened connections with a single tracker per authenticator

Kubernetes-commit: e9dba7a627520f89778b367fc0d955776f220638
2021-01-11 17:01:11 +00:00
adamzhoul
5c32e970ce fix replyChan block
Kubernetes-commit: 314a9c4a6215b7e57944c86acacc5c75ab55121f
2021-01-11 08:36:27 +00:00
Jordan Liggitt
0c5bab64fe Track opened connections with a single tracker per authenticator
Kubernetes-commit: ecbff22ca134bd802127aab2be165d2770a9262a
2021-01-08 12:13:19 -05:00
Chotiwat Chawannakul
a35bc8fe7a Fix stale object causing a panic on DELETE event
Kubernetes-commit: 1f4f78ac414b7a1666e908670c5e447015bdc6b9
2021-01-06 10:38:31 -08:00
Kubernetes Publisher
9761a13537 Merge pull request #96906 from Rajalakshmi-Girish/issue-96853
Fixes the unit tests to be more tolerant with error messages

Kubernetes-commit: 10c1c3acf65cfb00de7fa28f784865bd42ab4872
2021-01-06 05:04:32 +00:00
Kubernetes Prow Robot
0d3f257a17 Merge pull request #907 from munnerz/patch-1
README: add 1.20 in compatibility matrix
2021-01-05 02:33:59 -08:00
Kubernetes Publisher
e9d996dae2 Merge pull request #97326 from victor-timofei/deltafifo-doc
Update DeltaFIFO documentation and group Delta definitions to the top of the file

Kubernetes-commit: 9406e145c25e4c3041ec82529176957f164fdb08
2020-12-29 09:00:12 +00:00
Victor Timofei
53a09c71a4 Update the wording of the DeltaFIFO
Kubernetes-commit: 3a107951f0bf16a022b70a667c98833e4ac1d540
2020-12-24 16:33:04 +02:00
Kubernetes Publisher
0964d4be75 Merge pull request #97033 from patrickshan/pshan/bump/Azure/go-autorest/autorest
Bump github.com/Azure/go-autorest/autorest to v0.11.12

Kubernetes-commit: e11e9d4c6c3f522ed398748a11cc5dd1f8949c2b
2020-12-17 08:59:40 +00:00
Kubernetes Publisher
2b31242e93 Merge pull request #94813 from dramich/nometrics
Don't start goroutine for noMetrics

Kubernetes-commit: c4aca30005dacca3f768e511f3e424893161558d
2020-12-17 01:02:20 +00:00
James Munnelly
efbc7082a8 README: add 1.20 in compatibility matrix 2020-12-16 15:26:15 +00:00
Kubernetes Publisher
cc9d424da8 Merge pull request #96883 from pacoxu/fix/96862
fix index test: multi index check for empty list

Kubernetes-commit: 46d481b4556e3328758eeb851920e2536a488658
2020-12-16 04:59:30 +00:00
Victor Timofei
710a222444 Move Delta definitions to the top
Kubernetes-commit: bcc1c9a387c898478ed47c629864418be89bf518
2020-12-15 22:07:33 +02:00
Victor Timofei
09cf7147ab Update DeltaFIFO Documentation
Kubernetes-commit: 1a4ed5ea57ac4d562311d2b2852dcc59b78725da
2020-12-15 21:31:30 +02:00
Kubernetes Publisher
77dfe4dff7 Merge pull request #92138 from ash2k/ash2k/client-cleanups
Client library cleanups

Kubernetes-commit: 667deec758fbbd9576df1c5f081a4e239996b074
2020-12-10 21:00:11 +00:00
Kubernetes Publisher
62f63bbbfe Merge pull request #96837 from adamzhoul/master
fix  remotecommand stream blocked forever problems.

Kubernetes-commit: ccd29ea264535fa2ef36cf4dfb004fed99c99fbf
2020-12-10 05:00:18 +00:00
Patrick Shan
01fbb1db89 Bump github.com/Azure/go-autorest/autorest to v0.11.12
Kubernetes-commit: c75d9906587a8b174338e0ffe725759f68c0be56
2020-12-03 15:38:17 +11:00
Maciej Szulik
61675820ec Generated changes
Kubernetes-commit: 7d9f36cd850cfc080d8598ff4eac7b6fa3efc27d
2020-12-01 16:34:55 +01:00
Maciej Szulik
d6cefbd7a0 Drop batch/v2alpha1 API
Kubernetes-commit: 3dab7462d1ff6e20f7efe38249dd9958e4e32c89
2020-12-01 16:33:47 +01:00
Rajalakshmi-Girish
cb8d3d1111 fixes the unit tests to be more tolerant with error messages
Kubernetes-commit: 98948ad8092b41ebc08d50aa557b2d7ba5496e7d
2020-11-27 08:21:56 +00:00
pacoxu
8031d76bd6 fix index test: multi index check for empty list
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: ae6360f6c732d554c332a0bc1b99808149d8376e
2020-11-26 18:23:57 +08:00
adamzhoul
04adad44d6 fix spdy stream, conn deadlock.
Kubernetes-commit: 94a297485bf39a6d69f316c257d351e9432b8cb5
2020-11-15 17:06:34 +08:00
Kubernetes Publisher
e24efdc77f Merge pull request #96797 from jqmichael/initialCountLength
Fixed a bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()

Kubernetes-commit: 7d8587c4cc3529dc9065c1536071ea382e6c725c
2020-12-09 05:00:23 +00:00
Kubernetes Publisher
50c086135a Merge pull request #96643 from bboreham/lose-timestamp
Remove unused argument from generateEvent

Kubernetes-commit: e3bf0cc4ae836dd27bb01a5e426cb50721f63211
2020-12-09 05:00:20 +00:00
Qing Ju
1d175299a2 Fixed a harmless bug where initialPopulationCount should be based on the key length not list size in DeltaFIFO#Replace()
Kubernetes-commit: bc39672c0638426979feef95baeff39d170161eb
2020-11-22 16:35:19 -08:00
Kubernetes Publisher
fb61a7c88c Merge pull request #96720 from liggitt/throttled-logger
Deflake ThrottledLogger test

Kubernetes-commit: 2ea6828ea0803e188a6a7c4a6581f522865ae8f3
2020-11-21 00:58:59 +00:00
Jordan Liggitt
61471be615 Deflake ThrottledLogger test
Kubernetes-commit: c84df5d66ea8d949374b67c5205b9869b984ea84
2020-11-19 13:59:27 -05:00
Kubernetes Publisher
66db254099 Merge pull request #95981 from caesarxuchao/http2-healthcheck
Enables HTTP/2 health check

Kubernetes-commit: afeac926fa79179bfd0c5e718459086845a2a80c
2020-11-18 00:58:04 +00:00
Kubernetes Publisher
7c9ea22f76 Merge pull request #92743 from liggitt/gc
Fix GC uid races and handling of conflicting ownerReferences

Kubernetes-commit: e1ab99e0d662f3d9bf89ccf48f71444dbabce37e
2020-11-17 12:14:06 -08:00
Bryan Boreham
5d2c89de53 Remove unused argument from generateEvent
Kubernetes-commit: beceee68156dff8b10123a37bb4645941b7df0c2
2020-11-17 16:51:10 +00:00
xiongzhongliang
d7ba1f2e01 use klog.Info and klog.Warning when had no format
Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
2020-11-14 00:55:06 +08:00
Chao Xu
8dde295de4 Add a unit test testing the HTTP/2 health check help the REST client
detects broken TCP connections.

Kubernetes-commit: ba7b1f7a89ffed78115ab0229b7504d05f6c7d48
2020-10-29 23:03:14 -07:00
Haowei Cai
7dddf976b8 fix the fake client example: how to handle a race between the fake client and informer
Note that the fake client isn't designed to work with informer. It
doesn't support resource version. It's encouraged to use a real client
in an integration/E2E test if you need to test complex behavior with
informer/controllers.

Kubernetes-commit: 942bc9b32e39bb9c6ca045c02b48cc84dfa86633
2020-10-26 22:50:32 -07:00
Solly Ross
726d27fe7a Don't record events in goroutines
This changes the event recorder to use the equivalent of a select
statement instead of a goroutine to record events.

Previously, we used a goroutine to make event recording non-blocking.
Unfortunately, this writes to a channel, and during shutdown we then
race to write to a closed channel, panicing (caught by the error
handler, but still) and making the race detector unhappy.

Instead, we now use the select statement to make event emitting
non-blocking, and if we'd block, we just drop the event.  We already
drop events if a particular sink is overloaded, so this just moves the
incoming event queue to match that behavior (and makes the incoming
event queue much longer).

This means that, if the user uses `Eventf` and friends correctly (i.e.
ensure they've returned by the time we call `Shutdown`), it's
now safe to call Shutdown.  This matches the conventional go guidance on
channels: the writer should call close.

Kubernetes-commit: e90e67bd002e70a525d3ee9045b213a5d826074d
2020-10-16 15:05:00 -07:00
Taahir Ahmed
65b7d26246 Remove MPL-licensed dep from lruexpirecache
github.com/hashicorp/golang-lru is MPL 2 licensed, which means that
anyone who distributes code or binaries that incorporates it needs to
include its source code, even if they haven't made any modifications.

Since lrucacheexpire is picked up as a dependency of using the shared
informers in client-go, that's potentially a lot of distributors.
Most other deps of client-go are Apache 2.0, MIT, or BSD-like
licensed, which only requires including the license.

Rather than reverting to groupcache/lru, I just reimplemented the
functionality we need, which isn't much.

Kubernetes-commit: ecc53182475a00a4a1dc8ca1e056b0deb6bd430c
2020-10-10 20:29:26 -07:00
Jordan Liggitt
c476b49dcf Add GC unit tests
Adds unit tests covering the problematic scenarios identified
around conflicting data in child owner references

                      Before   After
package level         51%      68%
garbagecollector.go   60%      75%
graph_builder.go      50%      81%
graph.go              50%      68%

Added/improved coverage of key functions that had lacking unit test coverage:

* attemptToDeleteWorker
* attemptToDeleteItem
* processGraphChanges (added coverage of all added code)

Kubernetes-commit: e491c3bc7056530d82590d95f0af0e8c4d8dded5
2020-10-09 17:50:52 -04:00
Kubernetes Publisher
77eda6a939 Merge pull request #96317 from Jefftree/test-ssa
Integrate defaults marker to defaulter-gen

Kubernetes-commit: 05d1b94a701d807666b40665f5728e0cc5f92054
2020-11-14 08:57:41 +00:00
Kubernetes Publisher
76f48268c7 Merge pull request #96527 from adtac/apfbeta
promote API priority and fairness types and APIs to beta

Kubernetes-commit: 36f571404fcb136011024b89efaa2a0d089acd5f
2020-11-14 04:57:47 +00:00
Kubernetes Publisher
4ab8fb4585 Merge pull request #96425 from bobbypage/vendor-cadvisor-v0.38
Vendor cadvisor v0.38.4

Kubernetes-commit: 41533ecec8966636554faba44368a36d5d6c5347
2020-11-14 00:58:07 +00:00
David Porter
4bbb204f15 vendor: cadvisor v0.38.4
Kubernetes-commit: 8af7405f1730c4913c48c6dc494e319cb3015f69
2020-11-13 19:52:57 +00:00
Kubernetes Publisher
d396fd99eb Merge pull request #96549 from caesarxuchao/net-sys-dep-update
update golang.org/x/net and golang.org/x/sys

Kubernetes-commit: 85cd7c530bf55cd369bdcb92a5a31d3d1547113f
2020-11-13 17:06:34 +00:00
Kubernetes Publisher
759e1a8119 Merge pull request #95614 from wilsonehusin/golint-client-go-transport
Fix golint failures in client-go/transport

Kubernetes-commit: 3b2746c9ea9e0fa247b01dca27634e509b385eda
2020-11-13 17:06:31 +00:00
Chao Xu
26433c83c0 update golang.org/x/net and golang.org/x/sys
Kubernetes-commit: 7b26cff1740ecfb8e6ac184539d1cb5dd66991c2
2020-11-13 05:15:22 +00:00
Kubernetes Publisher
30548acd0a Merge pull request #96001 from serathius/datapolicy-client-go
Add datapolicy tags to staging/src/k8s.io/client-go/

Kubernetes-commit: f4a156eb29d51b73f52d69ab4c5f96e440eebc41
2020-11-12 20:25:28 +00:00
Antoine Pelisse
96c6b1c8c8 Update kube-openapi
Kubernetes-commit: 8cce122e7b6506b361032869f7115635f13ca96a
2020-11-10 15:09:03 -08:00
yue9944882
8ff8f8a3c2 APF: graduate API and types to beta
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>

Kubernetes-commit: 849be447f563fc93a27a0827fb1185b885b57114
2020-11-04 16:33:14 +08:00
Marek Siarkowicz
e93788d387 Add datapolicy tags to staging/src/k8s.io/client-go/
Kubernetes-commit: e29c568c4a9cd45d15665345aa015e21bcff52dd
2020-10-29 18:15:52 +01:00
Kubernetes Publisher
04f89d4efe Merge pull request #95718 from SergeyKanzhelev/runtimeClass2
RuntimeClass GA

Kubernetes-commit: 12d9183da03d86c65f9f17e3e28be3c7c18ed22a
2020-11-12 12:25:17 +00:00
Sergey Kanzhelev
381d44651b GA of RuntimeClass feature gate and API
Kubernetes-commit: 06da0e5e74a99d5c6c2f4e120b2cd0c2c6f3caf4
2020-11-11 19:22:32 +00:00
Kubernetes Publisher
bef66adadf Merge pull request #95954 from sttts/sttts-go-openapi
apiextensions: replace go-openapi with kube-openapi fork for validation

Kubernetes-commit: 0cba30d891cb77e813d7f19dcc5ae422076fcfe3
2020-11-09 16:25:15 +00:00
Dr. Stefan Schimanski
be00baa5eb bump(k8s.io/kube-openapi)
Kubernetes-commit: dd1709ba46580af290712b0eca12acd00a78789d
2020-11-06 10:59:34 +01:00
Kubernetes Publisher
a2cda5636d Merge pull request #96279 from cmluciano/cml/netutilsipv4
dualstack: cleanup IsIPv4 duplicates in favor of k8s/utils functions

Kubernetes-commit: 151c2799d1d76ae6a9847b89bdf912604477c2d5
2020-11-07 12:24:55 +00:00
Kubernetes Publisher
9950c71bb5 Merge pull request #74363 from aanm/fix-client-go-metrics
client-go/rest: fix finalURLTemplate for url base == "/"

Kubernetes-commit: 80c2f61939fb01720e6d96021cc3cd8c909bf34d
2020-11-06 00:29:52 +00:00
Christopher M. Luciano
1a0a999839 dualstack: incorporate IsIPv4 updates from utils repo
This dependency bump will allow for cleanup of duplicate code in
the dualstack e2e tests.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 5303b3fbbd52f5092bdcbd3765347eb218485ca5
2020-11-05 14:25:23 -05:00
Kubernetes Publisher
1eb2027cd5 Merge pull request #96020 from deads2k/dynamiclist
update fake dynamic client to return GVK

Kubernetes-commit: dbd2be08fb0515599aadb897e0c1476abc8b2552
2020-11-05 04:24:28 +00:00
Kubernetes Publisher
bcecfeab18 Merge pull request #93293 from soltysh/loading_precedence
kubeconfig: add explicit path, if specified to loading precedence

Kubernetes-commit: 583d01a9bfc0c403bc8e1043f7046f1c8b5d7881
2020-11-05 00:24:32 +00:00
Kubernetes Publisher
68bb4a9525 Merge pull request #96154 from rf232/update_klog
Update Klog dependency

Kubernetes-commit: 3f6ec26eefcae1cdb4a43aa4e664a5f60fc7ca78
2020-11-04 16:24:36 +00:00
Rob Franken
01777546cc Update Klog dependency
Updating Klog to pickup changes needed for log sanitization.

(https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/1753-logs-sanitization)

Kubernetes-commit: c6685436fdae6fbb8ac7083b85ecfd47b5871e68
2020-11-03 20:16:25 +01:00
Kubernetes Publisher
534b10dd04 Merge pull request #95933 from brianpursley/kubernetes-95882
Fix bug in JSON path parser where an error occurs when a range is empty

Kubernetes-commit: cd99c63570eb1489dd631c12ea86db708dbdcd59
2020-11-03 12:24:46 +00:00
Kubernetes Publisher
4ef01cd5e2 Merge pull request #96108 from liggitt/revert-sys
Revert "Updated golang/x/net. Also updated golang.org/x/sys"

Kubernetes-commit: 770525fd3d47a1ef86aab886b62b73b3557457d5
2020-11-02 20:24:40 +00:00
Jordan Liggitt
3b0c685ad9 Revert "Updated golang/x/net. Also updated golang.org/x/sys"
Kubernetes-commit: 4012fb005205a2f6dbd2534d600c4f784b5c0210
2020-11-02 08:28:24 -05:00
Kubernetes Publisher
852de461ed Merge pull request #96076 from caesarxuchao/update-deps
Updates golang/x/net and golang/x/sys

Kubernetes-commit: a0d23de0861d5a2fc446c417bf0c53fa1f51706e
2020-11-01 20:23:56 +00:00
brianpursley
135cef183c Fix bug in JSON path parser where an error occurs when a range is empty
Kubernetes-commit: 10634c6093c84acc78181a26c93d8785e12802e4
2020-11-01 10:41:19 -05:00
Chao Xu
285943f1c0 Updated golang/x/net. Also updated golang.org/x/sys, as required by
hack/lint-dependencies.sh.

Kubernetes-commit: ec6e2321261b900089183ac61f1ac0040be5fa9c
2020-10-31 16:21:08 -07:00
Kubernetes Publisher
0c53f2fd3c Merge pull request #95489 from ankeesler/ankeesler/enj/f/exec_plugin_cluster
exec credential provider: wire in cluster info (superset of #91192)

Kubernetes-commit: 53913a7c676c4bd21d6d3a58e6d6305729abaa9b
2020-10-30 04:24:07 +00:00
Andrew Keesler
078729a26c exec credential provider: exec -> client.authentication.k8s.io/exec
Hopefully we've fixed all of these references now...

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 409f22832a9f949e7fa534379574ce4fb9802394
2020-10-29 17:02:55 -04:00
David Eads
20c034c178 add GVK to fake dynamic client to match actual behavior
Kubernetes-commit: f4383458432cd67714e9ce0acde56a2ed5c24a21
2020-10-29 15:53:34 -04:00
David Eads
75ef13ec60 demonstrate existing generated client and fake client behavior is consistent
Kubernetes-commit: eaac8b80cabdccd0cbb35ef2d33a4f6628263c01
2020-10-29 15:12:38 -04:00
Andrew Keesler
405010f17b exec credential provider: k8s.io/client-go/tools/auth/exec helper
Exec plugin implementations should be able to call
LoadExecCredentialFromEnv() in order to get everything they need to
operate (i.e., cluster information (as long as it is passed in) and
optionally per-cluster configuration).

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 875a46bd7c1b79f1fae9cd189eec5fc9c3fbf1bc
2020-10-29 13:38:50 -04:00
Andrew Keesler
a7ba87c612 exec credential provider: ProvideClusterInfo and kubeconfig shadow
- The main idea here is that we want to 1) prevent potentially large CA
  bundles from being set in an exec plugin's environment and 2) ensure
  that the exec plugin is getting everything it needs in order to talk to
  a cluster.
- Avoid breaking existing manual declarations of rest.Config instances by
  moving exec Cluster to kubeconfig internal type.
- Use client.authentication.k8s.io/exec to qualify exec cluster extension.
- Deep copy the exec Cluster.Config when we copy a rest.Config.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: c4299d15d5289768808034676858e76a177eeae5
2020-10-29 13:38:42 -04:00
Kubernetes Publisher
e84213f91f Merge pull request #95939 from dprotaso/leaderelection-release
Address scenario where releasing a resource lock fails if a prior update fails or gets cancelled

Kubernetes-commit: 8bc8b11bcf5d970d678e28679c1699e2383610b8
2020-10-29 00:23:46 +00:00
Kubernetes Publisher
d58491a0a7 Merge pull request #95923 from deads2k/remove-deprecated
remove the deprecated client that we stopped generating

Kubernetes-commit: ec0ef235990a1ceda22d78d96c129677e5aa097c
2020-10-28 20:24:06 +00:00
Kubernetes Publisher
3ced13b9a4 Merge pull request #95117 from andrewsykim/fake-dynamic-list
fake dynamic client: document that List does not preserve TypeMeta in UnstructuredList

Kubernetes-commit: c5ecae737d2eb668adab12cefa3644f550fc9e8a
2020-10-28 04:23:41 +00:00
Andrew Sy Kim
1db2969ba9 fake dynamic client: support *List kinds
Today the dynamic fake client is not aware of *List kinds, so List calls return UnstructuredList
objects without TypeMeta. This patch updates client-go's fake object tracker to store a map of
GVR to list GVKs. In this way, the list GVK can be set for UnstructuredList objects.

Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>

Kubernetes-commit: 0845b863e89912e0d6c4380f8bc362646326386a
2020-10-27 23:08:46 -04:00
Dave Protasowski
3da398aea9 Re-add the event recorder in the release test
Prior having a mock recorder would cause panics since the lock
would be set to nil on update failures. Now the recorder will
use the cached lock

Kubernetes-commit: 5e7ed7b86d26b651f1ef78a794cdc03fa945a3ce
2020-10-27 22:45:33 -04:00
Dave Protasowski
bfd1732c49 Don't clear the cached resourcelock when errors occurs on updates
This allows the lock to be release normally - even with a
potentially stale lock. This flow should only occur when we're
the lease holders.

Kubernetes-commit: 8160ecfd90284c333101a16bdccd79aacc86360d
2020-10-27 22:41:39 -04:00
Dave Protasowski
a0a4a352aa Add failing test showing release is not working properly
Kubernetes-commit: 23ce312b9f764736d8ac7cb6f8ebf6825d43f817
2020-10-27 22:29:22 -04:00
David Eads
f3da8d0730 remove the deprecated client that we stopped generating
Kubernetes-commit: 1f349b5d05b1e3deca196ddf6c4114b707c8eb08
2020-10-27 14:00:56 -04:00
Wilson Husin
d6281e9d1e Fix golint failures in client-go/transport
Signed-off-by: Wilson Husin <whusin@vmware.com>

Kubernetes-commit: 889ffb04d03e49cdbb481b86ea233d0aa3143db6
2020-10-15 11:06:24 -07:00
wojtekt
b100ecfc06 Create TransformingInformer
TransformingInfomer is like a regular Informer, but allows for applying
custom transform functions on the objects received via list/watch API calls.

Kubernetes-commit: efd3490076c391823095b4c8bd6e847ae18eb012
2020-09-29 15:06:33 +02:00
Andrew Sy Kim
f45d9426eb fake dynamic client: document that List does not preserve TypeMeta in UnstructuredList
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>

Kubernetes-commit: deb1bb8bfff012e03ccc80fd85ee4fc2f9fceb6d
2020-09-28 09:29:06 -04:00
Kubernetes Publisher
b8dd4e3c0f Merge pull request #80954 from zachomedia/fix-lock-release
Fix leader election lock release when using LeaseLocks

Kubernetes-commit: 68f6b09e807917d73446e6ee6146b4029d1aae79
2020-10-27 04:23:32 +00:00
Kubernetes Publisher
d1a4fe5f2d Merge pull request #95692 from markusthoemmes/bump-azure-adal
Bump github.com/Azure/go-autorest/autorest/adal to 0.9.5

Kubernetes-commit: af1c8935d9f1f42767c6f5211a668e44a15946b4
2020-10-20 20:08:34 +00:00
Kubernetes Publisher
a789af5306 Merge pull request #95646 from jprzychodzen/leader-election-1
Add a new way to generate leader election lock

Kubernetes-commit: d5ea0edc0967697c1adf6e70831e5cb1a38d26a2
2020-10-20 09:02:09 -07:00
Markus Thömmes
f3ff478f5a Fix dependency linting
Kubernetes-commit: 34b9d115051a987442dfaf3bd12002c0843f8297
2020-10-19 11:33:30 +02:00
Markus Thömmes
605bdceafe Bump github.com/Azure/go-autorest/autorest/adal to 0.9.5
Kubernetes-commit: e1fd0bd0ebdfee973403a8eeb71a9ec0fc8a23de
2020-10-19 09:46:46 +02:00
Jakub Przychodzeń
5b14150b09 Add new way to generate leader election lock
Kubernetes-commit: 24033c908d8363ea6628b1d1c0b2a48c96a338da
2020-10-16 11:28:42 +02:00
Kubernetes Publisher
67b0d2026a Merge pull request #95427 from roycaihw/fix/tls-transport-cache
TLS transport cache: don't cache transports for incomparable configs

Kubernetes-commit: 36a6a6493621d3b0796478bc6c08b80b82282601
2020-10-20 10:20:08 +00:00
Kubernetes Publisher
27421eae1f Merge pull request #95230 from Git-Jiro/fix_vendor_client_go
Fix staticchecks in vendor/k8s.io/client-go

Kubernetes-commit: 297b021f49e30a7cadb691a252f2bb13114423b9
2020-10-20 10:20:07 +00:00
Haowei Cai
a3299cf8e9 don't cache transports for incomparable configs
Co-authored-by: Jordan Liggitt <liggitt@google.com>

Kubernetes-commit: 0765ba8e54f0c9e5f221e505a24759fa18beaf2e
2020-10-07 15:44:27 -07:00
Kubernetes Publisher
5682372f35 Merge pull request #95316 from sfowl/mask-token-in-toCurl
Mask bearer token in logs when logLevel >= 9

Kubernetes-commit: e99df0e5a75eb6e86123b56d53e9b7ca0fd00419
2020-10-07 12:01:36 +00:00
Kubernetes Publisher
1c5be7dd50 Merge pull request #92201 from cici37/features
Remove dependency pkg/features from CCM

Kubernetes-commit: a1441b2d52202c2fb9d4a8d0ffb02eb3f80383b4
2020-10-07 00:01:18 +00:00
Sam Fowler
e8f871a2e5 Mask bearer token in logs when logLevel >= 9
Kubernetes-commit: f0f52255412cbc6834bd225a59608ebb4a0d399b
2020-10-06 11:10:38 +10:00
Martin Schimandl
3450a048bc Fix staticchecks in vendor/k8s.io/client-go
Kubernetes-commit: 13c017056c924e148113e42786a511ed2fee7594
2020-10-01 12:40:32 +02:00
Dan Ramich
f39ca994bd Don't start goroutine for noMetrics
Problem:
When calling newQueue metrics can be of type noMetrics when just calling
New. When doing this a new goroutine is created to update the metrics
but in this case there are no metrics so it's just creating goroutines
that don't do anything but consume resources.

Solution:
If the incoming metrics is of type noMetrics, don't start the goroutine

Kubernetes-commit: de021396f81ff438899297a6f464c70113b58475
2020-09-15 16:21:48 -06:00
Dean Coakley
53da6da2bc Remove outdated comment on wait.Until
Kubernetes-commit: 53fef4a04598c3b1ee04c4930a29dbad5bb9ca63
2020-08-20 02:08:17 +01:00
Zhou Peng
a53ab6bcda [k8s.io/client-go/discovery/discovery_client]: CustomResourceDefinition
ThirdPartyResource has been superseded by CustomResourceDefinition

Signed-off-by: Zhou Peng <p@ctriple.cn>

Kubernetes-commit: b608a203c62f693bb1ee1c91de5969a75129db30
2020-07-24 15:22:00 +08:00
Maciej Szulik
87661a7415 kubeconfig: add explicit path, if specified to loading precedence
Kubernetes-commit: 7c8e4c83fbe66548aeb446562c29c42efe1d4386
2020-07-21 15:45:36 +02:00
cici37
c06103ad31 Move cloud related feature gates to controller-manager
Kubernetes-commit: 33e23c4005465d959a8c2d5e5f4e03e057184b3a
2020-06-16 13:48:13 -07:00
Kubernetes Publisher
becbabb360 Merge pull request #95098 from phunziker/92402-memcache_test
Fix vendor/k8s.io/client-go/discovery/cached/memory staticcheck

Kubernetes-commit: 267ba6781e29a96cc7def134c7d0fa4fc46f2d23
2020-10-04 20:02:34 +00:00
Kubernetes Publisher
758467711e Merge pull request #93901 from jpbetz/atomic-structs
Treat LabelSelectors as atomic by Server Side Apply to fix #92913

Kubernetes-commit: 90c9f7b3e198e82a756a68ffeac978a00d606e55
2020-10-04 00:01:08 +00:00
Joe Betz
ec2ace78dc Bump to latest kube-openapi and SMD to pick up structType=atomic support
Kubernetes-commit: f298d549f60c9342abcff1ad17d8455cd62b19fb
2020-09-30 11:49:13 -07:00
Patrick Hunziker
0588bc827b Fix staticcheck failure for vendor/k8s.io/client-go/discovery/cached/memory
Kubernetes-commit: b08e36eeb9c18991fab5a98d456eae76f4f570b5
2020-09-27 18:31:46 +02:00
Kubernetes Publisher
a0a9b7d9d5 Merge pull request #94364 from wojtek-t/efficient_watch_resumption
Efficient watch resumption

Kubernetes-commit: 0f39af90ed39794ceea426aa0f77de67b1392308
2020-09-26 00:00:26 +00:00
Kubernetes Publisher
206f761e8e Merge pull request #93951 from eddiezane/ez/update-client-go-out-of-cluster-example
client-go: update out of cluster example with HomeDir func

Kubernetes-commit: 9d3a8a0b9698b3c7c32b0fd75138dbe0f712fa0d
2020-09-25 04:00:16 +00:00
Kubernetes Publisher
f8c0b224ad Merge pull request #94947 from phillc/master
Replace 'the the ' with 'the '

Kubernetes-commit: 63d4a032707d4e19719a58707540858f86d02f6f
2020-09-24 04:00:14 +00:00
phillc
8ea16c1919 find . -type f \( -name "*.go" -or -name "*.md" \) -print0 | xargs -0 gsed -i 's/the the /the /g'
Kubernetes-commit: adbc7c2172ea622db7399f41e893063b00ca1a87
2020-09-21 16:37:12 -04:00
Kubernetes Publisher
cba7285b7f Merge pull request #93214 from trashhalo/prefer-error
test: prefer NoError/Error over Nil/NotNil

Kubernetes-commit: 09b3f6dbb3224f32d28c81f330f303ac16ee2eae
2020-09-17 00:02:35 +00:00
Kubernetes Publisher
a32e6027fa Merge pull request #94090 from deads2k/podpreset
remove pod presets

Kubernetes-commit: 54df1fdc9083ecc459ba60f395d755a90a2cd0b8
2020-09-15 08:57:50 +00:00
wojtekt
866e6a7e3c Allow tracking resource version for reflector store
Kubernetes-commit: 4af1328bb8a3b3eb2289bbbe624480548dd39cdc
2020-08-31 15:58:16 +02:00
David Eads
78470a58b0 clean up podpreset deprecated client
Kubernetes-commit: 82ed033ec9e05dfb33621ccd6244bc1f68f777e5
2020-08-19 08:35:52 -04:00
David Eads
e65579977d generated
Kubernetes-commit: c0c033b12ff25b86fa36ccadbed61cbd166c4b6b
2020-08-18 16:59:59 -04:00
David Eads
26b3743737 remove generated podpreset
Kubernetes-commit: 4172068d93c21001b8f194b5c1e11dfb492ff8bb
2020-08-18 16:36:19 -04:00
David Eads
890d74c7cb remove pod presets
Kubernetes-commit: c7911a384cbc11a4b5003da081b181d6b814d07e
2020-08-18 16:31:46 -04:00
Kubernetes Publisher
909a5a3935 Merge pull request #94594 from knight42/fix/TestGetListener
test(portforward): deflake TestGetListener

Kubernetes-commit: 0e58014d71ba92a055e41541b3b7b7373cc0343e
2020-09-09 13:19:11 +00:00
knight42
9ff85ef8ef test(portforward): deflake TestGetListener
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: bb68741fcbe82a7b17e05e82f7a71bd0c4815e02
2020-09-09 15:40:56 +08:00
Kubernetes Publisher
f0b431a6e0 Merge pull request #94605 from yttan/lint
fix golint failures for staging/src/k8s.io/client-go/examples/workqueue

Kubernetes-commit: 1c6057b59ca7a1eee66086b86c75315cf26db081
2020-09-09 05:18:54 +00:00
Kubernetes Publisher
42c4a6e381 Merge pull request #93087 from roycaihw/storage-version/move-types
Move the StorageVersions types to kube-apiserver

Kubernetes-commit: 5e95af8c7d9dbcb298bda2e713ba20a103401fe1
2020-09-09 01:19:13 +00:00
yttan
3f4798d9ac fix golint failures for staging/src/k8s.io/client-go/examples/workqueue
Kubernetes-commit: d3db1ec12d1156fbdefacb15b5c5c6d31523a163
2020-09-08 15:01:45 +08:00
Eddie Zaneski
a6ca2f510c Update client-go out of cluster example
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 522cba454b69c80d8a336026d6bc92a93955cbe1
2020-08-12 17:55:26 -06:00
Haowei Cai
f20af936fc generated
Kubernetes-commit: 769f057004f664ece06e5db5e77292534e4e86c4
2020-07-21 10:47:25 -07:00
Kubernetes Publisher
529dda0cb8 Merge pull request #94570 from knight42/fix/TestEventSeriesf
test(tools::events): deflake TestEventSeriesf

Kubernetes-commit: 86cbfc3ca271cde93ebf5aabbe088e2b0641b50b
2020-09-07 17:18:43 +00:00
Kubernetes Publisher
23fa3f5256 Merge pull request #94363 from mborsz/patch-13
Add WatchListPageSize to cache.Config

Kubernetes-commit: c06bc2f6e9fe0aefea2f5b8804cdb68c7c52dfc8
2020-09-07 09:19:04 +00:00
knight42
da11764900 test(tools::events): deflake TestEventSeriesf
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: d9bff7b27618bd31330187add92594a8a520e8d4
2020-09-06 16:31:15 +08:00
Kubernetes Publisher
0d9e08cf3a Merge pull request #94556 from knight42/fix/TestMetrics
test(workqueue): deflake TestMetrics

Kubernetes-commit: ec8a54b5ea3b91bbb98c6cc4407b210b220399d6
2020-09-05 21:19:05 +00:00
Kubernetes Publisher
ebfbb6a14e Merge pull request #94554 from knight42/fix/TestRetryWatcherToFinishWithUnreadEvents
test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents

Kubernetes-commit: 74053d555d71a14e3853b97e204d7d6415521375
2020-09-05 10:15:40 -07:00
knight42
f2963a02f6 test(workqueue): deflake TestMetrics
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: b70e1d836c2d438af6b01fd297677b900b364a33
2020-09-05 18:50:45 +08:00
knight42
a922620591 test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: 1d92314f262548b6b24e309943274e0d9d196a41
2020-09-05 17:19:47 +08:00
Kubernetes Publisher
62c82f5540 Merge pull request #94483 from derekwaynecarr/improve-debugging-event-flake
Improve ability to debug Events e2e failure

Kubernetes-commit: 62321af7ab1c8abb44f5d99e7af560b22bd0a7c6
2020-09-04 13:19:07 +00:00
Derek Carr
475bc66604 Improve ability to debug Events e2e failure
Kubernetes-commit: 4502fa3cfcd6025ba434f8626102e56d09d95b7e
2020-09-03 15:01:33 -04:00
Kubernetes Publisher
7cd71358d5 Merge pull request #93919 from azush26/modify-format
Modify the warning message format from "%d" to "%v" in shared_informer.go.

Kubernetes-commit: d1590e70e885ea93463cf27d78b46e15cef7c5ad
2020-09-03 17:18:57 +00:00
Kubernetes Publisher
ba26c4506d Merge pull request #94235 from kevindelgado/draft/connection-refused-backoff
Add exponential backoff for connection refused errors

Kubernetes-commit: e688a0692c5a1bd891ed761ef2af2092731eede0
2020-09-03 01:18:33 +00:00
Maciej Borsz
a52faa7892 Add WatchListPageSize to cache.Config
Currently there is no way to specify WatchListPageSize used by Controller. This PR adds a field that can be used to specify this.

Change-Id: I241454a45dd94d3ea65a91b297f530e217f843aa

Kubernetes-commit: 43f5afe1a1dd058a2564cd3b2f330fc2a401f607
2020-08-31 12:52:45 +02:00
Kevin Delgado
4d01b584c3 Add exp backoff for connection refused errors
Currently when ListAndWatch() receives a connection refused error, it is
assumed to be due to the apiserver being transiently unresponsive. In
situations where a controller is running outside the k8s cluster it's
controlling, it is more common for the controller to lose connection
permanently to the apiserver and needs to exponentially backoff its
retry rather than continously spamming logs with Watch attempts that
will never succeed.

Kubernetes-commit: 1ff789f2bb9bf7fbb3df35977bc249c0dd019d31
2020-08-25 19:15:21 +00:00
Kubernetes Publisher
bb860d7b6e Merge pull request #94316 from janeczku/fix_reflector_stall_backwards_comp
Fix bug in reflector not detecting "Too large resource version" error

Kubernetes-commit: fd2c584b8f39dc72c48061d14380661df1680798
2020-09-02 13:23:34 +00:00
Kubernetes Publisher
b643ec487e Merge pull request #93499 from ZeroMagic/azure-autorest
chore: upgrade Azure/go-autorest/autorest to v0.11.1

Kubernetes-commit: e695b40db85cddd2ff87b35ec978b2c76b11dd4c
2020-09-02 13:23:32 +00:00
Kubernetes Publisher
aeb5f1a775 Merge pull request #93646 from gobomb/fix-panic-defer
let panics propagate up when processLoop in informer controller panic in client-go

Kubernetes-commit: 5a7970a42bddb415a5ef3b21f181abba0a5c37de
2020-09-02 05:18:30 +00:00
Kubernetes Publisher
57f65489c1 Merge pull request #94331 from liggitt/warning-docs
Improve docs for client-go warning handlers

Kubernetes-commit: 220c3f46258b2d1445bc57ef40dd92221eaa3a38
2020-08-30 17:18:15 +00:00
Jordan Liggitt
dbb8ed36f1 Improve docs for client-go warning handlers
Kubernetes-commit: b0573d526d5eb171e7e21edd642ffe5c258c37a7
2020-08-29 10:40:33 -04:00
janeczku
47f16e33aa Fixed reflector not recovering from "Too large resource version" errors with API servers 1.17.0-1.18.5
Kubernetes-commit: e1f4bfe1db8d3975bf626c2c8536dd8076aeb7d4
2020-08-28 21:17:27 +02:00
Kubernetes Publisher
e4aeb38be1 Merge pull request #93529 from latteczy/master
reduce the number of type conversions and correct variable name

Kubernetes-commit: 01ca6fb5c951df5154d1496c2f402c44a5809d33
2020-08-28 17:18:13 +00:00
Kubernetes Publisher
67e1ce8f65 Merge pull request #92987 from nikhita/cleanup-owners-apimachinery
apimachinery: remove inactive members from OWNERS

Kubernetes-commit: 0a1aa394b79f4647a3fe841b4ddee31a62596eb0
2020-08-28 05:18:15 +00:00
Kubernetes Publisher
91da5ef685 Merge pull request #91968 from MikeSpreitzer/fix91709
Remove contemplation of invariant violations from delta_fifo.go

Kubernetes-commit: 95fcb55b416f7f68ba1707cb9e6d11a3ed63f5c7
2020-08-28 01:18:06 +00:00
Kubernetes Publisher
c0a8e7c5dc Merge pull request #93735 from wking/fix-attempting-to-acquire-leader-lease-double-space
leaderelection: Remove doubled space in "attempting to acquire leader lease" log

Kubernetes-commit: 200283ab851772930b00944d3a360211f507c8ec
2020-08-28 01:18:04 +00:00
Kubernetes Publisher
b0d0d71889 Merge pull request #93809 from Howie66/chore-Correct-words
Chore correct words

Kubernetes-commit: 33a7ea7ca1bebdc4fa2e164ee7e700ff90030d0b
2020-08-27 21:18:27 +00:00
Kubernetes Publisher
5d33118d47 Merge pull request #93571 from ChrsMark/patch-1
Document blocking behaviour of RunOrDie and Run

Kubernetes-commit: 6b963ed9c841619d511d2830719b6100d6ab1431
2020-08-27 13:18:24 +00:00
Kubernetes Prow Robot
44d47f2411 Merge pull request #851 from nikhita/readme-release-19-update
README: add 1.19 in compatibility matrix
2020-08-27 02:29:01 -07:00
Nikhita Raghunath
58113e9136 README: add 1.19 in compatibility matrix 2020-08-24 18:37:21 +05:30
Kubernetes Publisher
20923fd71b Merge pull request #94147 from liggitt/json-patch
Update json-patch to v4.9.0 tagged release

Kubernetes-commit: ce3dd04c49067d0f7cb713d0b866b5b7eea04a18
2020-08-21 05:17:52 +00:00
Jordan Liggitt
89a1c66830 Update json-patch to v4.9.0 tagged release
Kubernetes-commit: 245064a3518c7a42fe830316da2fbfd2667db01d
2020-08-20 17:05:24 -04:00
Kubernetes Publisher
e7a1d9ada0 Merge pull request #93867 from apelisse/update-smd
Update SMD to v4.0.1 and kube-openapi

Kubernetes-commit: f4e9c3fd2745695308edd1fd725911fa564efe83
2020-08-13 01:20:17 +00:00
azush26
5f6a1b08cd modify the warning log format from %d to %v
Kubernetes-commit: ac1168e0e922ccd32b0fcc3d3aecac8920cedbda
2020-08-12 16:05:59 +09:00
Antoine Pelisse
778a95cf51 Update SMD to v4.0.1 and kube-openapi
Kubernetes-commit: f4c145511a0bb62ea7ee1f2154945c84c17ffcd5
2020-08-10 13:02:25 -07:00
Kubernetes Publisher
9bbcfbab83 Merge pull request #93810 from liggitt/json-patch-4.8.0
Update to json-patch 4.8.0

Kubernetes-commit: 9b78bd59796d3937986934582230174606403780
2020-08-08 21:17:39 +00:00
Jordan Liggitt
bc308599e4 Update to json-patch 4.8.0
Kubernetes-commit: cc6814f83ccad671c79570b44c84b280709b4c74
2020-08-08 09:53:56 -04:00
lihaowei
abfce0f8c3 Format Codes
Chore: Correct words and format codes

Revert three changes

Revert 1 change

Revert again

Revert 2 changes

Kubernetes-commit: af7cf4abc6bfeb0d2cfaca76097cf7a0603c4495
2020-08-08 13:27:28 +08:00
Kubernetes Publisher
11a3c5a78f Merge pull request #93797 from liggitt/unwrap-net-errors
[go1.15] Use errors.As to unwrap net errors

Kubernetes-commit: ce662e1621f6ca46de5ffba27d1bf0f4102e1cc1
2020-08-08 05:17:16 +00:00
Jordan Liggitt
e3251a06c1 [go1.15] Use errors.As to unwrap net errors
Kubernetes-commit: c61c60eb1f59c92b0628484b55c640e585555aab
2020-08-07 15:22:54 -04:00
W. Trevor King
42b7b70457 leaderelection: Remove doubled space in "attempting to acquire leader lease" log
The extra space was introduced in 5b854e7b17 (say which lease is being
acquired, 2018-01-16, #58341).

Kubernetes-commit: e5347d48f9e67776984fbe284f03aefc425a951d
2020-08-05 14:31:39 -07:00
gobomb
330cb14339 let panics propagate up when processLoop panic
Kubernetes-commit: 19a3ca2c289b6f3dc8cd495e3db0d347b5a3b774
2020-08-03 09:30:39 +00:00
Kubernetes Publisher
00dbcca6ee Merge pull request #93408 from joelsmith/master
jsonpath: disallow multiple immediate recursive descent

Kubernetes-commit: c0ec2eee41794796dee230f75478602b707f2be2
2020-08-02 13:25:07 +00:00
Kubernetes Publisher
6ecbef1775 Merge pull request #93602 from liggitt/utils
Update k8s.io/utils

Kubernetes-commit: a5090a8ff253e1aa626cd5613329e23aaec27e88
2020-07-31 17:16:55 +00:00
Jordan Liggitt
21dad40135 Update k8s.io/utils
Kubernetes-commit: c11e52f410603d2e8eaf6591b4c83ab19d233b17
2020-07-31 10:44:33 -04:00
Joel Smith
2221ace373 jsonpath: disallow multiple immediate recursive descent (e.g. ....Foo)
Kubernetes-commit: 8c702254938c40a48b2e3db78fcc944ca50fdc65
2020-07-30 10:53:12 -06:00
Chris Mark
ffcde95237 Document blocking behaviour of RunOrDie and Run
Kubernetes-commit: b09c01c9e2a35b8f91fad319db77bdf8963c05f1
2020-07-30 17:04:57 +03:00
caozhiyuan
fa1e013ed0 reduce type conversion and correct variable name
Kubernetes-commit: 13468442bfbdf69a6e6690497fce427317cff790
2020-07-29 19:18:05 +08:00
ZeroMagic
3431b0db1c chore: upgrade Azure/go-autorest to v14.2.0
use autorest v0.11.1

Signed-off-by: ZeroMagic <jiliu8@microsoft.com>

Kubernetes-commit: 7b444eeff37234c329a0c2ccbd5195e434c22791
2020-07-28 07:25:04 +00:00
Kubernetes Publisher
36233866f1 Merge pull request #93264 from justaugustus/go115
Update Golang to v1.15.0-rc.1

Kubernetes-commit: 9a20f30745477423e8776bb0d05316c00648f49b
2020-07-26 13:17:03 +00:00
Jordan Liggitt
523b4b71c2 generated: hack/update-vendor.sh
Kubernetes-commit: 6c2d18369f688b7200cefdca71709bb698081e84
2020-07-25 15:27:12 -04:00
Jordan Liggitt
9a590f8895 [go1.15] go.mod: update to go1.15
Kubernetes-commit: 247fcdfda5311bfc446c61c7bda67803e3527fdd
2020-07-25 15:02:16 -04:00
Kubernetes Publisher
6b13c5bd95 Merge pull request #93425 from liggitt/string-cast
Fix int->string casts

Kubernetes-commit: 19caf386650b80ce9d288cc8c42efcf2f0fd87b1
2020-07-25 09:16:56 +00:00
Kubernetes Publisher
554373823d Merge pull request #93410 from nikhita/apimachinery-triage-labels
Don't apply triage/needs-information on apimachinery and instrumentation PRs

Kubernetes-commit: 54e20707225656d6f4eaa32236216b6830a5b107
2020-07-25 05:16:34 +00:00
Jordan Liggitt
e6a0f4acba Fix int->string casts
Kubernetes-commit: 124a5ddf725c4862520d8619017cac9db7a03522
2020-07-24 11:13:07 -04:00
Nikhita Raghunath
e83c4c2825 Revert "Merge pull request #93156 from logicalhan/triage-api-machinery"
This reverts commit 32438cf26938091bea56e7ca7c3fcf4215652f9c, reversing
changes made to bb6a6aa3915cc9f7efaaf2291f6adac8333fd33c.

Kubernetes-commit: c00dae060731f6286ee3743db24782f09c33945a
2020-07-24 13:01:02 +05:30
Kubernetes Publisher
3473491eeb Merge pull request #93156 from logicalhan/triage-api-machinery
automatically assign triage labels to api-machinery tagged PRs

Kubernetes-commit: 32438cf26938091bea56e7ca7c3fcf4215652f9c
2020-07-22 05:19:03 +00:00
Kubernetes Publisher
d46605b64e Merge pull request #93253 from liggitt/utils-trace
Update k8s.io/utils

Kubernetes-commit: bb079afdef2b36a9fc9d081411a1de18b91d1ae0
2020-07-21 05:15:58 +00:00
Jordan Liggitt
5252da0c70 Update k8s.io/utils
Kubernetes-commit: 7aacbeac144a7772fa8eac5582bbd64bc52804a4
2020-07-20 11:12:29 -04:00
Stephen Solka
166114c4a0 prefer NoError/Error over Nil/NotNil
Kubernetes-commit: 203679cc6105ea490e75af1efa83497b771d7d36
2020-07-18 20:23:35 -04:00
Han Kang
7137eafebb automatically assign triage labels to api-machinery tagged PRs
Change-Id: Ifcc8a85d190d6370423af27f6e6c4c90b8472981

Kubernetes-commit: 9129dbc98bd847be9d96b39733a3b28107c920a1
2020-07-16 13:13:59 -07:00
Kubernetes Publisher
319dbfd0ed Merge pull request #92926 from detiber/FixFakeScaleClientUpdate
[client-go] Fix argument ordering for fake scale client update

Kubernetes-commit: 165a221b1c8eea44dd1a6281bc9c8ff5ee3a33d3
2020-07-13 13:08:42 +00:00
Kubernetes Publisher
505a1f4431 Merge pull request #92919 from dashpole/update_cadvisor
Update cAdvisor to v0.37.0

Kubernetes-commit: 6b5dc3770851fdc1f356e36fd17810c744181fb1
2020-07-13 13:08:41 +00:00
Kubernetes Publisher
7392b9857a Merge pull request #92910 from soltysh/kubectl_cache
Setup cache dirs properly based on --cache-dir value

Kubernetes-commit: 7d1daa09383d32fe7a325d6275d9bd51cba45ee5
2020-07-13 13:08:38 +00:00
Kubernetes Publisher
7fa340820d Merge pull request #92874 from chelseychen/event-api
Fix a few places where source field is empty when creating events via events/v1

Kubernetes-commit: c23a4b08d704156db724769a32edc71c921095d4
2020-07-12 05:06:49 +00:00
Nikhita Raghunath
480d796592 apimachinery: remove inactive members from OWNERS
Kubernetes-commit: db495ea9837cf840639a4e02085253fb341e12b5
2020-07-11 19:28:24 +05:30
Kubernetes Publisher
16621f6444 Merge pull request #92768 from deads2k/security-contacts
update security contacts for apimachinery repos

Kubernetes-commit: 0cc96859473a21eb7d4f44f355d50881e12925ad
2020-07-11 01:12:23 +00:00
Kubernetes Publisher
2cf22cd488 Merge pull request #92661 from jpbetz/smd-bump-field-unsetting
Bump to SMD PR#166 to pick up unsetting field changes and add integration tests

Kubernetes-commit: 49dced762da7bc9f74474e9f8f3efe198ff46767
2020-07-11 01:12:21 +00:00
David Ashpole
e2f93aa779 update cAdvisor to v0.37.0
Kubernetes-commit: 1f70708f6cc85985725c11cd69c4965c1f97b314
2020-07-09 10:23:10 -07:00
Kubernetes Publisher
cf11d9b71a Merge pull request #91745 from Bisnode/gh-87369
Presence of bearer token should cancel exec action

Kubernetes-commit: fe43b104ba28271f06cae81100e9baf38bc26391
2020-07-09 17:09:53 +00:00
Kubernetes Publisher
5ab99756f6 Merge pull request #92611 from liggitt/go1.13
Tolerate go 1.13 builds

Kubernetes-commit: 896da2253c77d15fc551843e515039c6e9c86c99
2020-07-09 13:15:00 +00:00
Kubernetes Publisher
54349b6a4e Merge pull request #92387 from pohly/csi-storage-capacity
CSI storage capacity check

Kubernetes-commit: 94a08e159aa2820ac2a0d96daa66421cfa17058f
2020-07-09 13:14:57 +00:00
Kubernetes Publisher
b9931a5691 Merge pull request #91305 from ankeesler/ankeesler/exec-cred-prov-install-hint
exec credential provider: add install hint

Kubernetes-commit: 422e4421f1d4063ff5a0c394b7f54eb23374fa5f
2020-07-09 13:14:54 +00:00
Jason DeTiberus
0117bb8b93 [client-go] Fix argument ordering for fake scale client update
Fixes the argument order used when calling testing.NewUpdateSubresourceAction
within the fake scale client. This was causing the generated action to swap the values
of the Namespace and Subresource in the Action.

Kubernetes-commit: 34a446d812c423da7a306963f250f4002dac9be8
2020-07-08 20:27:13 -04:00
Maciej Szulik
65806b89ce Setup cache dirs properly based on --cache-dir value
Kubernetes-commit: 6c6cd2deeb03040d458b00824fd6c1a900a81b51
2020-07-08 15:43:25 +02:00
Mike Spreitzer
53f29dc721 Replaced repair with returning error, in delta_fifo.go
When dedupDeltas does the impossible and the key is already queued,
return an error rather than maintain the data structure invariants.

Kubernetes-commit: a39481a4f6cf33f9bf4555adcffa28077863e7a9
2020-07-08 01:15:51 -04:00
Chelsey Chen
51d7273066 Update conversion between ReportingController and Source.Component
Kubernetes-commit: e010436e2acc96d710620a91ceaaa86becca4060
2020-07-07 13:38:48 -04:00
Kubernetes Publisher
1e6150831a Merge pull request #92662 from chelseychen/event-api-fallback
Switch event recorder to use events.k8s.io/v1

Kubernetes-commit: b6cbe1b8deb0b2d2a9bfdc8b4e7ba7d1e7e76ac2
2020-07-03 05:03:15 -07:00
Mike Spreitzer
a166e2578b Repair instead of panic when data corruption detected in DeltaFIFO
Kubernetes-commit: abcd0f82c5634c7a23b9390172b7c6ae907d84f7
2020-07-02 23:23:59 -04:00
David Eads
90050574e3 update security contacts for apimachinery repos
Kubernetes-commit: 29c4e858b0017f8aa328d487adbbe910b8205cf8
2020-07-02 16:00:53 -04:00
Chelsey Chen
c9818a9a30 Remove DeprecatedSource assignment to avoid validation failure
Kubernetes-commit: e54ad20f057f1ca4e94552b9373f2762a39b3fd2
2020-07-02 12:53:25 -04:00
Jordan Liggitt
642b892655 Generated files
Kubernetes-commit: ddfe1372549c57c36bb5c3077584d448f117e706
2020-06-29 12:46:44 -04:00
Joe Betz
70183a7e4a Bump to sigs.k8s.io/structured-merge-diff 43c19b to pick up unsetting fields changes PR#166
Kubernetes-commit: 11c38a9c703b825c61d6490e8da85202b760f3b1
2020-06-26 20:05:34 -07:00
Chelsey Chen
67fdd63515 Switch event recorder to use events.k8s.io/v1
Kubernetes-commit: ade242288346d968ab97f42ffb30e0855e235afc
2020-06-16 18:25:18 -04:00
Kubernetes Prow Robot
de1f58acbf Merge pull request #821 from nikhita/readme-1.18
README: add 1.18 in compatibility matrix
2020-07-03 00:40:48 -07:00
Kubernetes Publisher
9676485b71 Merge pull request #91645 from chelseychen/event-api
Promote new Event API to v1

Kubernetes-commit: 1b871091b98f31e3ec8fff271fa4d6b0f039e309
2020-07-02 13:07:12 +00:00
Kubernetes Publisher
ae79ca62db Merge pull request #92655 from BenTheElder/cleanup-some-owners
Cleanup some owners

Kubernetes-commit: 94e1c54735d9cb3fb281444de159aadfdbab47b8
2020-07-02 09:07:12 +00:00
Kubernetes Publisher
bdcd046d6c Merge pull request #92554 from serathius/klog-upgrade
Update k8s.io/klog to v2.2.0

Kubernetes-commit: bd60f0787e2b6ba9ab82281879afa641677f0d3d
2020-07-02 09:07:09 +00:00
Kubernetes Publisher
4088fed933 Merge pull request #92513 from soltysh/client_lock
Add the ability to opt-out from config lock file

Kubernetes-commit: 2585d78c79054a6d85620eb5430a1498bb747967
2020-07-02 09:07:06 +00:00
Kubernetes Publisher
5f4e5d88ae Merge pull request #92537 from wojtek-t/fix_reflector_not_making_progress
Fix bug in reflector not recovering from "Too large resource version"…

Kubernetes-commit: ed06981eab5e037b7d5b090b257054abb4d42ea0
2020-07-01 09:07:22 +00:00
Benjamin Elder
d68fd20f32 remove david-mcmahon from reviewers
Kubernetes-commit: d8f2b131b52b5f296818da50e66bba51a1e05c01
2020-06-30 14:06:58 -07:00
Benjamin Elder
1a4844dbb1 eparis to emeritus
Kubernetes-commit: 2abc8afececeadad26c6bb90d3b096f2b8008131
2020-06-30 09:50:44 -07:00
Kubernetes Publisher
03667fd6b1 Merge pull request #92544 from sttts/sttts-NewNonInteractiveDeferredLoadingClientConfig-NFE
clientcmd: fix NPE in NewNonInteractiveDeferredLoadingClientConfig with nil overrides

Kubernetes-commit: 8ce80c2292d938c8767459c7c40aeca91ed264a6
2020-06-30 09:07:20 +00:00
Marek Siarkowicz
92794af67a Update k8s.io/klog to v2.2.0
Kubernetes-commit: e72521e1d7e2eef32e78828ab111670fe2f591ae
2020-06-26 19:09:04 +02:00
Dr. Stefan Schimanski
8f2b164e09 clientcmd: fix NPE in NewNonInteractiveDeferredLoadingClientConfig with nil overrides
Kubernetes-commit: 945991b40275b096707c7b9eb0f192e99bd15b6d
2020-06-26 15:59:17 +02:00
Kubernetes Publisher
db5293afc7 Merge pull request #91366 from giuseppe/cgroupfs-cgroupv2
vendor: update google/cadvisor and opencontainers/runc

Kubernetes-commit: a03db636daef0417218ef8c108c0a6530d2ef368
2020-06-26 13:07:35 +00:00
wojtekt
ec46b97af4 Fix bug in reflector not recovering from "Too large resource version" errors
Kubernetes-commit: 3704174f95c7311e025284ef30bb56945fa6e7cc
2020-06-26 09:45:29 +02:00
Maciej Szulik
18374dcbea Add the ability to opt-out from config lock file
Kubernetes-commit: 3574d88e22d68fc3291bf1c8432326d0e14fa3bd
2020-06-25 17:29:32 +02:00
Giuseppe Scrivano
7e848aeed2 vendor: update google/cadvisor and opencontainers/runc
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Kubernetes-commit: a6a3bf2eb4a0b7e9f86f991ffc24b72beafce2f4
2020-06-24 10:56:34 +02:00
Kubernetes Publisher
5fade4ec57 Merge pull request #92438 from liggitt/1.14
go1.14 fixup

Kubernetes-commit: 4de511a4cfdb8e49e804be18245911bf3270fb2f
2020-06-24 09:03:46 +00:00
Nikhita Raghunath
c2b8ae4b7a README: add 1.18 in compatibility matrix 2020-06-24 12:24:25 +05:30
Jordan Liggitt
ead3ce5ade go1.14: run hack/update-vendor.sh
Kubernetes-commit: d9bb0b8ee18fe68654ef1a68611f905859b3b7bc
2020-06-23 17:01:33 -04:00
Kubernetes Publisher
e0abfaa8ef Merge pull request #91712 from KobayashiD27/structured-logging-in-event
Migrate log to klog.InfoS for staging/src/k8s.io/client-go

Kubernetes-commit: 00d6255f440f4513dfaafaf6c0d0206ab9e9bd22
2020-06-23 09:24:59 +00:00
Kubernetes Publisher
57681663d9 Merge pull request #91634 from jpbetz/latest-utils
Bump k8s.io/utils to 6e3d28 to pick up nested trace

Kubernetes-commit: a7e4973cb9d163fa9df2ecc0955d156d507a9a71
2020-06-23 05:21:57 +00:00
Joe Betz
b4312fa6cf Bump k8s.io/utils to 6e3d28 to pick up nested trace
Kubernetes-commit: 52838be7b22c53050d4e397c221f0b3c3842122c
2020-06-19 10:17:13 -07:00
Kubernetes Publisher
c8ca982e60 Merge pull request #92251 from nikhita/client-go-pod-proxy
client-go: add ProxyGet expansion method for pods

Kubernetes-commit: 3d0848c9e3c63e6e132c525b1c71e1eda5c0e823
2020-06-19 21:22:52 +00:00
Kubernetes Publisher
58357f96bf Merge pull request #92219 from voor/update-golang-text
[security] Vulnerability in golang.org/x/text/encoding/unicode v0.3.2

Kubernetes-commit: 08ab50d1a870d12044081f58c6f9fa18b989597f
2020-06-19 21:22:50 +00:00
Kubernetes Publisher
7a96a1f079 Merge pull request #91798 from chelseychen/event-fallback
Move fallback of Event API into new event lib

Kubernetes-commit: 7e69068dcb7608169747d1ff5c85bae8c3a2e66e
2020-06-19 05:21:40 +00:00
Kubernetes Publisher
18c1ef0354 Merge pull request #92139 from ash2k/ash2k/fix-clientConfig-data-race
Fix client config data race

Kubernetes-commit: 37ec23c4370028ed5205c99b97226c914696d4c1
2020-06-18 13:24:24 +00:00
Nikhita Raghunath
8c1e3c3fbd client-go: add ProxyGet expansion method for pods
Currently, the proxy subresource is not supported for pods in client-go.
Today, invoking this requires using the REST client directly.

To make using the proxy resource easier, this commit adds a ProxyGet
method for pods in pod_expansion.go similar to the ProxyGet method
for services in service_expansion.go.

Ref: d8febccacf/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service_expansion.go

Kubernetes-commit: 72ab11193a419f0e0e66e86c4e6be9991c3682f2
2020-06-18 16:28:23 +05:30
Kubernetes Publisher
3ab27431ef Merge pull request #90523 from sttts/sttts-security-contacts
Add myself to staging repo SECURITY_CONTACTS

Kubernetes-commit: d8febccacfc9d51a017be9531247689e0e36df04
2020-06-18 09:21:51 +00:00
Robert Van Voorhees
cc928941e5 [security] Vulnerability in golang.org/x/text/encoding/unicode v0.3.2
Hello gophers,

Version v0.3.3 of golang.org/x/text fixes a vulnerability in the golang.org/x/text/encoding/unicode package which could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory.

An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.

transform.String has also been hardened not to enter an infinite loop if a Transformer keeps returning ErrShortSrc even if atEOF is true.

This issue was first filed as Issue 39491 by GitHub user abacabadabacaba and reported to the security team by Anton Gyllenberg. It is tracked as CVE-2020-14040.

Cheers,

Katie for the Go team

Kubernetes-commit: 3cef97e8b5f67b4a350ee7a51e68604732e46f58
2020-06-17 07:57:05 -04:00
Kubernetes Publisher
15d3142967 Merge pull request #89778 from cmluciano/cml/ingressv1
ingress: Add Ingress to v1 API and update backend to defaultBackend

Kubernetes-commit: 53f3699cf936b14e04b8533e51e8e7ffe0eeb7ef
2020-06-17 09:06:52 +00:00
Kubernetes Publisher
3c831c893e Merge pull request #92069 from tapih/update-json-patch
Update github.com/evanphx/json-patch to e83c0a1c26c884f8ec4fb743f6db9…

Kubernetes-commit: 81f84d3a1764e883441ff155a3c0fdc724a1b304
2020-06-17 05:06:43 +00:00
Chelsey Chen
24854a9a68 Auto generated changes
Kubernetes-commit: c90330d8f4ca9fd980df24044960a4d8bb28a780
2020-06-16 18:25:18 -04:00
Kubernetes Publisher
31e286ee19 Merge pull request #73032 from liggitt/kubectl-warning
surface server-side warnings in client-go / kubectl

Kubernetes-commit: 7151131d79674d073e716063a03f8cbd67671e33
2020-06-16 09:19:03 +00:00
Mikhail Mazurskiy
afa880fea1 Fix data race on config.clientConfig
config.clientConfig can have an unlocked read
and a locked write

Kubernetes-commit: 609da52afaf6395d738f529c78daadc05e619f68
2020-06-15 21:53:11 +10:00
Mikhail Mazurskiy
29b07456f5 Check errors of the Close call
Error from out.Close() was not checked

Kubernetes-commit: f9b928f1f13821b65ea4ef783f847993c51fb4dd
2020-06-15 21:47:08 +10:00
Mikhail Mazurskiy
6cc39819fd Make inClusterConfigProvider thread safe
If configuration object is used concurrently
it is not safe to mutate self.
There is no need for mutation so avoid it
just in case.

Kubernetes-commit: 9e360eb05efafd0fcabd5a065b62cb8226da94c2
2020-06-15 21:17:45 +10:00
Mikhail Mazurskiy
6d09f8e62e Stop using mergo.MergeWithOverwrite
Use the recommended replacement instead.

Kubernetes-commit: 243a9b204e14dc9c92f08cd3252c31731b9532fd
2020-06-15 21:11:27 +10:00
Mikhail Mazurskiy
277eea62aa Cleanup currentMigrationRules
1. Use filepath for filename manipulations
2. Restructure method logic

Kubernetes-commit: 11800147f51e85b9a4fb7eb2654cae3ded9d8cf0
2020-06-15 20:59:21 +10:00
Hiroshi Muraoka
6674917427 Update github.com/evanphx/json-patch to e83c0a1c26c884f8ec4fb743f6db92a941f605f1
Signed-off-by: Hiroshi Muraoka <h.muraoka714@gmail.com>

Kubernetes-commit: 5b06aaa7ab7d8ecf3b0088de13b3df381409e88f
2020-06-12 11:11:08 +00:00
Mike Spreitzer
826338c319 Remove contemplation of invariant violations from delta_fifo.go
Some comments and code incorrectly contemplated violating the
invariant that a keys is in `f.items` if and only if it is in
`f.queue`.

Also fixed up some comment wording.

Kubernetes-commit: 5efd727d112206ef9a8ede93c5878b0d40707ae9
2020-06-09 18:57:28 -04:00
Kobayashi Daisuke
b5d4191149 Replace StartLogging(klog.Infof) with StartStructuredLogging(0)
Kubernetes-commit: 4ae11dac2e2cc8594c528a679db5861c0926b514
2020-06-09 12:01:45 +09:00
Kobayashi Daisuke
55768fa31f Add an function for Structured Logging function into EventBroatcaster
Kubernetes-commit: dcaa8d7126cb711b9b93ef10fa84364dac8a22d3
2020-06-09 10:10:41 +09:00
Chelsey Chen
a8a31f0d9b Move fallback of Event API into new event lib
Kubernetes-commit: e0e12f25c9ccd33f5578fddef79d93eb7b62ea0c
2020-06-04 21:36:04 -04:00
Patrick Ohly
1d719d3045 CSIStorageCapacity: 'make update'
Kubernetes-commit: 9a66e8e1b5820027c1747cff052d335e29597fc2
2020-06-04 20:50:43 +02:00
Anders Eknert
2321e60ec1 Presence of bearer token should cancel exec action
If a bearer token is present in a request, the exec credential plugin should accept that as the chosen method of authentication. Judging by an [earlier comment in exec.go](c18bc7e9f7/staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go (L217)), this was already intended. This would however not work since UpdateTransportConfig would set the GetCert callback which would then get called by the transport, triggering the exec plugin action even with a token present in the request. See linked issue for further details.

See #87369 for further details.

Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>

Kubernetes-commit: b423216a3b781009fb4ec4d5974eeb3f882f9d2d
2020-06-04 00:12:05 +02:00
Kobayashi Daisuke
10e6fa29f1 Migrate log to klog.InfoS for staging/src/k8s.io/client-go
Kubernetes-commit: ed1b83c6de5ccc62494e7f0e580cd743ad9a5934
2020-06-03 11:13:54 +09:00
Andrew Keesler
11ef39e643 Fix typo: authentiction -> authentication
Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: eefed60e2300bdb9f5827e2da63d6949bb080d4c
2020-05-21 20:13:20 -04:00
Andrew Keesler
6b620f1777 exec credential provider: add install hint
This commit adds the ability for users to specify an install hint for
their exec credential provider binary.

In the exec credential provider workflow, if the exec credential binary
does not exist, then the user will see some sort of ugly

  exec: exec: "does-not-exist": executable file not found in $PATH

error message.  If some user downloads a kubeconfig from somewhere, they
may not know that kubectl is trying to use a binary to obtain
credentials to auth to the API, and scratch their head when they see
this error message.  Furthermore, even if a user does know that their
kubeconfig is trying to run a binary, they might not know how to obtain
the binary.  This install hint seeks to ease the above 2 user pains.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 94e2065df2eef3b198942efb156ef6e27abcc6f9
2020-05-20 15:20:20 -04:00
Monis Khan
eb15c10113 Generated bazel
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 0284139660dcabfe8816b3136f12d79a5a236db1
2020-05-06 02:17:37 -04:00
Monis Khan
8959cc2497 Generated conversions
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 99566970ceceb7e60f48cf2ff3015586fe50cc0e
2020-05-06 01:28:11 -04:00
Monis Khan
9e147f192f exec credential provider: wire in cluster info
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: f97422c8bd57692f5a1a3aa6dc6abc31051ebc82
2020-05-06 01:01:09 -04:00
Dr. Stefan Schimanski
c062ecda03 Add myself to staging repo SECURITY_CONTACTS
Kubernetes-commit: d42ccdc690f617cd55da0e3f699194e1dc247895
2020-04-27 16:39:25 +02:00
Zachary Seguin
7efa263687 Add lease release tests in leader election
Kubernetes-commit: a4979cd2a69192138b5998daca07d9b7ca6c8801
2020-04-22 18:52:44 -04:00
Jordan Liggitt
4622a81a82 Generated files
Kubernetes-commit: df6608dc998f4b403f10433809dfbc78e20c890d
2020-04-14 22:26:35 -04:00
Christopher M. Luciano
0197b870e3 ingress: Add Ingress to v1 API and update backend to defaultBackend
ingress: use new serviceBackend split

ingress: remove all v1beta1 restrictions on creation

This change removes creation and update restrictions enforced by
k8s 1.18 for not allowing resource backends.

Paths are no longer
required to be valid regex and a PathType is now user-specified
and no longer defaulted.

Also remove all TODOs in staging/net/v1 types

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 2b091f60ca09d3d03923a26b7cd02fb3dc6c47e2
2020-04-01 14:51:04 -04:00
Zachary Seguin
710705cfe6 Generate complete leader election record to resolve leader election issues with LeaseLocks
Kubernetes-commit: c902b8a20578a1d299e3563613a66ed32f70efad
2019-08-03 17:40:03 -04:00
André Martins
2396a52017 client-go/rest: fix finalURLTemplate for url base == "/"
In some environments, where url base is "/", it can cause all paths to
be presented in metrics with "{prefix}" as `groupIndex` is with the wrong
index. To fix the behavior in such environments, it was added a
conditional branch to check if the URL base is "/" and, thus, print the
metrics with the correct path, for example "api/v1/nodes/{name}" instead
of "{prefix}".

Fixes: 99248b8fe1fe ("Rewrite finalURLTemplate used only for metrics because of dynamic client change")
Signed-off-by: André Martins <aanm90@gmail.com>

Kubernetes-commit: c039b02fa7281fc061455e23b6530ed8b4d19645
2019-02-21 20:25:36 +01:00
Jordan Liggitt
75f9ee62c1 client-go: extract warning headers from API responses
Kubernetes-commit: b1098bd0d53658bfb945e485683d543ab7dc73ba
2019-01-17 11:35:07 -05:00
Kubernetes Publisher
63eae69e3c Merge pull request #91754 from liggitt/csr-v1-client-go-manager
CSR v1 - switch client-go certificate manager utility to v1 by default

Kubernetes-commit: 507cc204044149843ebda8ca64ea2403866a545c
2020-06-16 09:19:01 +00:00
Jordan Liggitt
3ab7d09ea9 Switch cert manager to v1 CSR API by default, falling back to v1beta1
Kubernetes-commit: a298c14f18d4973a9ceaf21f1e0dc4e39b4c5bfb
2020-06-03 22:40:02 -04:00
Kubernetes Publisher
0adb702ae4 Merge pull request #91792 from serathius/klog2
Upgrade klog to v2.1.0

Kubernetes-commit: a36b9a992223a71d822f3a0680f6b5202d2687d8
2020-06-16 09:18:59 +00:00
Kubernetes Publisher
e2038ac220 Merge pull request #91485 from knight42/fix/fake-pod-logs
fix: make fake.Clientset support streaming logs

Kubernetes-commit: a054010d032b301e495d1a421f53b9a37a0a0109
2020-06-16 09:18:56 +00:00
Kubernetes Publisher
9f48a1ba50 Merge pull request #91685 from liggitt/csr-v1
CertificateSigningRequest v1 API

Kubernetes-commit: 3f8bb1bf50fb5a13a5823bdbc49bd6c2198752db
2020-06-16 09:18:55 +00:00
Marek Siarkowicz
e7fab6fed0 Upgrade klog to v2.1.0
Update contains fixes required for Structured Logging Effort

Kubernetes-commit: 1e3918f1d0dd8809d3675caeb49a7c99b9941263
2020-06-04 23:18:01 +02:00
Jordan Liggitt
e900be4b2f Generated files
Change-Id: I598d686849f4b97846757b227f5191bac031798b

Kubernetes-commit: a504445086243627417aada477bc602594a71951
2020-06-01 22:26:24 -04:00
Kubernetes Publisher
be97aaa976 Merge pull request #91435 from jqmichael/deltaFifoDoc
Updated delta FIFO doc

Kubernetes-commit: 5a784d4faaf2d589ed61c4c386f3060b358740f6
2020-06-03 03:53:52 +00:00
Kubernetes Publisher
72878402c8 Merge pull request #90191 from liggitt/csr-status
CSR condition status, lastTransitionTime, versioned validation

Kubernetes-commit: 5fb9e35e57bf0ccdfa52d9f05a27ff641470d430
2020-06-02 06:50:01 +00:00
Kubernetes Publisher
01913eaa61 Merge pull request #91561 from RainbowMango/pr_fix_invalid_recover
fix a client-go crash handler not working issue.

Kubernetes-commit: 99df02cd4ad467279ed758674542cf9a2c042859
2020-05-30 10:48:35 +00:00
Kubernetes Publisher
7530c5eab3 Merge pull request #91502 from deads2k/dyn-audit-removal-00
remove --feature-gates=DynamicAuditing

Kubernetes-commit: d1586ea3f916b98b82c175102092c4af305da45f
2020-05-30 10:48:34 +00:00
RainbowMango
78a7be5457 fix a client-go crash handler not working issue.
Kubernetes-commit: 4a4d1947b031aa301be6046c641faae275f5223b
2020-05-29 14:41:27 +08:00
Jordan Liggitt
198e8f5ee4 Switch issued check to inspect certificate length
Kubernetes-commit: 94fd1d76ca0e8992b000fbb6b1562c11c37df7cb
2020-05-28 10:48:49 -04:00
David Eads
fb82acb39d remove-api
Kubernetes-commit: e857adbdfdba795ceca870f194d8d8a296bbdc21
2020-05-27 14:27:08 -04:00
knight42
cacbf4f9e0 fix: make fake.Clientset support streaming logs
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: 16238e10def838ba58037279b480315b2c77ae21
2020-05-27 17:45:12 +08:00
Hongcai Ren
f099a72e14 cleanup misleading errors in openAPI tesing (#91321)
* cleanup misleading errors in openAPI tesing

* make sure test case would fail

Kubernetes-commit: 0459c2afab4f1913993e437a781e95457ecefb42
2020-05-27 00:25:20 +00:00
Qing Ju
89cf2be62c Added clarification to delta FIFO doc
Kubernetes-commit: c71272b0c7ac09991ba215e7bc5a8af8334c4b17
2020-05-25 19:48:10 -07:00
Kubernetes Publisher
7ab8430bef Merge pull request #90825 from dopelsunce/master
Fix race condition between Pop and Close FIFO queue

Kubernetes-commit: 738dfcfff019a9868bd0ffd8df981e7e02630ebb
2020-05-20 08:23:44 +00:00
Kubernetes Publisher
c4288707f0 Merge pull request #90496 from gaurav1086/test_decoder_race_condition
Fix race condition in decoder test

Kubernetes-commit: 6ed5290729aeb0aacd2c7ad6f6f49ae6212e4762
2020-05-20 04:26:24 +00:00
Kubernetes Publisher
55f6825a59 Merge pull request #91174 from jqmichael/updateHasSyncDoc
Polished up comments around HasSynced()

Kubernetes-commit: e5ead81bb00379b0c889499a9e5aa69f031a122e
2020-05-20 00:28:49 +00:00
Kubernetes Publisher
455d6109ca Merge pull request #90582 from RainbowMango/pr_bump_client_golang_1_6
bump client_golang to v1.6.0

Kubernetes-commit: 78f2c8f70d66dd5c64697418d034429b3ebd9dce
2020-05-19 08:23:52 +00:00
RainbowMango
d8441915a6 Pin transitive dependencies:
pin dependency github.com/beorn7/perks from v1.0.0 to v1.0.1
pin dependency github.com/golang/protobuf from v1.3.3 to v1.4.2
pin denpendency github.com/json-iterator/go from v1.1.8 to v1.1.9
pin dependency github.com/prometheus/common from v0.4.1 to v0.9.1
pin dependency github.com/prometheus/procfs from v0.0.5 to v0.0.11
pin dependency github.com/alecthomas/template from v0.0.0-20160405071501-a0175ee3bccc to v0.0.0-20190718012654-fb15b899a751
pin dependency github.com/alecthomas/units from v0.0.0-20151022065526-2efee857e7cf to v0.0.0-20190717042225-c3de453c63f4
pin dependency github.com/go-kit/kit from v0.8.0 to v0.9.0
pin dependency github.com/go-logfmt/logfmt from v0.3.0 to v0.4.0

Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>

Kubernetes-commit: 283d9f7483d9a5b30746921a68e7a5e586c2c80e
2020-05-18 12:40:21 +08:00
RainbowMango
2802c11f21 bump github.com/prometheus/client_golang to v1.6.0
Kubernetes-commit: d8062e076e76bdea573bd19d4e2d0074d1f3fdac
2020-05-18 12:37:08 +08:00
Kubernetes Publisher
3d5c80942c Merge pull request #90183 from dims/update-kubernetes-to-klog-v2
Update kubernetes to klog v2

Kubernetes-commit: b170451caa083434ee7875c2708c6f85eb220a39
2020-05-17 04:23:58 +00:00
Qing Ju
aea2fc6906 Polished up HasSync comment
Kubernetes-commit: 168d0848299a625b9d4d2b85923efc60ed7de734
2020-05-16 20:41:07 -07:00
Davanum Srinivas
99fc7658c9 Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 07d88617e55b64c243956c7b2032430beb03b159
2020-05-14 19:00:57 -04:00
Davanum Srinivas
48c3485ab5 Drop tests that break with newer oauth2
The bazel test failures are caused by (oauth2: turn Transport.CancelRequest into a no-op)[858c2ad4c8]:
0f29369cfe...858c2ad4c8

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

Kubernetes-commit: eea0fea657e5955dedcb6e39bad4dca57d70553c
2020-05-12 11:51:13 -04:00
dopelsunce
73aa499de0 Fix race condition between Pop and Close FIFO queue
Fixes: kubernetes#90581 (the first part)

When `Close()` is invoked on an empty queue, the control loop inside `Pop()` has a small chance of missing the signal and blocks indefinitely due to a race condition. This PR eliminates the race and allows the control loop inside any blocking `Pop()` to successfully exit after Close() is called.

Kubernetes-commit: d8b90955519d10b99415515f8314dd6d35caae8d
2020-05-06 19:01:13 -05:00
Gaurav Singh
d3f56086aa duplicate iteration variable in go func
Kubernetes-commit: c6ac8ea5f7b4e4a6f4d4895122ab1b613840b199
2020-05-04 21:52:06 -04:00
Gaurav Singh
be961bda71 goroutine: Convert eventType to interface{}
Kubernetes-commit: e3dde36e1410b4c9b49648378b2dea1612f612fb
2020-04-26 11:06:32 -04:00
Gaurav Singh
f74b86b7ea Fix race condition in decoder
Kubernetes-commit: 9027f30aa865f108c827060ef59ac62c9d07002b
2020-04-25 20:35:04 -04:00
Davanum Srinivas
75fea27a27 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Davanum Srinivas
6d56f3d16b Updating dependency golang.org/x/mod to version v0.1.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 3992c8669fa28e6a2721a09d750345f28f21e5f2
2020-05-14 18:04:08 -04:00
Davanum Srinivas
372442b19c Updating dependency golang.org/x/mobile to version v0.0.0-20190719004257-d2bd2a29d028
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: e3a1dde5a1b8f712320c9f898d184fe6cde1cc24
2020-05-14 18:01:55 -04:00
Davanum Srinivas
8ce29a4286 Updating dependency golang.org/x/image to version v0.0.0-20190802002840-cff245a6509b
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4fca8bba148d05123060f332b7c7a7add08031b5
2020-05-14 17:59:40 -04:00
Davanum Srinivas
74a329a2ed Updating dependency golang.org/x/oauth2 to version v0.0.0-20191202225959-858c2ad4c8b6
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 15fa9902e97edc3c13c0717c94210d7b613396e7
2020-05-14 17:57:35 -04:00
Davanum Srinivas
6d41533acd Updating dependency golang.org/x/lint to version v0.0.0-20191125180803-fdd1cda4f05f
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a31d23dce333ba0a171d9a3ddff8b97da460430b
2020-05-14 17:55:24 -04:00
Davanum Srinivas
284ce9e101 Updating dependency golang.org/x/exp to version v0.0.0-20191227195350-da58074b4299
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: cd596c5bdfcbf1dfa00ddd9d02aecae360150eb3
2020-05-14 17:53:16 -04:00
Davanum Srinivas
4e242beac2 Updating dependency honnef.co/go/tools to version v0.0.1-2019.2.3
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4335e46738e79a0ccf49ed098e1e8708d31b313a
2020-05-14 17:49:03 -04:00
Davanum Srinivas
702a294628 Updating dependency google.golang.org/appengine to version v1.6.5
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: f541ac3139760349248a446fc269b4f31f4892a4
2020-05-14 17:46:56 -04:00
Davanum Srinivas
eace4b6f37 Updating dependency go.opencensus.io to version v0.22.2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 3a44a2ab418ff00cd16b5118ce8626f579e19e32
2020-05-14 17:44:51 -04:00
Davanum Srinivas
356dee6609 Updating dependency github.com/jstemmer/go-junit-report to version v0.9.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a185928a258eca745a2b3a2db9b41b3502eb9c0c
2020-05-14 17:42:44 -04:00
Davanum Srinivas
cf08bd4c63 Updating dependency github.com/google/pprof to version v0.0.0-20191218002539-d4f498aebedc
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 584cccad8b2516c911dfcc09b2479228bfc7f788
2020-05-14 17:40:37 -04:00
Davanum Srinivas
fa52b12ba4 Updating dependency github.com/golang/groupcache to version v0.0.0-20191227052852-215e87163ea7
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9bdefa900ae13e237ace286eaa0ee22539ad4e9a
2020-05-14 17:38:28 -04:00
Davanum Srinivas
1d0d14eaa5 Updating dependency cloud.google.com/go to version v0.51.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 8a9bbd691e229a0818fabdd2049129e408156869
2020-05-14 17:34:15 -04:00
Davanum Srinivas
5f806ce082 Updating dependency k8s.io/utils to version 2df71eb
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 449810c7858cc84e98ff0c859f863a40b56710dc
2020-05-14 17:27:32 -04:00
Davanum Srinivas
54985447af Updating dependency github.com/GoogleCloudPlatform/k8s-cloud-provider to version 7901bc8
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: ca8ec8a6239b2b33aa73fd1178a4015194e9ad5a
2020-05-14 17:25:25 -04:00
Davanum Srinivas
998b8b4418 Updating dependency k8s.io/kube-openapi to version 656914f
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 815c6d4c90a7143d68bb4f7a509a244a26d6df01
2020-05-14 17:23:08 -04:00
Kubernetes Publisher
806d15d654 Merge pull request #91044 from gongguan/cobra-1.0.0
update spf13/cobra dependency to 1.0.0

Kubernetes-commit: 678415a8a711c875708b438d34022c40f3f3fca3
2020-05-15 12:23:52 +00:00
louisgong
5fdcde3625 update spf13/cobra dependency to 1.0.0
Kubernetes-commit: 205ded20da8676ada99786a3ca54b28217041d09
2020-05-13 15:27:34 +08:00
Kubernetes Publisher
d4685ebf69 Merge pull request #90855 from wojtek-t/remove_listwatchuntil
Remove ListWatchUntil

Kubernetes-commit: 437c2df36fe51237631751b38364cea4392a6f58
2020-05-12 00:23:33 +00:00
Kubernetes Publisher
a099a3ff31 Merge pull request #81443 from mikedanese/socks5
rest.Config: support configuring an explict proxy URL

Kubernetes-commit: ba35704b510f918254c3ba826fb63608f6ed2dd6
2020-05-10 16:23:20 +00:00
wojtekt
16393a6dc7 Remove ListWatchUntil
Kubernetes-commit: ead12b02fed9e8c3a8ebf693f71fa452115d923b
2020-05-07 20:21:46 +02:00
Kubernetes Publisher
06f6a9f888 Merge pull request #90818 from wojtek-t/fix_retry_watcher
Request for bookmarks in RetryWatcher

Kubernetes-commit: af67408c172630d59996207a2f3587ea88c96572
2020-05-07 16:23:46 +00:00
Mike Danese
2ff3b163f5 wire up proxier in spdy transport
and delete useless function

Kubernetes-commit: 652a48d2e7af76783cf08b5b1922da925e3d2a46
2020-05-06 10:51:52 -07:00
wojtekt
c16c96a7f1 Request for bookmarks in RetryWatcher
Kubernetes-commit: 7a65760f6e914e5421b443980831b2965c6954c7
2020-05-06 19:37:57 +02:00
Kubernetes Publisher
573f9163af Merge pull request #89660 from pjferrell/kubectl-jsonpath-nonprimitive-types
client-go/util/jsonpath: resolve #16707 by outputting json for non-primitive types

Kubernetes-commit: 0c3c2cd6ac8c9ffefc38f9746034e546331b9cd6
2020-04-29 08:20:53 +00:00
Kubernetes Publisher
5159cff060 Merge pull request #90493 from KnicKnic/cert_path
fix cert path generation in windows

Kubernetes-commit: e7de96e635f2dc50b2c5427743473093f4486d28
2020-04-26 04:01:45 +00:00
Knic Knic
d3d74fb975 fix cert path generation in windows
Kubernetes-commit: a381e1b04ec070a63d76d51663b7b0cbf4ce5403
2020-04-25 15:49:02 -07:00
Kubernetes Publisher
0ad81dc3c8 Merge pull request #90196 from markusthoemmes/remove-unused-parameterCodec
Don't generate parameterCodec if it's never used.

Kubernetes-commit: 013413d859324e4870edae1ad0c54dd404f872be
2020-04-24 08:01:47 +00:00
Kubernetes Publisher
d5598eafb0 Merge pull request #90317 from tangcong/fix-client-go-staticcheck-err
fix client-go util staticcheck error

Kubernetes-commit: cb719f75aac98ca24224c563d80d1035079885a5
2020-04-22 06:16:35 +00:00
tangcong
403aae0467 fix client-go util staticcheck error
Kubernetes-commit: 16c3ef2df8c12fcc4bc2596788fb6ee565b8eed8
2020-04-20 10:30:28 +08:00
Kubernetes Publisher
ede92e0fe6 Merge pull request #90243 from soltysh/issue90074
Revert "stop defaulting kubeconfig to http://localhost:8080"

Kubernetes-commit: e95106106b1e24056a98fd08740b5c5e6a00f8d7
2020-04-19 06:16:29 +00:00
Maciej Szulik
71473e9b7b Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee.

Kubernetes-commit: a871738c86a0bdf7c3b8924d1932e6f2c85ea8d8
2020-04-17 16:37:15 +02:00
ga
b3b874faea [AZURE] t.Fatalf() for nil pointer (#90154)
* [AZURE] t.FatalF() for nil pointer

* [AZURE] t.FatalF() for nil pointer

Kubernetes-commit: cf1b72e4571b69995ce65a659a9b67c867b1d1b0
2020-04-16 14:16:18 +00:00
Markus Thömmes
a57a2165c2 Run ./hack/update-codegen.sh.
Kubernetes-commit: b113638cc8f9f38f33f355ee0200e00a56703c6f
2020-04-16 10:53:36 +02:00
Jordan Liggitt
e72c3d3ce2 Stop waiting for failed CSRs
Kubernetes-commit: 184b3f81adcf73fe063579eeef41f5bc9c6ae19a
2020-04-16 01:06:10 -04:00
Phil Ferrell
bd76c10336 client-go: change jsonpath output of non-primitive types from Go-syntax to JSON
kubectl: add --output jsonpath-as-json to print a json array of results
kubeadm: fix test case using jsonpath result of non-primitive type

Kubernetes-commit: ba386aba4fe02906089ca3e96ee07925bced5d4d
2020-04-15 14:45:44 -07:00
Kubernetes Publisher
4529075edf Merge pull request #89913 from zhouya0/fix_kubectl_version_should_print_version_info
Fix kubectl version should print version info without config file

Kubernetes-commit: db999c96343c10e83d72ff4bb82e775f09edf0a6
2020-04-15 18:16:05 +00:00
Kubernetes Publisher
1be5940d0d Merge pull request #88940 from tianhongw/master
fix golint errors in staging/src/k8s.io/client-go/plugin/pkg/client/a…

Kubernetes-commit: 5bfe8fe2b9024f0319c053d5514b491f7c18aad8
2020-04-10 18:25:15 +00:00
Kubernetes Publisher
7b0589a246 Merge pull request #89833 from liggitt/json-raw
preserve integers decoding raw JSON values

Kubernetes-commit: ec00b4fcc2d0ad494275558e780606b1d9b3e469
2020-04-10 02:25:04 +00:00
Kubernetes Publisher
2a5c88adcc Merge pull request #89942 from dims/update-fsnotify-to-pick-up-bug-fixes
Updating dependency github.com/fsnotify/fsnotify to version v1.4.9

Kubernetes-commit: b3837f858adfc13952736fd076717ec525e96dc9
2020-04-09 02:15:45 +00:00
Kubernetes Publisher
4b490f30ca Merge pull request #88464 from brianpursley/kubernetes-86130
Fixed bug where jsonpath expression with nested range produces wrong output

Kubernetes-commit: 6747678a396ada2f4761ff104495ddcc3ef050b3
2020-04-08 06:17:38 +00:00
Davanum Srinivas
478cc67308 Updating dependency github.com/fsnotify/fsnotify to version v1.4.9
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: eee5235d2509df063189e08e150cc2c8213b54ed
2020-04-07 20:50:27 -04:00
Kubernetes Publisher
386829fa6b Merge pull request #89652 from liggitt/relist-timeout
Fix client watch reestablishment handling of client-side timeouts

Kubernetes-commit: 38f0a8bc74bed92bef87e20a79c36c5feea78b3d
2020-04-07 10:15:23 +00:00
zhouya0
1c7ee45b9b Fix kubectl version should print version info
Kubernetes-commit: 948f4de2dbba3affca2de460d836158cbde5db78
2020-04-07 15:18:38 +08:00
Kubernetes Publisher
fe32aa3b94 Merge pull request #87329 from windmilleng/nicks/informer-error-handling
cache: add error handling to informers

Kubernetes-commit: 7c6473b7c901732d6e09b2bfed0e8d423b7bf1d9
2020-04-04 18:17:38 +00:00
Kubernetes Publisher
8e91b7aa91 Merge pull request #87821 from tedyu/cfg-map-update
Check Annotations map against nil for ConfigMapLock#Update()

Kubernetes-commit: 1cf634d24c0f8eefb7259519f9bec2bea40dafd9
2020-04-04 06:21:33 +00:00
Ted Yu
1ff0856e81 Check Annotations map against nil for ConfigMapLock#Update()
Signed-off-by: Ted Yu <yuzhihong@gmail.com>

Kubernetes-commit: 086d6ae9bbbe95e0740e7dd44fa08c31409f8bec
2020-04-03 16:47:19 -07:00
Kubernetes Publisher
7039b495eb Merge pull request #89704 from liggitt/gnostic
github.com/googleapis/gnostic v0.4.1

Kubernetes-commit: d911254debefb5b630498aa3552899ee2f99f22e
2020-04-03 22:05:20 +00:00
Jordan Liggitt
65865ed084 k8s.io/kube-openapi v0.0.0-20200403204345-e1beb1bd0f35
fix client-side validation to allow a value of 0 for a number field

Kubernetes-commit: 8b9165839f1f592262c6ac657649b0acff66d1e4
2020-04-03 14:10:50 -04:00
Kubernetes Publisher
cb664d40f8 Merge pull request #89566 from yue9944882/feat/override-clientside-retry
Opt-out/Override client-side max-retry

Kubernetes-commit: 691fa9f5a1f25763ad2adf033d0d4d45f8acd849
2020-04-02 22:05:54 +00:00
Kubernetes Publisher
5934c03f9a Merge pull request #89706 from weinong/fix-excessive-spn-prefix
v1.18.1: fix a bug where spn: prefix is unexpectedly added to kubeconfig apiserver-id

Kubernetes-commit: f2e3981aba52fd0b9ededcc17affb0c37c648caa
2020-04-02 06:05:39 +00:00
Jordan Liggitt
cd3db5b5a1 Adjust openapi test to avoid mutation on write
Kubernetes-commit: ee816114b7ae044f23b4776fdf0c3f04e2ce13e3
2020-03-31 19:14:19 -04:00
Weinong Wang
de57c8c011 fix a bug where spn: prefix is unexpectedly added to kubeconfig apiserver-id setting
Kubernetes-commit: 77bd7c8a8b29dced5a06c232485ab6de1306c087
2020-03-31 15:59:37 -07:00
Jordan Liggitt
d847b4c964 github.com/googleapis/gnostic v0.4.1
Kubernetes-commit: 93c7b24562d80959f45c308e7412456a410b9b25
2020-03-31 17:18:56 -04:00
Kubernetes Publisher
ed67da3a23 Merge pull request #89575 from tnqn/improve-tracker
Improve fake clientset performance

Kubernetes-commit: c968317ebd83c97e6151ffa1035f14dda51fc733
2020-03-30 18:05:19 +00:00
Jordan Liggitt
33c1f9f2a4 Fix client watch reestablishment handling of client-side timeouts
Kubernetes-commit: 343c1e7636fe5c75cdd378c0b170b26935806de5
2020-03-30 10:36:01 -04:00
Quan Tian
faf5681d1c Improve fake clientset performance
The fake clientset used a slice to store each kind of objects, it's
quite slow to init the clientset with massive objects because it checked
existence of an object by traversing all objects before adding it, which
leads to O(n^2) time complexity. Also, the Create, Update, Get, Delete
methods needs to traverse all objects, which affects the time statistic
of code that calls them.

This patch changed to use a map to store each kind of objects, reduced
the time complexity of initializing clientset to O(n) and the Create,
Update, Get, Delete to O(1).

For example:
Before this patch, it took ~29s to init a clientset with 30000 Pods,
and 2~4ms to create and get an Pod.
After this patch, it took ~50ms to init a clientset with 30000 Pods,
and tens of µs to create and get an Pod.

Kubernetes-commit: 7e15e31e11e48a6db855e30ca9b07dbce3047577
2020-03-27 18:39:20 +08:00
yue9944882
3e9d5317f0 make client-side max-retry override'ble
Kubernetes-commit: f373697c64e9dc5a6618e1d360ad9a51bc8b79c7
2020-03-27 16:15:46 +08:00
Kubernetes Publisher
6240434e1a Merge pull request #86975 from dims/update-hcsshim-v0.8.7-and-containerd-v1.3.2
Update to latest cadvisor and containerd (v1.3.3)

Kubernetes-commit: 4ad32682f3605f8eb0c152e3139a42d756106831
2020-03-26 02:04:46 +00:00
Davanum Srinivas
2247a44b6b Updating dependency golang.org/x/xerrors to version v0.0.0-20191204190536-9bdfabe68543
Kubernetes-commit: d2755395517411cfcda6dee9c749a15e4aef5b3f
2020-03-24 13:44:55 -04:00
Davanum Srinivas
eac0268b4e Updating dependency golang.org/x/time to version v0.0.0-20191024005414-555d28b269f0
Kubernetes-commit: 2b8b3b4008bbf072d216049c48ba792f023d2de8
2020-03-24 13:43:14 -04:00
Davanum Srinivas
48f05c2db1 Updating dependency golang.org/x/net to version v0.0.0-20200202094626-16171245cfb2
Kubernetes-commit: 75ceb7baa8f0df1c5cbaf02211c1a74e2addf498
2020-03-24 13:41:31 -04:00
Davanum Srinivas
60f8ad838a Updating dependency gopkg.in/check.v1 to version v1.0.0-20190902080502-41f04d3bba15
Kubernetes-commit: 9e91a7ddc1a8f90bccff134b77e043809d07f65c
2020-03-24 13:39:41 -04:00
Davanum Srinivas
9f2520a6ff Updating dependency google.golang.org/genproto to version v0.0.0-20191230161307-f3c370f40bfb
Kubernetes-commit: 7555985346c48b20d2b6662ebbce93827b513be2
2020-03-24 13:37:58 -04:00
Davanum Srinivas
afa8f1e8ea Updating dependency github.com/kr/pretty to version v0.2.0
Kubernetes-commit: 54967fe39367c1ada4c9c4b5c2146263f85a41e4
2020-03-24 13:24:29 -04:00
Davanum Srinivas
f71098ae3d Updating dependency github.com/google/go-cmp to version v0.4.0
Kubernetes-commit: 0dd6bf625814ab6ef9f93fbee40cde6d6206d932
2020-03-24 13:19:44 -04:00
Davanum Srinivas
4235d261af Update cadvisor and containerd
Kubernetes-commit: 4274ea2c89dee24e4c188a71e8164b2a40d1e181
2020-03-24 13:11:42 -04:00
Kubernetes Publisher
6cdba17191 Merge pull request #89348 from fatedier/workqueue
Export new constructor for DelayingQueue

Kubernetes-commit: 348152583c699fd8e7b3f67038418423d009f5e4
2020-03-25 12:26:21 +00:00
Kubernetes Publisher
c20e80a28e Merge pull request #89444 from gnufied/update-utils-dep
bump k8s.io/utils package

Kubernetes-commit: 044a4ce21de7e89308be6cedc59fbf1cbb6b30b9
2020-03-25 04:33:32 +00:00
Kubernetes Publisher
80b546a37f Merge pull request #89339 from alvaroaleman/lister-clarify-read-only
Lister codegen: Clarify that returned objects are read-only

Kubernetes-commit: 0c9ba6b5d7c4c91e1edfdb230574b99ebc5d1027
2020-03-25 00:26:57 +00:00
Kubernetes Publisher
3a9f765d91 Merge pull request #89070 from alculquicondor/static-partitioning
Add chunk size option to ParallelizeUntil

Kubernetes-commit: f898f45b2081854e1ebe31a32755c9d9aa4cd16e
2020-03-25 00:26:56 +00:00
Kubernetes Publisher
615fa027f2 Merge pull request #86481 from tdihp/feature/aad-fallback-real-auth
aad fallback to real auth if refresh token fails, fixes #82776

Kubernetes-commit: e7852bff43b358bcce7c77a352e171eca200c005
2020-03-25 00:26:55 +00:00
Hemant Kumar
ea7facdb8f bump k8s.io/utils package
This fixes bug with xfs mount failing because of xfs_repair
being called. Fixes https://github.com/kubernetes/utils/issues/141

Kubernetes-commit: a1ae67d691d514d859fce68299d7bd3830686b38
2020-03-24 17:21:19 -04:00
Kubernetes Publisher
70eb484951 Merge pull request #89341 from aojea/bumputils
bump k8s.io utils

Kubernetes-commit: 6273449fe06574b3b192b92fe487ddfbd16837af
2020-03-23 04:29:02 +00:00
fatedier
1ded602dc0 Export new constructor for DelayingQueue
Kubernetes-commit: b5d989a6fc78fd8d1743eb2b80b9be4cb6e3c6ac
2020-03-23 12:15:29 +08:00
Antonio Ojea
15241c5847 bump k8s.io utils
Fix a bug in k8s.io/utils/net.GetIndexedIP() that wasn't working
with IPv6 addresses with leading zeros.

Kubernetes-commit: dc025534afb0c3106b3aab166f88b971102135d1
2020-03-22 22:21:47 +01:00
Alvaro Aleman
0382bf0f53 Re-generate all listers
Kubernetes-commit: be370ddebcb3785325385267cbe5bd7b372e6118
2020-03-22 12:43:02 -04:00
Ping He
a6c937f0cd Azure auth fallback to real auth if refresh token fails, refactor and add more tests.
Signed-off-by: Ping He <tdihp@hotmail.com>

Kubernetes-commit: 26c97fa1b40a7939ca26084c819af4794df34406
2020-03-22 17:04:20 +08:00
Kubernetes Publisher
b8fba595e8 Merge pull request #89319 from mboersma/fix-mount-sensitive-windows-master
Update vendored MountSensitive code for Windows

Kubernetes-commit: ca82b3281f426add48421aa54114d8f54f7d4ce5
2020-03-21 16:26:12 +00:00
marosset
2ae858f2d5 Updating vendored files
Kubernetes-commit: e72714933004dd34170a7e70f006f2ddb8e968d0
2020-03-20 21:13:48 +00:00
Kubernetes Publisher
b111a62135 Merge pull request #89161 from MikeSpreitzer/informer-doc-redux
Documented mutation restriction for informer clients

Kubernetes-commit: 77e70e6fd36de3570c204eafdaef26af2befaa13
2020-03-20 04:26:43 +00:00
Kubernetes Publisher
365234d2fc Merge pull request #89159 from dims/move-term-package-to-component-base
Move term package to component base and switch to moby/term

Kubernetes-commit: bd07a408c1f82858fd63164f3b2937fd5f6905ce
2020-03-19 20:26:30 +00:00
Aldo Culquicondor
cc684433cd Add transient dependency to test/e2e/framework/.import-restrictions
Signed-off-by: Aldo Culquicondor <acondor@google.com>

Kubernetes-commit: b01e3dc394304603146f17785e3a3cb31f991497
2020-03-18 14:48:06 -04:00
Mike Spreitzer
d7a772a8de Documented mutation restriction for informer clients
Also brushed up some other informer comments for readability and
nitpicking accuracy.

Kubernetes-commit: c4774de94a80bb7d0f54a8a728ad3e97ad1a07b9
2020-03-16 17:38:14 -04:00
Davanum Srinivas
c00c68282c Updating dependency github.com/google/go-cmp to version v0.3.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 865fd484820bf473ac9aa36466baaca80403fa45
2020-03-16 17:01:25 -04:00
Davanum Srinivas
f1bda3ffd6 update vendor
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: ee4310280669153c8ed733ae05946af65cc817b5
2020-03-16 16:54:33 -04:00
Kubernetes Publisher
364a20b9b1 Merge pull request #76776 from wwitzel3/issue-71714
Add tests for NewFilteredDynamicSharedInformerFactory

Kubernetes-commit: 21d4d13d98219b2d6e04ba7d1a634fbd62f9a256
2020-03-19 08:26:14 +00:00
Kubernetes Publisher
c426e0f36d Merge pull request #89105 from andyzhangx/upgrade-40.2
Upgrade to azure-sdk v40.2.0

Kubernetes-commit: de931d569e005d916f8f146fc27fdac1c713a0ea
2020-03-19 08:26:13 +00:00
Kubernetes Publisher
6251a13f71 Merge pull request #89014 from enj/enj/i/drop_openstack_cred_plugin
client-go: remove openstack auth plugin

Kubernetes-commit: 05134da9b7b90f35fe716d156d823778db16f634
2020-03-19 08:26:12 +00:00
Kubernetes Publisher
2b32f6d215 Merge pull request #88985 from brianpursley/kubectl-667
Changed kubectl config view to redact user token

Kubernetes-commit: 4bc907f3c956ffb808fdcfb4f8fc07825b8d2339
2020-03-18 20:26:04 +00:00
Kubernetes Publisher
da706024f3 Merge pull request #88846 from mborsz/revert-88261-rate
Revert "Implement ItemBucketRateLimiter"

Kubernetes-commit: e7e73f736406449c2395e63a1a2c9ecc40b87caf
2020-03-18 04:26:07 +00:00
Kubernetes Publisher
0d5f18fe08 Merge pull request #82785 from ashish-billore/mydevbranch1
Updated command to start in-cluster deployment

Kubernetes-commit: e6c323ffe85ed058ecd99ca0906c101d2332ff0f
2020-03-18 04:26:06 +00:00
Brian Pursley
d4a54d1ba8 Changed kubectl config view to redact token
Kubernetes-commit: 6fad4ee5e5f5fa6fbf38e88f165b012fa0ae5795
2020-03-17 15:13:50 -04:00
Aldo Culquicondor
7ee24064f0 Use sqrt(n) chunk size in pod affinity and core scheduler
Kubernetes-commit: e902e70d0d9bca1a1c823ce9d04d8fd68e8f3396
2020-03-16 14:12:11 -04:00
Aldo Culquicondor
326ffd9341 Add chunk size option to ParallelizeUntil
Signed-off-by: Aldo Culquicondor <acondor@google.com>

Kubernetes-commit: 36efa035e292480d4b0ccc7a4ffbf9aa579fbf30
2020-03-11 17:13:55 -04:00
andyzhangx
f9d070a72c chore: upgrade to azure-sdk v40.2.0
chore: use autorest v0.9.6

fix go module issue

fix go module error

Kubernetes-commit: da20cc202fe2c5594c578a85730578b2300c78a0
2020-03-11 14:46:29 +00:00
Monis Khan
c3817f4bbd client-go: drop github.com/gophercloud/gophercloud dep
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 7a7bc9bcfb556abd4ec22be634eaca9e3b3a132a
2020-03-10 16:49:30 -04:00
Monis Khan
fe48733009 client-go: remove openstack auth plugin
The openstack auth plugin was deprecated in v1.11 in favor of the
"client-keystone-auth" credential plugin.  This change removes the
plugin in v1.19 (eight releases seems more than sufficient notice).

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 0beb8ea0fef3556474b3a713a2203d4edbbb4fc2
2020-03-10 15:22:47 -04:00
tianhongw
b13839ec75 fix golint errors in staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc
Kubernetes-commit: 50de627302097bd978191625583302ff420417f3
2020-03-07 22:35:10 +08:00
Kubernetes Publisher
5194bac869 Merge pull request #88875 from apelisse/apply-no-op
SSA: Applying same object twice should be a no-op the second time

Kubernetes-commit: 71ad0a90205c12e8ebbe6872db30097026916659
2020-03-07 12:25:16 +00:00
Kubernetes Publisher
2093557392 Merge pull request #88929 from liggitt/expansions
client-go: plumb context to expansions methods

Kubernetes-commit: b30c9a3abad8b2e4189a0d4e731d8728a075a3a8
2020-03-06 20:35:34 -08:00
Jordan Liggitt
fac020784f client-go: add context/options to expansions methods
Kubernetes-commit: 4c034278f4ec022698eb2e8aae3dfcc08abebe89
2020-03-06 16:30:37 -05:00
Kubernetes Publisher
425ea3e5d0 Merge pull request #88910 from liggitt/metadata-context
Metadata client: plumb context

Kubernetes-commit: f52cbea102bb6ba9fe951cbf81e7dd4b48f95d9e
2020-03-07 00:25:27 +00:00
Kubernetes Publisher
b173caf598 Merge pull request #88906 from liggitt/dynamic-delete
Dynamic client: plumb context

Kubernetes-commit: cf4d797b5dddef1b1e06a50ebda8a0738e04b66c
2020-03-07 00:25:26 +00:00
Kubernetes Publisher
7b31ec144a Merge pull request #88599 from julianvmodesto/scale-ctx-opts
Add context and options to scale client

Kubernetes-commit: 179fe40d06bc07b0e6602b203a8fb8e722c4e2a4
2020-03-07 00:25:25 +00:00
Kubernetes Publisher
c0782940c8 Merge pull request #84814 from huffmanca/ga_csi_driver
Moving CSI Driver to GA.

Kubernetes-commit: 61847eab61788fb0543b4cf147773c9da646ed2f
2020-03-06 16:25:22 +00:00
Jordan Liggitt
5883a775b1 client-go metadata: plumb context
Kubernetes-commit: cb4ee9334b744404e670ea2c28a3093a3cd67844
2020-03-06 10:42:18 -05:00
Christian Huffman
686d8407e6 Updated files after rebase
Kubernetes-commit: d0890533a99bcb7f3ee173846863960d15064577
2020-03-06 08:56:59 -05:00
Jordan Liggitt
1faf9e8d03 client-go dynamic context
Kubernetes-commit: 6fa54d715fbc992afb483e71d450d5dbd66990eb
2020-03-06 01:27:11 -05:00
Jordan Liggitt
67a40b9a1a client-go dynamic client: update DeleteOptions callers
Kubernetes-commit: b19dc3a474e840340cb357f5ea9f4e575bad888d
2020-03-06 10:20:40 -05:00
Jordan Liggitt
2c6476911c client-go dynamic client: pass DeleteOptions by value
Kubernetes-commit: 161b7513f73185745f8c17db5a56b7229157f876
2020-03-06 10:20:27 -05:00
Antoine Pelisse
9836cc012a Bump sigs.k8s.io/structured-merge-diff to v3
Kubernetes-commit: df41fd932bef1686b30a1abee477c5009ebabe80
2020-03-05 13:09:50 -08:00
Maciej Borsz
8fbf5159e5 Revert "Implement ItemBucketRateLimiter"
Kubernetes-commit: 01c62f672611024445a846e3cdf60e5e99fb8a1e
2020-03-05 14:35:19 +01:00
Christian Huffman
ef1eac84b2 Moved CSIDriver to GA
Kubernetes-commit: 726af6bd7f2f3d7e0b6b37b476672944f601af41
2020-02-28 15:22:45 -05:00
Kubernetes Publisher
d319f3c8b1 Merge pull request #88708 from mikedanese/deleteopts
Migrate clientset metav1.DeleteOpts to pass-by-value

Kubernetes-commit: 5708511499fe500ae3b4bbd40204cef382f652e8
2020-03-06 08:25:31 +00:00
Kubernetes Publisher
d511753639 Merge pull request #88465 from alvaroaleman/utilerrors-implement-errors-is
Utilerrors.Aggregate: Allow using with errors.Is()

Kubernetes-commit: c812375ed605dafa3a7802fc9e21165031de9034
2020-03-06 04:27:58 +00:00
Kubernetes Publisher
fe49f17efb Merge pull request #87553 from MikeSpreitzer/shared-informer-comments-redux
More refinement of comments and parameter names for informers

Kubernetes-commit: 50c0a698d83f3eb1325b80270471eaf06c4870d2
2020-03-06 04:27:56 +00:00
Kubernetes Publisher
4f9ddd276b Merge pull request #88815 from enj/enj/i/events_same_default_ns
Use the same default namespace across event recorders

Kubernetes-commit: 45ac57fb67a841a21a689745aa812109fee84b8c
2020-03-05 04:25:28 +00:00
Monis Khan
7ba7043ddf Use the same default namespace across event recorders
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 167d6a2c8b00413cb52841ee49dd042bfb7d10c9
2020-03-04 13:49:33 -05:00
Kubernetes Publisher
f12177f0a9 Merge pull request #86173 from soltysh/cli_defaults
stop defaulting kubeconfig to http://localhost:8080

Kubernetes-commit: b5b675491b69b5d48bf112a896bc739e500c7275
2020-03-04 16:25:18 +00:00
Kubernetes Publisher
03ea996864 Merge pull request #88769 from deads2k/SNI
Support TLS Server Name overrides in kubeconfig file

Kubernetes-commit: bd6640a8e003059ee98f84e7378d97f8337c5e0b
2020-03-04 08:25:26 +00:00
Kubernetes Publisher
4824e7e100 Merge pull request #88783 from neolit123/1.18-fix-kubectl-auth-verbosity
client-go: use klog.V(3) for the cert-rotation controller start/stop

Kubernetes-commit: cadd51783bd463b3fdd6c1416e596493a717fe83
2020-03-04 08:25:25 +00:00
Kubernetes Publisher
83e04303df Merge pull request #88684 from saad-ali/updateMountLib
Update AzureFile and CephFS to use MountSensitive

Kubernetes-commit: cd23e78c3dc1a4161abb11523a8614b56b9c0928
2020-03-04 08:25:24 +00:00
Lubomir I. Ivanov
38dc9a8fb0 client-go: use klog.V(3) for the cert-rotation controller start/stop
Introduce a verbosity level for the start and stop notifications,
so that regular calls to commands such as:
  "kubectl auth ..."
would only contain the "yes" / "no" output.

Kubernetes-commit: b2677b1e572ae1cd8b823683e88005b7857d8938
2020-03-04 01:35:17 +02:00
David Eads
32fece0e08 update override behavior for kubectl --tls-server-name
Kubernetes-commit: 9dcbc0bf909a794cf77a801bfd29e306791b1e24
2020-03-03 13:16:50 -05:00
Maciej Szulik
3eda474fce Provide more verbose empty config error based on the context
Kubernetes-commit: 07dc17ffd9aadd9918511334e13b02dc817828a5
2020-03-03 18:42:19 +01:00
Mike Danese
5c80d48932 automated refactor
Kubernetes-commit: c58e69ec791e4dd8a1298d5c2cc0649cf9176f67
2020-03-01 09:24:42 -08:00
Mike Danese
756db0d4aa update clients
Kubernetes-commit: 86bd06c8820a785cb8d74ef29d4a6a80c08988c0
2020-03-01 08:54:33 -08:00
saad-ali
b60e7dd7a7 Update dep k8s.io/utils to 0a110f9eb7ab
Kubernetes-commit: 22e8189f40fc95b18bad2b59ba2ad20ae7c69ea9
2020-02-28 18:22:45 -08:00
Kubernetes Publisher
eb0bad8167 Merge pull request #88760 from munnerz/signername-follow-up
signerName: extend client-go ensureCompatibility and additional unit tests

Kubernetes-commit: 0a2a69add2c914675898bd9018010a03eca8f693
2020-03-03 16:25:32 +00:00
James Munnelly
0c19a3c0da Extend client-go csr package to invalidate CSRs based on signerName
Kubernetes-commit: c2367bd5da68112ad3031dd33933859dacf8db58
2020-03-03 13:14:04 +00:00
Kubernetes Publisher
133860aa50 Merge pull request #88744 from jackkleeman/kubelet-handle-intermed
Support intermediate certificate in certificate store

Kubernetes-commit: 79e1ad2f4bbd05b1e56b7b57b63b2c1d67b90156
2020-03-03 00:25:34 +00:00
Kubernetes Publisher
ec0a5f3fd2 Merge pull request #79083 from jackkleeman/client-cert-file-reload
Add ability to reload client certificates from disk

Kubernetes-commit: 4b1ee392c180233c085ba0a17949bc9197535c11
2020-03-03 00:25:33 +00:00
Jack Kleeman
29bb8bf344 Support intermediate certificate in certificate store
Kubernetes-commit: 83a223f5ee3790b7ed54197986d4317e75da1652
2020-03-02 19:48:38 +00:00
Kubernetes Publisher
ca7edf3d8a Merge pull request #88509 from robscott/ingress-v1beta1-class
Adding IngressClass to networking/v1beta1

Kubernetes-commit: fdb2cb4c8832da1499069bda918c014762d8ac05
2020-03-02 08:25:25 +00:00
Brian Pursley
1ade84933e Fixed bug where jsonpath expression with a nested range does not process subsequent nodes
Kubernetes-commit: 852e661f3dd0f7be9b9b1469316d9947c4b5a5c0
2020-02-27 11:03:27 -05:00
Julian V. Modesto
6776475b71 Add context and options to scale client
Kubernetes-commit: da3c3432d8361f315e7f562563e68316b10b9a2d
2020-02-26 18:39:57 -05:00
Rob Scott
02b6fab671 Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 132d2afca0794b4bcaedb6dbbefe4e9d66e80239
2020-02-24 21:20:45 -08:00
Kubernetes Publisher
bcb30edc8b Merge pull request #88246 from munnerz/csr-signername-controllers
Update CSR controllers & kubelet to respect signerName field

Kubernetes-commit: 03b7f272c8287fdaafa67b82f1c577a96c5a238a
2020-02-29 08:25:06 +00:00
Kubernetes Publisher
dd730ded40 Merge pull request #88134 from jennybuckley/rate-limit-log-2
Improve rate limiter latency logging and add component-base metric

Kubernetes-commit: 650220fa64544c6de308df0d8820896bf0b56194
2020-02-27 16:24:56 +00:00
Alvaro Aleman
6b7675c693 Utilerrors.Aggregate: Allow using with errors.Is()
Kubernetes-commit: 212190e25e18600bbca2eb5c77aa3fe5bcc55af1
2020-02-24 15:15:04 +01:00
James Munnelly
e8be24fd4c certificates: update controllers to understand signerName field
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>

Kubernetes-commit: d5dae048983cd299cdce9d2703f564bf4bd246ee
2020-02-17 23:06:02 +00:00
jennybuckley
2d3138825e Improve rate limiter latency logging and metrics
Kubernetes-commit: 2bcf99f05fdc47fb4bc3601b9134408483f59773
2020-02-13 13:32:12 -08:00
Kubernetes Publisher
f772958f8a Merge pull request #88382 from jpbetz/parallel-mem-client-resource-discovery
Refresh discovery server resources for memCacheClient in parallel

Kubernetes-commit: 62b0bbc1c64f7ca5d3b2a9503158975166af9078
2020-02-22 08:24:11 +00:00
Kubernetes Publisher
5e1786105b Merge pull request #88100 from jiahuif/kubelet-bootstrap-csr-logging
add logging for kubelet csr being approved and issued.

Kubernetes-commit: bf050f9794973694e2cc9c8df2f5e8b354af63f6
2020-02-21 16:31:15 +00:00
Kubernetes Publisher
cb2a050181 Merge pull request #88381 from BenTheElder/CVE-2020-9283
update golang.org/x/crypto to fix CVE-2020-9283

Kubernetes-commit: 056374d9c8b8e43745d8a97f82981f886702cef8
2020-02-21 16:31:14 +00:00
Joe Betz
6720cad255 Refresh discovery server resources for memCacheClient in parallel
Kubernetes-commit: 190a72392ae712fbbee979e95a6017ccb578877d
2020-02-20 13:40:23 -08:00
Benjamin Elder
4dd6cc67e1 update golang.org/x/crypto
Kubernetes-commit: 86ead631585825725e39f9a5e99c169b892a338c
2020-02-20 13:17:51 -08:00
Kubernetes Publisher
6f32816696 Merge pull request #88267 from mfojtik/revert-con-refused-retry
client-go: remove connection refused to list of retriable errors

Kubernetes-commit: f38ca13bc8c6e1d99be33afa2b9d3a3f6fb56ba3
2020-02-21 16:31:13 +00:00
Kubernetes Prow Robot
ba7b52f674 Merge pull request #736 from timyinshi/Drivers
modify the error url of csi drivers
2020-02-19 04:50:25 -08:00
Michal Fojtik
3431a996fa rest: remove connection refused from the list of retriable errors
Kubernetes-commit: 0dfe0c793b5b85bd85cec7b77679ba78c1617357
2020-02-18 14:44:04 +01:00
Jiahui Feng
9d42b5ecf1 add logging for csr being approved and issued.
Kubernetes-commit: fdd7424d191b43bc9b1c4364ddf9c88547883072
2020-02-12 11:09:56 -08:00
Mike Spreitzer
49f8c8f17a More refinement of comments and parameter names for informers
Removed the incorrect promise of coherency in the answer to a query to
an informer's local cache.  Removed the definition of "collection
state", because it was only used in the now-removed promise.  Added a
remark about ordering of states that appear in an informer's local
cache.

Brushed up the commentary on resync period.  Changed the relevant
parameter of NewSharedInformer to have the same name as the
corresponding parameter to NewSharedIndexInformer.

Kubernetes-commit: b8e2ad5926c3a6872422ad25cf9867e10e052a7d
2020-01-26 02:43:33 -05:00
timyinshi
2d0dc91385 modify the error url of csi drivers 2020-01-21 02:01:01 +00:00
Nick Santos
ccd5becdff cache: add error handling to informers
When creating an informer, this adds a way to add custom error handling, so that
Kubernetes tooling can properly surface the errors to the end user.

Fixes https://github.com/kubernetes/client-go/issues/155

Kubernetes-commit: 435b40aa1e5c0ae44e0aeb9aa6dbde79838b3390
2020-01-17 12:46:08 -05:00
ashish-billore
b284cb9910 Updated command to start in-cluster deployment
Updated the --image-pull-policy=Never option with default
'IfNotPresent'. 'Never' causes the pod to be in
state: ErrImageNeverPull

Kubernetes-commit: 7400cf937b9fcc31dc29caa8d90800940602b934
2019-09-17 19:58:02 +09:00
Suresh Kumar Ponnusamy
6a6b2af8ea Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
Wayne Witzel III
4562e6a9dd add tests for NewFilteredDynamicSharedInformerFactory namespace
Signed-off-by: Wayne Witzel III <witzelw@vmware.com>

Kubernetes-commit: 2064d90e92430f96e440cfc4fc03a69b4243bc6c
2019-06-20 13:04:36 -04:00
Jack Kleeman
a493c8da9a Add ReloadCertFromDisk flag to rest.Config and to kubeconfig which allows the provided client certificate files to be reloaded from disk (currently on every use)
Close outbound connections when using a cert callback and certificates rotate. This means that we won't get into a situation where we have open TLS connections using expires certs, which would get unauthorized errors at the apiserver

Attempt to retrieve a new certificate if open connections near expiry, to prevent the case where the cert expires but we haven't yet opened a new TLS connection and so GetClientCertificate hasn't been called.

Move certificate rotation logic to a separate function

Rely on generic transport approach to handle closing TLS client connections in exec plugin; no need to use a custom dialer as this is now the default behaviour of the transport when faced with a cert callback. As a result of handling this case, it is now safe to apply the transport approach even in cases where there is a custom Dialer (this will not affect kubelet connrotation behaviour, because that uses a custom transport, not just a dialer).

Check expiry of the full TLS certificate chain that will be presented, not only the leaf. Only do this check when the certificate actually rotates. Start the certificate as a zero value, not nil, so that we don't see a rotation when there is in fact no client certificate

Drain the timer when we first initialize it, to prevent immediate rotation. Additionally, calling Stop() on the timer isn't necessary.

Don't close connections on the first 'rotation'

Remove RotateCertFromDisk and RotateClientCertFromDisk flags.

Instead simply default to rotating certificates from disk whenever files are exclusively provided.

Add integration test for client certificate rotation

Simplify logic; rotate every 5 mins

Instead of trying to be clever and checking for rotation just before an
expiry, let's match the logic of the new apiserver cert rotation logic
as much as possible. We write a controller that checks for rotation
every 5 mins. We also check on every new connection.

Respond to review

Fix kubelet certificate rotation logic

The kubelet rotation logic seems to be broken because it expects its
cert files to end up as cert data whereas in fact they end up as a
callback. We should just call the tlsConfig GetCertificate callback
as this obtains a current cert even in cases where a static cert is
provided, and check that for validity.

Later on we can refactor all of the kubelet logic so that all it does is
write files to disk, and the cert rotation work does the rest.

Only read certificates once a second at most

Respond to review

1) Don't blat the cert file names
2) Make it more obvious where we have a neverstop
3) Naming
4) Verbosity

Avoid cache busting

Use filenames as cache keys when rotation is enabled, and add the
rotation later in the creation of the transport.

Caller should start the rotating dialer

Add continuous request rotation test

Rebase: use context in List/Watch

Swap goroutine around

Retry GETs on net.IsProbableEOF

Refactor certRotatingDialer

For simplicity, don't affect cert callbacks

To reduce change surface, lets not try to handle the case of a changing
GetCert callback in this PR. Reverting this commit should be sufficient
to handle that case in a later PR.

This PR will focus only on rotating certificate and key files.
Therefore, we don't need to modify the exec auth plugin.

Fix copyright year

Kubernetes-commit: 929b1559a0b855d996257ab3ad5364605edc253d
2019-06-14 22:08:58 +01:00
Mike Danese
0caa50056a rest.Config: support configuring an explict proxy URL
With support of http, https, and socks5 proxy support. We already
support configuring this via environmnet variables, but this approach
becomes inconvenient dealing with multiple clusters on different
networks, that require different proxies to connect to. Most solutions
require wrapping clients (like kubectl) in bash scripts.

Part of: https://github.com/kubernetes/client-go/issues/351

Kubernetes-commit: f3f666d5f1f6f74a8c948a5c64af993696178244
2019-05-03 13:50:17 -07:00
David Eads
72322d0c6d stop defaulting kubeconfig to http://localhost:8080
Kubernetes-commit: b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee
2018-04-12 09:42:25 -04:00
2632 changed files with 276863 additions and 75379 deletions

View File

@@ -1,3 +1,2 @@
Sorry, we do not accept changes directly against this repository, unless the
change is to the `README.md` itself. Please see
Sorry, we do not accept changes directly against this repository. Please see
`CONTRIBUTING.md` for information on where and how to contribute instead.

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.

View File

@@ -222,7 +222,7 @@ The VolumeScheduling beta feature gate is still required for this feature.
([#67432](https://github.com/kubernetes/kubernetes/pull/67432))
* The CSI file system type is no longer defaulted to ext4.
All the production drivers listed under https://kubernetes-csi.github.io/docs/Drivers.html
All the production drivers listed under https://kubernetes-csi.github.io/docs/drivers.html
were inspected and should not be impacted after this change.
If you are using a driver not in that list,
please test the drivers on an updated test cluster first.

382
Godeps/Godeps.json generated
View File

@@ -1,382 +0,0 @@
{
"ImportPath": "k8s.io/client-go",
"GoVersion": "unknown",
"GodepVersion": "gen-godeps",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "cloud.google.com/go",
"Rev": "v0.38.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/autorest",
"Rev": "v0.9.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/autorest/adal",
"Rev": "v0.5.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/autorest/date",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/autorest/mocks",
"Rev": "v0.2.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/logger",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/Azure/go-autorest/tracing",
"Rev": "v0.5.0"
},
{
"ImportPath": "github.com/BurntSushi/toml",
"Rev": "v0.3.1"
},
{
"ImportPath": "github.com/NYTimes/gziphandler",
"Rev": "56545f4a5d46"
},
{
"ImportPath": "github.com/PuerkitoBio/purell",
"Rev": "v1.0.0"
},
{
"ImportPath": "github.com/PuerkitoBio/urlesc",
"Rev": "5bd2802263f2"
},
{
"ImportPath": "github.com/client9/misspell",
"Rev": "v0.3.4"
},
{
"ImportPath": "github.com/davecgh/go-spew",
"Rev": "v1.1.1"
},
{
"ImportPath": "github.com/dgrijalva/jwt-go",
"Rev": "v3.2.0"
},
{
"ImportPath": "github.com/docker/spdystream",
"Rev": "449fdfce4d96"
},
{
"ImportPath": "github.com/elazarl/goproxy",
"Rev": "947c36da3153"
},
{
"ImportPath": "github.com/emicklei/go-restful",
"Rev": "ff4f55a20633"
},
{
"ImportPath": "github.com/evanphx/json-patch",
"Rev": "v4.2.0"
},
{
"ImportPath": "github.com/fsnotify/fsnotify",
"Rev": "v1.4.7"
},
{
"ImportPath": "github.com/ghodss/yaml",
"Rev": "73d445a93680"
},
{
"ImportPath": "github.com/go-logr/logr",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/go-openapi/jsonpointer",
"Rev": "46af16f9f7b1"
},
{
"ImportPath": "github.com/go-openapi/jsonreference",
"Rev": "13c6e3589ad9"
},
{
"ImportPath": "github.com/go-openapi/spec",
"Rev": "6aced65f8501"
},
{
"ImportPath": "github.com/go-openapi/swag",
"Rev": "1d0bd113de87"
},
{
"ImportPath": "github.com/gogo/protobuf",
"Rev": "v1.3.1"
},
{
"ImportPath": "github.com/golang/glog",
"Rev": "23def4e6c14b"
},
{
"ImportPath": "github.com/golang/groupcache",
"Rev": "02826c3e7903"
},
{
"ImportPath": "github.com/golang/mock",
"Rev": "v1.2.0"
},
{
"ImportPath": "github.com/golang/protobuf",
"Rev": "v1.3.2"
},
{
"ImportPath": "github.com/google/btree",
"Rev": "v1.0.0"
},
{
"ImportPath": "github.com/google/go-cmp",
"Rev": "v0.3.0"
},
{
"ImportPath": "github.com/google/gofuzz",
"Rev": "v1.1.0"
},
{
"ImportPath": "github.com/google/martian",
"Rev": "v2.1.0"
},
{
"ImportPath": "github.com/google/pprof",
"Rev": "3ea8567a2e57"
},
{
"ImportPath": "github.com/google/uuid",
"Rev": "v1.1.1"
},
{
"ImportPath": "github.com/googleapis/gax-go/v2",
"Rev": "v2.0.4"
},
{
"ImportPath": "github.com/googleapis/gnostic",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/gophercloud/gophercloud",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/gregjones/httpcache",
"Rev": "9cad4c3443a7"
},
{
"ImportPath": "github.com/hashicorp/golang-lru",
"Rev": "v0.5.1"
},
{
"ImportPath": "github.com/hpcloud/tail",
"Rev": "v1.0.0"
},
{
"ImportPath": "github.com/imdario/mergo",
"Rev": "v0.3.5"
},
{
"ImportPath": "github.com/json-iterator/go",
"Rev": "v1.1.8"
},
{
"ImportPath": "github.com/jstemmer/go-junit-report",
"Rev": "af01ea7f8024"
},
{
"ImportPath": "github.com/kisielk/errcheck",
"Rev": "v1.2.0"
},
{
"ImportPath": "github.com/kisielk/gotool",
"Rev": "v1.0.0"
},
{
"ImportPath": "github.com/kr/pretty",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/kr/pty",
"Rev": "v1.1.1"
},
{
"ImportPath": "github.com/kr/text",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/mailru/easyjson",
"Rev": "d5b7844b561a"
},
{
"ImportPath": "github.com/modern-go/concurrent",
"Rev": "bacd9c7ef1dd"
},
{
"ImportPath": "github.com/modern-go/reflect2",
"Rev": "v1.0.1"
},
{
"ImportPath": "github.com/munnerz/goautoneg",
"Rev": "a547fc61f48d"
},
{
"ImportPath": "github.com/mxk/go-flowrate",
"Rev": "cca7078d478f"
},
{
"ImportPath": "github.com/onsi/ginkgo",
"Rev": "v1.11.0"
},
{
"ImportPath": "github.com/onsi/gomega",
"Rev": "v1.7.0"
},
{
"ImportPath": "github.com/peterbourgon/diskv",
"Rev": "v2.0.1"
},
{
"ImportPath": "github.com/pmezard/go-difflib",
"Rev": "v1.0.0"
},
{
"ImportPath": "github.com/spf13/afero",
"Rev": "v1.2.2"
},
{
"ImportPath": "github.com/spf13/pflag",
"Rev": "v1.0.5"
},
{
"ImportPath": "github.com/stretchr/objx",
"Rev": "v0.1.0"
},
{
"ImportPath": "github.com/stretchr/testify",
"Rev": "v1.4.0"
},
{
"ImportPath": "go.opencensus.io",
"Rev": "v0.21.0"
},
{
"ImportPath": "golang.org/x/crypto",
"Rev": "60c769a6c586"
},
{
"ImportPath": "golang.org/x/exp",
"Rev": "509febef88a4"
},
{
"ImportPath": "golang.org/x/lint",
"Rev": "5614ed5bae6f"
},
{
"ImportPath": "golang.org/x/net",
"Rev": "13f9640d40b9"
},
{
"ImportPath": "golang.org/x/oauth2",
"Rev": "0f29369cfe45"
},
{
"ImportPath": "golang.org/x/sync",
"Rev": "112230192c58"
},
{
"ImportPath": "golang.org/x/sys",
"Rev": "fde4db37ae7a"
},
{
"ImportPath": "golang.org/x/text",
"Rev": "v0.3.2"
},
{
"ImportPath": "golang.org/x/time",
"Rev": "9d24e82272b4"
},
{
"ImportPath": "golang.org/x/tools",
"Rev": "65e3620a7ae7"
},
{
"ImportPath": "golang.org/x/xerrors",
"Rev": "a985d3407aa7"
},
{
"ImportPath": "google.golang.org/api",
"Rev": "v0.4.0"
},
{
"ImportPath": "google.golang.org/appengine",
"Rev": "v1.5.0"
},
{
"ImportPath": "google.golang.org/genproto",
"Rev": "e7d98fc518a7"
},
{
"ImportPath": "google.golang.org/grpc",
"Rev": "v1.19.0"
},
{
"ImportPath": "gopkg.in/check.v1",
"Rev": "788fd7840127"
},
{
"ImportPath": "gopkg.in/fsnotify.v1",
"Rev": "v1.4.7"
},
{
"ImportPath": "gopkg.in/inf.v0",
"Rev": "v0.9.1"
},
{
"ImportPath": "gopkg.in/tomb.v1",
"Rev": "dd632973f1e7"
},
{
"ImportPath": "gopkg.in/yaml.v2",
"Rev": "v2.2.8"
},
{
"ImportPath": "honnef.co/go/tools",
"Rev": "3f1c8253044a"
},
{
"ImportPath": "k8s.io/api",
"Rev": "026463abc787"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "2373d029717c"
},
{
"ImportPath": "k8s.io/gengo",
"Rev": "0689ccc1d7d6"
},
{
"ImportPath": "k8s.io/klog",
"Rev": "v1.0.0"
},
{
"ImportPath": "k8s.io/kube-openapi",
"Rev": "bf4fb3bd569c"
},
{
"ImportPath": "k8s.io/utils",
"Rev": "5f6fbceb4c31"
},
{
"ImportPath": "sigs.k8s.io/structured-merge-diff/v3",
"Rev": "5e70324e7c1c"
},
{
"ImportPath": "sigs.k8s.io/yaml",
"Rev": "v1.2.0"
}
]
}

5
Godeps/Readme generated
View File

@@ -1,5 +0,0 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.

View File

@@ -1,13 +1,11 @@
# Installing client-go
## For the casual user
## Using the latest version
If you want to write a simple script, don't care about a reproducible client
library install, don't mind getting HEAD (which may be less stable than a
particular release), then simply:
If you want to use the latest version of this library, use go1.16+ and run:
```sh
go get k8s.io/client-go@master
go get k8s.io/client-go@latest
```
This will record a dependency on `k8s.io/client-go` in your go module.
@@ -17,27 +15,72 @@ The next time you `go build`, `go test`, or `go run` your project,
and detailed dependency version info will be added to your `go.mod` file
(or you can also run `go mod tidy` to do this directly).
This assumes you are using go modules with go 1.11+.
## Using a specific version
If you want to use a particular version of the `k8s.io/client-go` library,
you can indicate which version of `client-go` your project requires:
- If you are using Kubernetes versions >= `v1.17.0`, use a corresponding `v0.x.y` tag.
For example, `k8s.io/client-go@v0.20.4` corresponds to Kubernetes `v1.20.4`:
```sh
go get k8s.io/client-go@v0.20.4
```
- If you are using Kubernetes versions < `v1.17.0`, use a corresponding `kubernetes-1.x.y` tag.
For example, `k8s.io/client-go@kubernetes-1.16.3` corresponds to Kubernetes `v1.16.3`:
```sh
go get k8s.io/client-go@kubernetes-1.16.3
```
You can now import and use the `k8s.io/client-go` APIs in your project.
The next time you `go build`, `go test`, or `go run` your project,
`k8s.io/client-go` and its dependencies will be downloaded (if needed),
and detailed dependency version info will be added to your `go.mod` file
(or you can also run `go mod tidy` to do this directly).
## Troubleshooting
### Go versions prior to 1.16
If you get a message like
`module k8s.io/client-go@latest found (v1.5.2), but does not contain package k8s.io/client-go/...`,
you are likely using a go version prior to 1.16 and must explicitly specify the k8s.io/client-go version you want.
For example:
```sh
go get k8s.io/client-go@v0.20.4
```
### Conflicting requirements for older client-go versions
If you get a message like
`module k8s.io/api@latest found, but does not contain package k8s.io/api/auditregistration/v1alpha1`,
something in your build is likely requiring an old version of `k8s.io/client-go` like `v11.0.0+incompatible`.
First, try to fetch a more recent version. For example:
```sh
go get k8s.io/client-go@v0.20.4
```
If that doesn't resolve the problem, see what is requiring an `...+incompatible` version of client-go,
and update to use a newer version of that library, if possible:
```sh
go mod graph | grep " k8s.io/client-go@"
```
As a last resort, you can force the build to use a specific version of client-go,
even if some of your dependencies still want `...+incompatible` versions. For example:
```sh
go mod edit -replace=k8s.io/client-go=k8s.io/client-go@v0.20.4
go get k8s.io/client-go@v0.20.4
```
### Go modules disabled
If you get a message like `cannot use path@version syntax in GOPATH mode`,
see the instructions for [enabling go modules](#enabling-go-modules).
## Dependency management for the serious (or reluctant) user
Reasons why you might need to use a dependency management system:
* You use a dependency that client-go also uses, and don't want two copies of
the dependency compiled into your application. For some dependencies with
singletons or global inits (e.g. `glog`) this wouldn't even compile...
* You want to lock in a particular version (so you don't have to change your
code every time we change a public interface).
* You want your install to be reproducible. For example, for your CI system or
for new team members.
### Enabling go modules
Dependency management tools are built into go 1.11+ in the form of [go modules](https://github.com/golang/go/wiki/Modules).
These are used by the main Kubernetes repo (>= `v1.15.0`) and `client-go` (>= `kubernetes-1.15.0`) to manage dependencies.
If you are using go 1.11 or 1.12 and are working with a project located within `$GOPATH`,
you must opt into using go modules:
you likely do not have go modules enabled. This should be on by default in all
supported versions of Go.
```sh
export GO111MODULE=on
@@ -49,33 +92,3 @@ If you do not already have one, `go mod init` will create one for you:
```sh
go mod init
```
### Add client-go as a dependency
Indicate which version of `client-go` your project requires:
- If you are using Kubernetes versions >= `v1.17.0`, use a corresponding
`v0.x.y` tag. For example, `k8s.io/client-go@v0.17.0` corresponds to Kubernetes `v1.17.0`:
```sh
go get k8s.io/client-go@v0.17.0
```
You can also use a non-semver `kubernetes-1.x.y` tag to refer to a version
of `client-go` corresponding to a given Kubernetes release. Prior to Kubernetes
`v1.17.0` these were the only tags available for use with go modules.
For example, `kubernetes-1.16.3` corresponds to Kubernetes `v1.16.3`.
However, it is recommended to use semver-like `v0.x.y` tags over non-semver
`kubernetes-1.x.y` tags to have a seamless experience with go modules.
- If you are using Kubernetes versions < `v1.17.0` (replace `kubernetes-1.16.3` with the desired version):
```sh
go get k8s.io/client-go@kubernetes-1.16.3
```
You can now import and use the `k8s.io/client-go` APIs in your project.
The next time you `go build`, `go test`, or `go run` your project,
`k8s.io/client-go` and its dependencies will be downloaded (if needed),
and detailed dependency version info will be added to your `go.mod` file
(or you can also run `go mod tidy` to do this directly).

37
OWNERS
View File

@@ -1,19 +1,28 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- caesarxuchao
- deads2k
- lavalamp
- liggitt
- smarterclayton
- sttts
- aojea
- caesarxuchao
- deads2k
- liggitt
- smarterclayton
- sttts
- yliaog
- jpbetz
reviewers:
- caesarxuchao
- deads2k
- lavalamp
- liggitt
- soltysh
- sttts
- yliaog
- aojea
- apelisse
- caesarxuchao
- deads2k
- jpbetz
- liggitt
- skitt
- soltysh
- sttts
- yliaog
- jpbetz
- jefftree
labels:
- sig/api-machinery
- sig/api-machinery
emeritus_approvers:
- lavalamp

View File

@@ -1,22 +1,20 @@
> ⚠️ **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.
We recommend using the `v0.x.y` tags for Kubernetes releases >= `v1.17.0` and
`kubernetes-1.x.y` tags for Kubernetes releases < `v1.17.0`.
See [INSTALL.md](/INSTALL.md) for detailed installation instructions.
`go get k8s.io/client-go@master` works, but will fetch `master`, which may be less stable than a tagged release.
[![BuildStatus Widget]][BuildStatus Result]
[![GoReport Widget]][GoReport Status]
The fastest way to add this library to a project is to run `go get k8s.io/client-go@latest` with go1.16+.
See [INSTALL.md](/INSTALL.md) for detailed installation instructions and troubleshooting.
[![GoDocWidget]][GoDocReference]
[BuildStatus Result]: https://travis-ci.org/kubernetes/client-go
[BuildStatus Widget]: https://travis-ci.org/kubernetes/client-go.svg?branch=master
[GoReport Status]: https://goreportcard.com/report/github.com/kubernetes/client-go
[GoReport Widget]: https://goreportcard.com/badge/github.com/kubernetes/client-go
[GoDocWidget]: https://godoc.org/k8s.io/client-go?status.svg
[GoDocReference]:https://godoc.org/k8s.io/client-go
@@ -82,12 +80,15 @@ We will backport bugfixes--but not new features--into older versions of
#### Compatibility matrix
| | Kubernetes 1.15 | Kubernetes 1.16 | Kubernetes 1.17 |
|-------------------------------|-----------------|-----------------|-----------------|
| `kubernetes-1.15.0` | ✓ | +- | +- |
| `kubernetes-1.16.0` | +- | | +- |
| `kubernetes-1.17.0`/`v0.17.0` | +- | +- | ✓ |
| `HEAD` | +- | +- | +- |
| | Kubernetes 1.29 | Kubernetes 1.30 | Kubernetes 1.31 | Kubernetes 1.32 | Kubernetes 1.33 | Kubernetes 1.34 |
| ----------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
| `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:
@@ -106,24 +107,19 @@ Key:
See the [CHANGELOG](./CHANGELOG.md) for a detailed description of changes
between client-go versions.
| Branch | Canonical source code location | Maintenance status |
|----------------|--------------------------------------|-------------------------------|
| `release-1.4` | Kubernetes main repo, 1.4 branch | = - |
| `release-1.5` | Kubernetes main repo, 1.5 branch | = - |
| `release-2.0` | Kubernetes main repo, 1.5 branch | = - |
| `release-3.0` | Kubernetes main repo, 1.6 branch | = - |
| `release-4.0` | Kubernetes main repo, 1.7 branch | = - |
| `release-5.0` | Kubernetes main repo, 1.8 branch | = - |
| `release-6.0` | Kubernetes main repo, 1.9 branch | = - |
| `release-7.0` | Kubernetes main repo, 1.10 branch | = - |
| `release-8.0` | Kubernetes main repo, 1.11 branch | =- |
| `release-9.0` | Kubernetes main repo, 1.12 branch | =- |
| `release-10.0` | Kubernetes main repo, 1.13 branch | =- |
| `release-11.0` | Kubernetes main repo, 1.14 branch | ✓ |
| `release-12.0` | Kubernetes main repo, 1.15 branch | ✓ |
| `release-13.0` | Kubernetes main repo, 1.16 branch | ✓ |
| `release-14.0` | Kubernetes main repo, 1.17 branch | ✓ |
| client-go HEAD | Kubernetes main repo, master branch | ✓ |
| Branch | Canonical source code location | Maintenance status |
| -------------- | ----------------------------------- | ------------------ |
| `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.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:
@@ -169,13 +165,19 @@ you care about backwards compatibility.
### How to get it
Use go1.11+ and fetch the desired version using the `go get` command. For example:
To get the latest version, use go1.16+ and fetch using the `go get` command. For example:
```
go get k8s.io/client-go@v0.17.0
go get k8s.io/client-go@latest
```
See [INSTALL.md](/INSTALL.md) for detailed instructions.
To get a specific version, use go1.11+ and fetch the desired version using the `go get` command. For example:
```
go get k8s.io/client-go@v0.20.4
```
See [INSTALL.md](/INSTALL.md) for detailed instructions and troubleshooting.
### How to use it

View File

@@ -10,8 +10,7 @@
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://kubernetes.io/security/
cjcullen
joelsmith
liggitt
philips
tallclair
caesarxuchao
deads2k
lavalamp
sttts

View File

@@ -1,7 +1,6 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- ericchiang
reviewers:
- ericchiang
- rithujohn191
- apelisse
- jpbetz
- api-approvers

View File

@@ -0,0 +1,80 @@
/*
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
// 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 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"`
}
// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with
// apply.
func AuditAnnotation() *AuditAnnotationApplyConfiguration {
return &AuditAnnotationApplyConfiguration{}
}
// WithKey sets the Key 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 Key field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration {
b.Key = &value
return b
}
// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration {
b.ValueExpression = &value
return b
}

View File

@@ -0,0 +1,56 @@
/*
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
// 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 {
// The path to the field that refers 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"`
// 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
// apply.
func ExpressionWarning() *ExpressionWarningApplyConfiguration {
return &ExpressionWarningApplyConfiguration{}
}
// WithFieldRef sets the FieldRef 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 FieldRef field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration {
b.FieldRef = &value
return b
}
// WithWarning sets the Warning 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 Warning field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration {
b.Warning = &value
return b
}

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
// 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 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"`
}
// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with
// apply.
func MatchCondition() *MatchConditionApplyConfiguration {
return &MatchConditionApplyConfiguration{}
}
// 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 *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration {
b.Name = &value
return b
}
// 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 *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -0,0 +1,166 @@
/*
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"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 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 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
// apply.
func MatchResources() *MatchResourcesApplyConfiguration {
return &MatchResourcesApplyConfiguration{}
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithResourceRules adds the given value to the ResourceRules 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 ResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResourceRules")
}
b.ResourceRules = append(b.ResourceRules, *values[i])
}
return b
}
// WithExcludeResourceRules adds the given value to the ExcludeResourceRules 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 ExcludeResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExcludeResourceRules")
}
b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i])
}
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1.MatchPolicyType) *MatchResourcesApplyConfiguration {
b.MatchPolicy = &value
return b
}

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"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// 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
// apply.
func MutatingWebhook() *MutatingWebhookApplyConfiguration {
return &MutatingWebhookApplyConfiguration{}
}
// 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 *MutatingWebhookApplyConfiguration) WithName(value string) *MutatingWebhookApplyConfiguration {
b.Name = &value
return b
}
// WithClientConfig sets the ClientConfig 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 ClientConfig field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.ClientConfig = value
return b
}
// WithRules adds the given value to the Rules 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 Rules field.
func (b *MutatingWebhookApplyConfiguration) WithRules(values ...*RuleWithOperationsApplyConfiguration) *MutatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithRules")
}
b.Rules = append(b.Rules, *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 *MutatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *MutatingWebhookApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1.MatchPolicyType) *MutatingWebhookApplyConfiguration {
b.MatchPolicy = &value
return b
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithSideEffects sets the SideEffects 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 SideEffects field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1.SideEffectClass) *MutatingWebhookApplyConfiguration {
b.SideEffects = &value
return b
}
// WithTimeoutSeconds sets the TimeoutSeconds 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 TimeoutSeconds field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *MutatingWebhookApplyConfiguration {
b.TimeoutSeconds = &value
return b
}
// WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions 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 AdmissionReviewVersions field.
func (b *MutatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *MutatingWebhookApplyConfiguration {
for i := range values {
b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, 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 *MutatingWebhookApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1.ReinvocationPolicyType) *MutatingWebhookApplyConfiguration {
b.ReinvocationPolicy = &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 *MutatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,279 @@
/*
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"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration {
b := &MutatingWebhookConfigurationApplyConfiguration{}
b.WithName(name)
b.WithKind("MutatingWebhookConfiguration")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(mutatingWebhookConfiguration.Name)
b.WithKind("MutatingWebhookConfiguration")
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
// 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 *MutatingWebhookConfigurationApplyConfiguration) WithKind(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithName(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *MutatingWebhookConfigurationApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *MutatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
// WithWebhooks adds the given value to the Webhooks 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 Webhooks field.
func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*MutatingWebhookApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithWebhooks")
}
b.Webhooks = append(b.Webhooks, *values[i])
}
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,98 @@
/*
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"
)
// 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 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:",inline"`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with
// apply.
func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration {
return &NamedRuleWithOperationsApplyConfiguration{}
}
// WithResourceNames adds the given value to the ResourceNames 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 ResourceNames field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.ResourceNames = append(b.ResourceNames, values[i])
}
return b
}
// WithOperations adds the given value to the Operations 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 Operations field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleWithOperationsApplyConfiguration.Operations = append(b.RuleWithOperationsApplyConfiguration.Operations, values[i])
}
return b
}
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIGroups = append(b.RuleApplyConfiguration.APIGroups, values[i])
}
return b
}
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIVersions = append(b.RuleApplyConfiguration.APIVersions, values[i])
}
return b
}
// WithResources adds the given value to the Resources 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 Resources field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.Resources = append(b.RuleApplyConfiguration.Resources, values[i])
}
return b
}
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration {
b.RuleApplyConfiguration.Scope = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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
// 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 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
// apply.
func ParamKind() *ParamKindApplyConfiguration {
return &ParamKindApplyConfiguration{}
}
// 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 *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration {
b.APIVersion = &value
return b
}
// 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 *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration {
b.Kind = &value
return b
}

View File

@@ -0,0 +1,114 @@
/*
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"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 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"`
}
// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with
// apply.
func ParamRef() *ParamRefApplyConfiguration {
return &ParamRefApplyConfiguration{}
}
// 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 *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration {
b.Name = &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 *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration {
b.Namespace = &value
return b
}
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration {
b.Selector = value
return b
}
// WithParameterNotFoundAction sets the ParameterNotFoundAction 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 ParameterNotFoundAction field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1.ParameterNotFoundActionType) *ParamRefApplyConfiguration {
b.ParameterNotFoundAction = &value
return b
}

View File

@@ -0,0 +1,108 @@
/*
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"
)
// 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 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
// apply.
func Rule() *RuleApplyConfiguration {
return &RuleApplyConfiguration{}
}
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
func (b *RuleApplyConfiguration) WithAPIGroups(values ...string) *RuleApplyConfiguration {
for i := range values {
b.APIGroups = append(b.APIGroups, values[i])
}
return b
}
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
func (b *RuleApplyConfiguration) WithAPIVersions(values ...string) *RuleApplyConfiguration {
for i := range values {
b.APIVersions = append(b.APIVersions, values[i])
}
return b
}
// WithResources adds the given value to the Resources 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 Resources field.
func (b *RuleApplyConfiguration) WithResources(values ...string) *RuleApplyConfiguration {
for i := range values {
b.Resources = append(b.Resources, values[i])
}
return b
}
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
func (b *RuleApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *RuleApplyConfiguration {
b.Scope = &value
return b
}

View File

@@ -0,0 +1,93 @@
/*
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"
)
// 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 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:",inline"`
}
// RuleWithOperationsApplyConfiguration constructs a declarative configuration of the RuleWithOperations type for use with
// apply.
func RuleWithOperations() *RuleWithOperationsApplyConfiguration {
return &RuleWithOperationsApplyConfiguration{}
}
// WithOperations adds the given value to the Operations 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 Operations field.
func (b *RuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *RuleWithOperationsApplyConfiguration {
for i := range values {
b.Operations = append(b.Operations, values[i])
}
return b
}
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
func (b *RuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *RuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIGroups = append(b.RuleApplyConfiguration.APIGroups, values[i])
}
return b
}
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
func (b *RuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *RuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIVersions = append(b.RuleApplyConfiguration.APIVersions, values[i])
}
return b
}
// WithResources adds the given value to the Resources 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 Resources field.
func (b *RuleWithOperationsApplyConfiguration) WithResources(values ...string) *RuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.Resources = append(b.RuleApplyConfiguration.Resources, values[i])
}
return b
}
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
func (b *RuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *RuleWithOperationsApplyConfiguration {
b.RuleApplyConfiguration.Scope = &value
return b
}

View File

@@ -0,0 +1,77 @@
/*
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
// 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` 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"`
// If specified, the port on the service that hosting 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
// apply.
func ServiceReference() *ServiceReferenceApplyConfiguration {
return &ServiceReferenceApplyConfiguration{}
}
// 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 *ServiceReferenceApplyConfiguration) WithNamespace(value string) *ServiceReferenceApplyConfiguration {
b.Namespace = &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 *ServiceReferenceApplyConfiguration) WithName(value string) *ServiceReferenceApplyConfiguration {
b.Name = &value
return b
}
// WithPath sets the Path 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 Path field is set to the value of the last call.
func (b *ServiceReferenceApplyConfiguration) WithPath(value string) *ServiceReferenceApplyConfiguration {
b.Path = &value
return b
}
// WithPort sets the Port 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 Port field is set to the value of the last call.
func (b *ServiceReferenceApplyConfiguration) WithPort(value int32) *ServiceReferenceApplyConfiguration {
b.Port = &value
return b
}

View File

@@ -0,0 +1,48 @@
/*
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
// 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 {
// The type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}
// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with
// apply.
func TypeChecking() *TypeCheckingApplyConfiguration {
return &TypeCheckingApplyConfiguration{}
}
// WithExpressionWarnings adds the given value to the ExpressionWarnings 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 ExpressionWarnings field.
func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExpressionWarnings")
}
b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i])
}
return b
}

View File

@@ -0,0 +1,293 @@
/*
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"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicy")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicy.Name)
b.WithKind("ValidatingAdmissionPolicy")
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
// 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 *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyApplyConfiguration) 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 *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) 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"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
// apply.
func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicyBinding")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicyBinding.Name)
b.WithKind("ValidatingAdmissionPolicyBinding")
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
// 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.Spec = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,125 @@
/*
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"
)
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
// 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"`
}
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with
// apply.
func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
b.MatchResources = value
return b
}
// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field.
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
for i := range values {
b.ValidationActions = append(b.ValidationActions, values[i])
}
return b
}

View File

@@ -0,0 +1,169 @@
/*
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"
)
// 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 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
// apply.
func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration {
return &ValidatingAdmissionPolicySpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.MatchConstraints = value
return b
}
// WithValidations adds the given value to the Validations 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 Validations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithValidations")
}
b.Validations = append(b.Validations, *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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAuditAnnotations")
}
b.AuditAnnotations = append(b.AuditAnnotations, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithVariables")
}
b.Variables = append(b.Variables, *values[i])
}
return b
}

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 (
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// The generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// The results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration {
return &ValidatingAdmissionPolicyStatusApplyConfiguration{}
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithTypeChecking sets the TypeChecking 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 TypeChecking field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.TypeChecking = value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,260 @@
/*
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"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// 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
// apply.
func ValidatingWebhook() *ValidatingWebhookApplyConfiguration {
return &ValidatingWebhookApplyConfiguration{}
}
// 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 *ValidatingWebhookApplyConfiguration) WithName(value string) *ValidatingWebhookApplyConfiguration {
b.Name = &value
return b
}
// WithClientConfig sets the ClientConfig 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 ClientConfig field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.ClientConfig = value
return b
}
// WithRules adds the given value to the Rules 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 Rules field.
func (b *ValidatingWebhookApplyConfiguration) WithRules(values ...*RuleWithOperationsApplyConfiguration) *ValidatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithRules")
}
b.Rules = append(b.Rules, *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 *ValidatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingWebhookApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1.MatchPolicyType) *ValidatingWebhookApplyConfiguration {
b.MatchPolicy = &value
return b
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithSideEffects sets the SideEffects 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 SideEffects field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1.SideEffectClass) *ValidatingWebhookApplyConfiguration {
b.SideEffects = &value
return b
}
// WithTimeoutSeconds sets the TimeoutSeconds 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 TimeoutSeconds field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *ValidatingWebhookApplyConfiguration {
b.TimeoutSeconds = &value
return b
}
// WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions 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 AdmissionReviewVersions field.
func (b *ValidatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *ValidatingWebhookApplyConfiguration {
for i := range values {
b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i])
}
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 *ValidatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,279 @@
/*
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"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*metav1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration {
b := &ValidatingWebhookConfigurationApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingWebhookConfiguration")
b.WithAPIVersion("admissionregistration.k8s.io/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingWebhookConfiguration.Name)
b.WithKind("ValidatingWebhookConfiguration")
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
// 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 *ValidatingWebhookConfigurationApplyConfiguration) WithKind(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithName(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *ValidatingWebhookConfigurationApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
// WithWebhooks adds the given value to the Webhooks 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 Webhooks field.
func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*ValidatingWebhookApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithWebhooks")
}
b.Webhooks = append(b.Webhooks, *values[i])
}
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,136 @@
/*
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 (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func Validation() *ValidationApplyConfiguration {
return &ValidationApplyConfiguration{}
}
// 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 *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration {
b.Expression = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration {
b.Message = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithReason(value metav1.StatusReason) *ValidationApplyConfiguration {
b.Reason = &value
return b
}
// WithMessageExpression sets the MessageExpression 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 MessageExpression field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration {
b.MessageExpression = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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
// 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 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"`
}
// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with
// apply.
func Variable() *VariableApplyConfiguration {
return &VariableApplyConfiguration{}
}
// 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 *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration {
b.Name = &value
return b
}
// 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 *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -0,0 +1,93 @@
/*
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
// 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` 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
// apply.
func WebhookClientConfig() *WebhookClientConfigApplyConfiguration {
return &WebhookClientConfigApplyConfiguration{}
}
// WithURL sets the URL 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 URL field is set to the value of the last call.
func (b *WebhookClientConfigApplyConfiguration) WithURL(value string) *WebhookClientConfigApplyConfiguration {
b.URL = &value
return b
}
// WithService sets the Service 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 Service field is set to the value of the last call.
func (b *WebhookClientConfigApplyConfiguration) WithService(value *ServiceReferenceApplyConfiguration) *WebhookClientConfigApplyConfiguration {
b.Service = value
return b
}
// WithCABundle adds the given value to the CABundle 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 CABundle field.
func (b *WebhookClientConfigApplyConfiguration) WithCABundle(values ...byte) *WebhookClientConfigApplyConfiguration {
for i := range values {
b.CABundle = append(b.CABundle, values[i])
}
return b
}

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 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"`
}
// 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

@@ -0,0 +1,80 @@
/*
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 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 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"`
}
// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with
// apply.
func AuditAnnotation() *AuditAnnotationApplyConfiguration {
return &AuditAnnotationApplyConfiguration{}
}
// WithKey sets the Key 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 Key field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration {
b.Key = &value
return b
}
// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration {
b.ValueExpression = &value
return b
}

View File

@@ -0,0 +1,56 @@
/*
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 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 {
// The path to the field that refers 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"`
// 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
// apply.
func ExpressionWarning() *ExpressionWarningApplyConfiguration {
return &ExpressionWarningApplyConfiguration{}
}
// WithFieldRef sets the FieldRef 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 FieldRef field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration {
b.FieldRef = &value
return b
}
// WithWarning sets the Warning 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 Warning field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration {
b.Warning = &value
return b
}

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 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"`
}
// 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

@@ -0,0 +1,70 @@
/*
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 v1alpha1
// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use
// with apply.
type MatchConditionApplyConfiguration struct {
// 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"`
}
// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with
// apply.
func MatchCondition() *MatchConditionApplyConfiguration {
return &MatchConditionApplyConfiguration{}
}
// 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 *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration {
b.Name = &value
return b
}
// 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 *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -0,0 +1,167 @@
/*
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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 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
// apply.
func MatchResources() *MatchResourcesApplyConfiguration {
return &MatchResourcesApplyConfiguration{}
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithResourceRules adds the given value to the ResourceRules 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 ResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResourceRules")
}
b.ResourceRules = append(b.ResourceRules, *values[i])
}
return b
}
// WithExcludeResourceRules adds the given value to the ExcludeResourceRules 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 ExcludeResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExcludeResourceRules")
}
b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i])
}
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1alpha1.MatchPolicyType) *MatchResourcesApplyConfiguration {
b.MatchPolicy = &value
return b
}

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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
metav1 "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"
v1 "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 {
v1.TypeMetaApplyConfiguration `json:",inline"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of 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/v1alpha1")
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 *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 {
return nil, err
}
b.WithName(mutatingAdmissionPolicy.Name)
b.WithKind("MutatingAdmissionPolicy")
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
// 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 metav1.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 metav1.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 ...*v1.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 = &v1.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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
metav1 "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"
v1 "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 {
v1.TypeMetaApplyConfiguration `json:",inline"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of 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/v1alpha1")
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 *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 {
return nil, err
}
b.WithName(mutatingAdmissionPolicyBinding.Name)
b.WithKind("MutatingAdmissionPolicyBinding")
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
// 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 metav1.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 metav1.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 ...*v1.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 = &v1.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 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 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,173 @@
/*
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 v1alpha1
import (
v1 "k8s.io/api/admissionregistration/v1"
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
)
// 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 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
// 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 admissionregistrationv1alpha1.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 v1.ReinvocationPolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
b.ReinvocationPolicy = &value
return b
}

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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
)
// 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 *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
// 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 admissionregistrationv1alpha1.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

@@ -0,0 +1,99 @@
/*
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 v1alpha1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
)
// 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 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:",inline"`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with
// apply.
func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration {
return &NamedRuleWithOperationsApplyConfiguration{}
}
// WithResourceNames adds the given value to the ResourceNames 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 ResourceNames field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.ResourceNames = append(b.ResourceNames, values[i])
}
return b
}
// WithOperations adds the given value to the Operations 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 Operations field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleWithOperationsApplyConfiguration.Operations = append(b.RuleWithOperationsApplyConfiguration.Operations, values[i])
}
return b
}
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIGroups = append(b.RuleApplyConfiguration.APIGroups, values[i])
}
return b
}
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIVersions = append(b.RuleApplyConfiguration.APIVersions, values[i])
}
return b
}
// WithResources adds the given value to the Resources 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 Resources field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.Resources = append(b.RuleApplyConfiguration.Resources, values[i])
}
return b
}
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration {
b.RuleApplyConfiguration.Scope = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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 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 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
// apply.
func ParamKind() *ParamKindApplyConfiguration {
return &ParamKindApplyConfiguration{}
}
// 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 *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration {
b.APIVersion = &value
return b
}
// 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 *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration {
b.Kind = &value
return b
}

View File

@@ -0,0 +1,109 @@
/*
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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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` 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"`
}
// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with
// apply.
func ParamRef() *ParamRefApplyConfiguration {
return &ParamRefApplyConfiguration{}
}
// 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 *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration {
b.Name = &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 *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration {
b.Namespace = &value
return b
}
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration {
b.Selector = value
return b
}
// WithParameterNotFoundAction sets the ParameterNotFoundAction 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 ParameterNotFoundAction field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1alpha1.ParameterNotFoundActionType) *ParamRefApplyConfiguration {
b.ParameterNotFoundAction = &value
return b
}

View File

@@ -0,0 +1,48 @@
/*
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 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 {
// The type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}
// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with
// apply.
func TypeChecking() *TypeCheckingApplyConfiguration {
return &TypeCheckingApplyConfiguration{}
}
// WithExpressionWarnings adds the given value to the ExpressionWarnings 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 ExpressionWarnings field.
func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExpressionWarnings")
}
b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i])
}
return b
}

View File

@@ -0,0 +1,293 @@
/*
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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicy")
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicy.Name)
b.WithKind("ValidatingAdmissionPolicy")
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
// 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 *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.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 *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) 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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
// apply.
func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicyBinding")
b.WithAPIVersion("admissionregistration.k8s.io/v1alpha1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicyBinding.Name)
b.WithKind("ValidatingAdmissionPolicyBinding")
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
// 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.Spec = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,125 @@
/*
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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
)
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
// 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"`
}
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with
// apply.
func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
b.MatchResources = value
return b
}
// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field.
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1alpha1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
for i := range values {
b.ValidationActions = append(b.ValidationActions, values[i])
}
return b
}

View File

@@ -0,0 +1,169 @@
/*
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 v1alpha1
import (
admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
)
// 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 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
// apply.
func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration {
return &ValidatingAdmissionPolicySpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.MatchConstraints = value
return b
}
// WithValidations adds the given value to the Validations 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 Validations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithValidations")
}
b.Validations = append(b.Validations, *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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1alpha1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAuditAnnotations")
}
b.AuditAnnotations = append(b.AuditAnnotations, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithVariables")
}
b.Variables = append(b.Variables, *values[i])
}
return b
}

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 v1alpha1
import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use
// with apply.
//
// ValidatingAdmissionPolicyStatus represents the status of a ValidatingAdmissionPolicy.
type ValidatingAdmissionPolicyStatusApplyConfiguration struct {
// The generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// The results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration {
return &ValidatingAdmissionPolicyStatusApplyConfiguration{}
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithTypeChecking sets the TypeChecking 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 TypeChecking field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.TypeChecking = value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,136 @@
/*
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 v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func Validation() *ValidationApplyConfiguration {
return &ValidationApplyConfiguration{}
}
// 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 *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration {
b.Expression = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration {
b.Message = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration {
b.Reason = &value
return b
}
// WithMessageExpression sets the MessageExpression 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 MessageExpression field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration {
b.MessageExpression = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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 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 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"`
}
// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with
// apply.
func Variable() *VariableApplyConfiguration {
return &VariableApplyConfiguration{}
}
// 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 *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration {
b.Name = &value
return b
}
// 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 *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration {
b.Expression = &value
return b
}

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 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"`
}
// 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

@@ -0,0 +1,80 @@
/*
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 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 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"`
}
// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with
// apply.
func AuditAnnotation() *AuditAnnotationApplyConfiguration {
return &AuditAnnotationApplyConfiguration{}
}
// WithKey sets the Key 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 Key field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration {
b.Key = &value
return b
}
// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call.
func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration {
b.ValueExpression = &value
return b
}

View File

@@ -0,0 +1,56 @@
/*
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 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 {
// The path to the field that refers 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"`
// 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
// apply.
func ExpressionWarning() *ExpressionWarningApplyConfiguration {
return &ExpressionWarningApplyConfiguration{}
}
// WithFieldRef sets the FieldRef 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 FieldRef field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration {
b.FieldRef = &value
return b
}
// WithWarning sets the Warning 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 Warning field is set to the value of the last call.
func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration {
b.Warning = &value
return b
}

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 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"`
}
// 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

@@ -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 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 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"`
}
// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with
// apply.
func MatchCondition() *MatchConditionApplyConfiguration {
return &MatchConditionApplyConfiguration{}
}
// 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 *MatchConditionApplyConfiguration) WithName(value string) *MatchConditionApplyConfiguration {
b.Name = &value
return b
}
// 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 *MatchConditionApplyConfiguration) WithExpression(value string) *MatchConditionApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -0,0 +1,166 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 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
// apply.
func MatchResources() *MatchResourcesApplyConfiguration {
return &MatchResourcesApplyConfiguration{}
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithResourceRules adds the given value to the ResourceRules 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 ResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResourceRules")
}
b.ResourceRules = append(b.ResourceRules, *values[i])
}
return b
}
// WithExcludeResourceRules adds the given value to the ExcludeResourceRules 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 ExcludeResourceRules field.
func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExcludeResourceRules")
}
b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i])
}
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MatchResourcesApplyConfiguration {
b.MatchPolicy = &value
return b
}

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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "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 {
v1.TypeMetaApplyConfiguration `json:",inline"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of 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/v1beta1")
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 *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 {
return nil, err
}
b.WithName(mutatingAdmissionPolicy.Name)
b.WithKind("MutatingAdmissionPolicy")
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
// 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 metav1.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 metav1.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 ...*v1.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 = &v1.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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "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 {
v1.TypeMetaApplyConfiguration `json:",inline"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of 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/v1beta1")
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 *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 {
return nil, err
}
b.WithName(mutatingAdmissionPolicyBinding.Name)
b.WithKind("MutatingAdmissionPolicyBinding")
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
// 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 metav1.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 metav1.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 ...*v1.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 = &v1.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 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 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,173 @@
/*
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 v1beta1
import (
v1 "k8s.io/api/admissionregistration/v1"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
)
// 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 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
// 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 admissionregistrationv1beta1.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 v1.ReinvocationPolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
b.ReinvocationPolicy = &value
return b
}

View File

@@ -0,0 +1,287 @@
/*
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 v1beta1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// 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
// apply.
func MutatingWebhook() *MutatingWebhookApplyConfiguration {
return &MutatingWebhookApplyConfiguration{}
}
// 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 *MutatingWebhookApplyConfiguration) WithName(value string) *MutatingWebhookApplyConfiguration {
b.Name = &value
return b
}
// WithClientConfig sets the ClientConfig 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 ClientConfig field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.ClientConfig = value
return b
}
// WithRules adds the given value to the Rules 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 Rules field.
func (b *MutatingWebhookApplyConfiguration) WithRules(values ...*v1.RuleWithOperationsApplyConfiguration) *MutatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithRules")
}
b.Rules = append(b.Rules, *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 *MutatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *MutatingWebhookApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MutatingWebhookApplyConfiguration {
b.MatchPolicy = &value
return b
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithSideEffects sets the SideEffects 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 SideEffects field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1beta1.SideEffectClass) *MutatingWebhookApplyConfiguration {
b.SideEffects = &value
return b
}
// WithTimeoutSeconds sets the TimeoutSeconds 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 TimeoutSeconds field is set to the value of the last call.
func (b *MutatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *MutatingWebhookApplyConfiguration {
b.TimeoutSeconds = &value
return b
}
// WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions 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 AdmissionReviewVersions field.
func (b *MutatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *MutatingWebhookApplyConfiguration {
for i := range values {
b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, 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 *MutatingWebhookApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1.ReinvocationPolicyType) *MutatingWebhookApplyConfiguration {
b.ReinvocationPolicy = &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 *MutatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,280 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration {
b := &MutatingWebhookConfigurationApplyConfiguration{}
b.WithName(name)
b.WithKind("MutatingWebhookConfiguration")
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(mutatingWebhookConfiguration.Name)
b.WithKind("MutatingWebhookConfiguration")
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
// 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 *MutatingWebhookConfigurationApplyConfiguration) WithKind(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithName(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration {
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 *MutatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *MutatingWebhookConfigurationApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *MutatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithWebhooks adds the given value to the Webhooks 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 Webhooks field.
func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*MutatingWebhookApplyConfiguration) *MutatingWebhookConfigurationApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithWebhooks")
}
b.Webhooks = append(b.Webhooks, *values[i])
}
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *MutatingWebhookConfigurationApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
)
// 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 *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
// 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 admissionregistrationv1beta1.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

@@ -0,0 +1,99 @@
/*
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 v1beta1
import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
)
// 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 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:",inline"`
}
// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with
// apply.
func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration {
return &NamedRuleWithOperationsApplyConfiguration{}
}
// WithResourceNames adds the given value to the ResourceNames 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 ResourceNames field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.ResourceNames = append(b.ResourceNames, values[i])
}
return b
}
// WithOperations adds the given value to the Operations 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 Operations field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleWithOperationsApplyConfiguration.Operations = append(b.RuleWithOperationsApplyConfiguration.Operations, values[i])
}
return b
}
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIGroups = append(b.RuleApplyConfiguration.APIGroups, values[i])
}
return b
}
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.APIVersions = append(b.RuleApplyConfiguration.APIVersions, values[i])
}
return b
}
// WithResources adds the given value to the Resources 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 Resources field.
func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration {
for i := range values {
b.RuleApplyConfiguration.Resources = append(b.RuleApplyConfiguration.Resources, values[i])
}
return b
}
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration {
b.RuleApplyConfiguration.Scope = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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 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 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
// apply.
func ParamKind() *ParamKindApplyConfiguration {
return &ParamKindApplyConfiguration{}
}
// 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 *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration {
b.APIVersion = &value
return b
}
// 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 *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration {
b.Kind = &value
return b
}

View File

@@ -0,0 +1,114 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 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"`
}
// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with
// apply.
func ParamRef() *ParamRefApplyConfiguration {
return &ParamRefApplyConfiguration{}
}
// 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 *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration {
b.Name = &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 *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration {
b.Namespace = &value
return b
}
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration {
b.Selector = value
return b
}
// WithParameterNotFoundAction sets the ParameterNotFoundAction 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 ParameterNotFoundAction field is set to the value of the last call.
func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1beta1.ParameterNotFoundActionType) *ParamRefApplyConfiguration {
b.ParameterNotFoundAction = &value
return b
}

View File

@@ -0,0 +1,77 @@
/*
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 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` 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"`
// If specified, the port on the service that hosting 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
// apply.
func ServiceReference() *ServiceReferenceApplyConfiguration {
return &ServiceReferenceApplyConfiguration{}
}
// 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 *ServiceReferenceApplyConfiguration) WithNamespace(value string) *ServiceReferenceApplyConfiguration {
b.Namespace = &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 *ServiceReferenceApplyConfiguration) WithName(value string) *ServiceReferenceApplyConfiguration {
b.Name = &value
return b
}
// WithPath sets the Path 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 Path field is set to the value of the last call.
func (b *ServiceReferenceApplyConfiguration) WithPath(value string) *ServiceReferenceApplyConfiguration {
b.Path = &value
return b
}
// WithPort sets the Port 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 Port field is set to the value of the last call.
func (b *ServiceReferenceApplyConfiguration) WithPort(value int32) *ServiceReferenceApplyConfiguration {
b.Port = &value
return b
}

View File

@@ -0,0 +1,48 @@
/*
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 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 {
// The type checking warnings for each expression.
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
}
// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with
// apply.
func TypeChecking() *TypeCheckingApplyConfiguration {
return &TypeCheckingApplyConfiguration{}
}
// WithExpressionWarnings adds the given value to the ExpressionWarnings 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 ExpressionWarnings field.
func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExpressionWarnings")
}
b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i])
}
return b
}

View File

@@ -0,0 +1,293 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicy.
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration {
b := &ValidatingAdmissionPolicyApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicy")
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicy.Name)
b.WithKind("ValidatingAdmissionPolicy")
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
// 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 *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
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 *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.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 *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyApplyConfiguration) 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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Specification of the desired behavior of the ValidatingAdmissionPolicyBinding.
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
}
// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
// apply.
func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingAdmissionPolicyBinding")
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingAdmissionPolicyBinding.Name)
b.WithKind("ValidatingAdmissionPolicyBinding")
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
// 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
b.Spec = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,125 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
)
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
// with apply.
//
// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
// 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"`
}
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with
// apply.
func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
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 *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
b.MatchResources = value
return b
}
// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field.
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1beta1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
for i := range values {
b.ValidationActions = append(b.ValidationActions, values[i])
}
return b
}

View File

@@ -0,0 +1,169 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
)
// 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 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
// apply.
func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration {
return &ValidatingAdmissionPolicySpecApplyConfiguration{}
}
// 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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.MatchConstraints = value
return b
}
// WithValidations adds the given value to the Validations 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 Validations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithValidations")
}
b.Validations = append(b.Validations, *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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field.
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithAuditAnnotations")
}
b.AuditAnnotations = append(b.AuditAnnotations, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
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 *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithVariables")
}
b.Variables = append(b.Variables, *values[i])
}
return b
}

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 v1beta1
import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// The generation observed by the controller.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// The results of type checking for each expression.
// Presence of this field indicates the completion of the type checking.
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
// The 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
// apply.
func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration {
return &ValidatingAdmissionPolicyStatusApplyConfiguration{}
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithTypeChecking sets the TypeChecking 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 TypeChecking field is set to the value of the last call.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
b.TypeChecking = value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,262 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// 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
// apply.
func ValidatingWebhook() *ValidatingWebhookApplyConfiguration {
return &ValidatingWebhookApplyConfiguration{}
}
// 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 *ValidatingWebhookApplyConfiguration) WithName(value string) *ValidatingWebhookApplyConfiguration {
b.Name = &value
return b
}
// WithClientConfig sets the ClientConfig 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 ClientConfig field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.ClientConfig = value
return b
}
// WithRules adds the given value to the Rules 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 Rules field.
func (b *ValidatingWebhookApplyConfiguration) WithRules(values ...*v1.RuleWithOperationsApplyConfiguration) *ValidatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithRules")
}
b.Rules = append(b.Rules, *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 *ValidatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *ValidatingWebhookApplyConfiguration {
b.FailurePolicy = &value
return b
}
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *ValidatingWebhookApplyConfiguration {
b.MatchPolicy = &value
return b
}
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.NamespaceSelector = value
return b
}
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithObjectSelector(value *metav1.LabelSelectorApplyConfiguration) *ValidatingWebhookApplyConfiguration {
b.ObjectSelector = value
return b
}
// WithSideEffects sets the SideEffects 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 SideEffects field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1beta1.SideEffectClass) *ValidatingWebhookApplyConfiguration {
b.SideEffects = &value
return b
}
// WithTimeoutSeconds sets the TimeoutSeconds 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 TimeoutSeconds field is set to the value of the last call.
func (b *ValidatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *ValidatingWebhookApplyConfiguration {
b.TimeoutSeconds = &value
return b
}
// WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions 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 AdmissionReviewVersions field.
func (b *ValidatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *ValidatingWebhookApplyConfiguration {
for i := range values {
b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i])
}
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 *ValidatingWebhookApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingWebhookApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMatchConditions")
}
b.MatchConditions = append(b.MatchConditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,280 @@
/*
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 v1beta1
import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
*v1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration {
b := &ValidatingWebhookConfigurationApplyConfiguration{}
b.WithName(name)
b.WithKind("ValidatingWebhookConfiguration")
b.WithAPIVersion("admissionregistration.k8s.io/v1beta1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(validatingWebhookConfiguration.Name)
b.WithKind("ValidatingWebhookConfiguration")
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
// 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 *ValidatingWebhookConfigurationApplyConfiguration) WithKind(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithAPIVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithName(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithGenerateName(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithNamespace(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithUID(value types.UID) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithResourceVersion(value string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithGeneration(value int64) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithLabels(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration {
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 *ValidatingWebhookConfigurationApplyConfiguration) WithFinalizers(values ...string) *ValidatingWebhookConfigurationApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ValidatingWebhookConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithWebhooks adds the given value to the Webhooks 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 Webhooks field.
func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ...*ValidatingWebhookApplyConfiguration) *ValidatingWebhookConfigurationApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithWebhooks")
}
b.Webhooks = append(b.Webhooks, *values[i])
}
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ValidatingWebhookConfigurationApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,136 @@
/*
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 v1beta1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func Validation() *ValidationApplyConfiguration {
return &ValidationApplyConfiguration{}
}
// 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 *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration {
b.Expression = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration {
b.Message = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration {
b.Reason = &value
return b
}
// WithMessageExpression sets the MessageExpression 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 MessageExpression field is set to the value of the last call.
func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration {
b.MessageExpression = &value
return b
}

View File

@@ -0,0 +1,55 @@
/*
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 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 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"`
}
// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with
// apply.
func Variable() *VariableApplyConfiguration {
return &VariableApplyConfiguration{}
}
// 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 *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration {
b.Name = &value
return b
}
// 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 *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration {
b.Expression = &value
return b
}

View File

@@ -0,0 +1,93 @@
/*
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 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` 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
// apply.
func WebhookClientConfig() *WebhookClientConfigApplyConfiguration {
return &WebhookClientConfigApplyConfiguration{}
}
// WithURL sets the URL 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 URL field is set to the value of the last call.
func (b *WebhookClientConfigApplyConfiguration) WithURL(value string) *WebhookClientConfigApplyConfiguration {
b.URL = &value
return b
}
// WithService sets the Service 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 Service field is set to the value of the last call.
func (b *WebhookClientConfigApplyConfiguration) WithService(value *ServiceReferenceApplyConfiguration) *WebhookClientConfigApplyConfiguration {
b.Service = value
return b
}
// WithCABundle adds the given value to the CABundle 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 CABundle field.
func (b *WebhookClientConfigApplyConfiguration) WithCABundle(values ...byte) *WebhookClientConfigApplyConfiguration {
for i := range values {
b.CABundle = append(b.CABundle, values[i])
}
return b
}

View File

@@ -0,0 +1,80 @@
/*
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 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 {
// The ID of the reporting API server.
APIServerID *string `json:"apiServerID,omitempty"`
// The API server encodes the object to this version when persisting it in
// the backend (e.g., etcd).
EncodingVersion *string `json:"encodingVersion,omitempty"`
// The API server can decode objects encoded in these versions.
// The encodingVersion must be included in the decodableVersions.
DecodableVersions []string `json:"decodableVersions,omitempty"`
// The API server can serve these versions.
// DecodableVersions must include all ServedVersions.
ServedVersions []string `json:"servedVersions,omitempty"`
}
// ServerStorageVersionApplyConfiguration constructs a declarative configuration of the ServerStorageVersion type for use with
// apply.
func ServerStorageVersion() *ServerStorageVersionApplyConfiguration {
return &ServerStorageVersionApplyConfiguration{}
}
// WithAPIServerID sets the APIServerID 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 APIServerID field is set to the value of the last call.
func (b *ServerStorageVersionApplyConfiguration) WithAPIServerID(value string) *ServerStorageVersionApplyConfiguration {
b.APIServerID = &value
return b
}
// WithEncodingVersion sets the EncodingVersion 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 EncodingVersion field is set to the value of the last call.
func (b *ServerStorageVersionApplyConfiguration) WithEncodingVersion(value string) *ServerStorageVersionApplyConfiguration {
b.EncodingVersion = &value
return b
}
// WithDecodableVersions adds the given value to the DecodableVersions 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 DecodableVersions field.
func (b *ServerStorageVersionApplyConfiguration) WithDecodableVersions(values ...string) *ServerStorageVersionApplyConfiguration {
for i := range values {
b.DecodableVersions = append(b.DecodableVersions, values[i])
}
return b
}
// WithServedVersions adds the given value to the ServedVersions 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 ServedVersions field.
func (b *ServerStorageVersionApplyConfiguration) WithServedVersions(values ...string) *ServerStorageVersionApplyConfiguration {
for i := range values {
b.ServedVersions = append(b.ServedVersions, values[i])
}
return b
}

View File

@@ -0,0 +1,291 @@
/*
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 v1alpha1
import (
apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
metav1 "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"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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"`
// The name is <group>.<resource>.
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// Spec is an empty spec. It is here to comply with Kubernetes API style.
Spec *apiserverinternalv1alpha1.StorageVersionSpec `json:"spec,omitempty"`
// API server instances report the version they can decode and the version they
// 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
// apply.
func StorageVersion(name string) *StorageVersionApplyConfiguration {
b := &StorageVersionApplyConfiguration{}
b.WithName(name)
b.WithKind("StorageVersion")
b.WithAPIVersion("internal.apiserver.k8s.io/v1alpha1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(storageVersion.Name)
b.WithKind("StorageVersion")
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
// 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 *StorageVersionApplyConfiguration) WithKind(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithAPIVersion(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithName(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithGenerateName(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithNamespace(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithUID(value types.UID) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithResourceVersion(value string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithGeneration(value int64) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageVersionApplyConfiguration {
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 *StorageVersionApplyConfiguration) WithFinalizers(values ...string) *StorageVersionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *StorageVersionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.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 *StorageVersionApplyConfiguration) WithSpec(value apiserverinternalv1alpha1.StorageVersionSpec) *StorageVersionApplyConfiguration {
b.Spec = &value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *StorageVersionApplyConfiguration) WithStatus(value *StorageVersionStatusApplyConfiguration) *StorageVersionApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *StorageVersionApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *StorageVersionApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *StorageVersionApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *StorageVersionApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,97 @@
/*
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 v1alpha1
import (
apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 of the condition.
Type *apiserverinternalv1alpha1.StorageVersionConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status *apiserverinternalv1alpha1.ConditionStatus `json:"status,omitempty"`
// If set, this represents the .metadata.generation that the condition was set based upon.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime *v1.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"`
}
// StorageVersionConditionApplyConfiguration constructs a declarative configuration of the StorageVersionCondition type for use with
// apply.
func StorageVersionCondition() *StorageVersionConditionApplyConfiguration {
return &StorageVersionConditionApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithType(value apiserverinternalv1alpha1.StorageVersionConditionType) *StorageVersionConditionApplyConfiguration {
b.Type = &value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithStatus(value apiserverinternalv1alpha1.ConditionStatus) *StorageVersionConditionApplyConfiguration {
b.Status = &value
return b
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithObservedGeneration(value int64) *StorageVersionConditionApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *StorageVersionConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithReason(value string) *StorageVersionConditionApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *StorageVersionConditionApplyConfiguration) WithMessage(value string) *StorageVersionConditionApplyConfiguration {
b.Message = &value
return b
}

View File

@@ -0,0 +1,76 @@
/*
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 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 {
// The reported versions per API server instance.
StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"`
// If all API server instances agree on the same encoding storage version,
// then this field is set to that version. Otherwise 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"`
// 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
// apply.
func StorageVersionStatus() *StorageVersionStatusApplyConfiguration {
return &StorageVersionStatusApplyConfiguration{}
}
// WithStorageVersions adds the given value to the StorageVersions 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 StorageVersions field.
func (b *StorageVersionStatusApplyConfiguration) WithStorageVersions(values ...*ServerStorageVersionApplyConfiguration) *StorageVersionStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithStorageVersions")
}
b.StorageVersions = append(b.StorageVersions, *values[i])
}
return b
}
// WithCommonEncodingVersion sets the CommonEncodingVersion 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 CommonEncodingVersion field is set to the value of the last call.
func (b *StorageVersionStatusApplyConfiguration) WithCommonEncodingVersion(value string) *StorageVersionStatusApplyConfiguration {
b.CommonEncodingVersion = &value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *StorageVersionStatusApplyConfiguration) WithConditions(values ...*StorageVersionConditionApplyConfiguration) *StorageVersionStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,296 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
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"
)
// 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"`
// 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 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
// apply.
func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration {
b := &ControllerRevisionApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("ControllerRevision")
b.WithAPIVersion("apps/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(controllerRevision.Name)
b.WithNamespace(controllerRevision.Namespace)
b.WithKind("ControllerRevision")
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
// 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 *ControllerRevisionApplyConfiguration) WithKind(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithAPIVersion(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithName(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithGenerateName(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithNamespace(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithUID(value types.UID) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithResourceVersion(value string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithGeneration(value int64) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithLabels(entries map[string]string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithAnnotations(entries map[string]string) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ControllerRevisionApplyConfiguration {
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 *ControllerRevisionApplyConfiguration) WithFinalizers(values ...string) *ControllerRevisionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ControllerRevisionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
// WithData sets the Data 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 Data field is set to the value of the last call.
func (b *ControllerRevisionApplyConfiguration) WithData(value runtime.RawExtension) *ControllerRevisionApplyConfiguration {
b.Data = &value
return b
}
// WithRevision sets the Revision 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 Revision field is set to the value of the last call.
func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *ControllerRevisionApplyConfiguration {
b.Revision = &value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ControllerRevisionApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ControllerRevisionApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ControllerRevisionApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ControllerRevisionApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,298 @@
/*
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 (
appsv1 "k8s.io/api/apps/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"
)
// 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"`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration {
b := &DaemonSetApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("DaemonSet")
b.WithAPIVersion("apps/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(daemonSet.Name)
b.WithNamespace(daemonSet.Namespace)
b.WithKind("DaemonSet")
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
// 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 *DaemonSetApplyConfiguration) WithKind(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithAPIVersion(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithName(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithGenerateName(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithNamespace(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithUID(value types.UID) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithResourceVersion(value string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithGeneration(value int64) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithLabels(entries map[string]string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithAnnotations(entries map[string]string) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *DaemonSetApplyConfiguration {
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 *DaemonSetApplyConfiguration) WithFinalizers(values ...string) *DaemonSetApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *DaemonSetApplyConfiguration) 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 *DaemonSetApplyConfiguration) WithSpec(value *DaemonSetSpecApplyConfiguration) *DaemonSetApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *DaemonSetApplyConfiguration) WithStatus(value *DaemonSetStatusApplyConfiguration) *DaemonSetApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *DaemonSetApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *DaemonSetApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *DaemonSetApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *DaemonSetApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,89 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func DaemonSetCondition() *DaemonSetConditionApplyConfiguration {
return &DaemonSetConditionApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *DaemonSetConditionApplyConfiguration) WithType(value appsv1.DaemonSetConditionType) *DaemonSetConditionApplyConfiguration {
b.Type = &value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *DaemonSetConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *DaemonSetConditionApplyConfiguration {
b.Status = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call.
func (b *DaemonSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DaemonSetConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *DaemonSetConditionApplyConfiguration) WithReason(value string) *DaemonSetConditionApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *DaemonSetConditionApplyConfiguration) WithMessage(value string) *DaemonSetConditionApplyConfiguration {
b.Message = &value
return b
}

View File

@@ -0,0 +1,100 @@
/*
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 (
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use
// with apply.
//
// DaemonSetSpec is the specification of a daemon set.
type DaemonSetSpecApplyConfiguration struct {
// 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
// apply.
func DaemonSetSpec() *DaemonSetSpecApplyConfiguration {
return &DaemonSetSpecApplyConfiguration{}
}
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
func (b *DaemonSetSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *DaemonSetSpecApplyConfiguration {
b.Selector = value
return b
}
// WithTemplate sets the Template 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 Template field is set to the value of the last call.
func (b *DaemonSetSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DaemonSetSpecApplyConfiguration {
b.Template = value
return b
}
// WithUpdateStrategy sets the UpdateStrategy 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 UpdateStrategy field is set to the value of the last call.
func (b *DaemonSetSpecApplyConfiguration) WithUpdateStrategy(value *DaemonSetUpdateStrategyApplyConfiguration) *DaemonSetSpecApplyConfiguration {
b.UpdateStrategy = value
return b
}
// WithMinReadySeconds sets the MinReadySeconds 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 MinReadySeconds field is set to the value of the last call.
func (b *DaemonSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *DaemonSetSpecApplyConfiguration {
b.MinReadySeconds = &value
return b
}
// WithRevisionHistoryLimit sets the RevisionHistoryLimit 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 RevisionHistoryLimit field is set to the value of the last call.
func (b *DaemonSetSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DaemonSetSpecApplyConfiguration {
b.RevisionHistoryLimit = &value
return b
}

View File

@@ -0,0 +1,150 @@
/*
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
// 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 {
// 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
// apply.
func DaemonSetStatus() *DaemonSetStatusApplyConfiguration {
return &DaemonSetStatusApplyConfiguration{}
}
// WithCurrentNumberScheduled sets the CurrentNumberScheduled 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 CurrentNumberScheduled field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithCurrentNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration {
b.CurrentNumberScheduled = &value
return b
}
// WithNumberMisscheduled sets the NumberMisscheduled 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 NumberMisscheduled field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithNumberMisscheduled(value int32) *DaemonSetStatusApplyConfiguration {
b.NumberMisscheduled = &value
return b
}
// WithDesiredNumberScheduled sets the DesiredNumberScheduled 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 DesiredNumberScheduled field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithDesiredNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration {
b.DesiredNumberScheduled = &value
return b
}
// WithNumberReady sets the NumberReady 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 NumberReady field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithNumberReady(value int32) *DaemonSetStatusApplyConfiguration {
b.NumberReady = &value
return b
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithObservedGeneration(value int64) *DaemonSetStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithUpdatedNumberScheduled sets the UpdatedNumberScheduled 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 UpdatedNumberScheduled field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithUpdatedNumberScheduled(value int32) *DaemonSetStatusApplyConfiguration {
b.UpdatedNumberScheduled = &value
return b
}
// WithNumberAvailable sets the NumberAvailable 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 NumberAvailable field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithNumberAvailable(value int32) *DaemonSetStatusApplyConfiguration {
b.NumberAvailable = &value
return b
}
// WithNumberUnavailable sets the NumberUnavailable 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 NumberUnavailable field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithNumberUnavailable(value int32) *DaemonSetStatusApplyConfiguration {
b.NumberUnavailable = &value
return b
}
// WithCollisionCount sets the CollisionCount 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 CollisionCount field is set to the value of the last call.
func (b *DaemonSetStatusApplyConfiguration) WithCollisionCount(value int32) *DaemonSetStatusApplyConfiguration {
b.CollisionCount = &value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *DaemonSetStatusApplyConfiguration) WithConditions(values ...*DaemonSetConditionApplyConfiguration) *DaemonSetStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@@ -0,0 +1,60 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
)
// 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 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"`
}
// DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with
// apply.
func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration {
return &DaemonSetUpdateStrategyApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *DaemonSetUpdateStrategyApplyConfiguration) WithType(value appsv1.DaemonSetUpdateStrategyType) *DaemonSetUpdateStrategyApplyConfiguration {
b.Type = &value
return b
}
// WithRollingUpdate sets the RollingUpdate 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 RollingUpdate field is set to the value of the last call.
func (b *DaemonSetUpdateStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDaemonSetApplyConfiguration) *DaemonSetUpdateStrategyApplyConfiguration {
b.RollingUpdate = value
return b
}

View File

@@ -0,0 +1,299 @@
/*
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 (
appsv1 "k8s.io/api/apps/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"
)
// 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"`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,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
// apply.
func Deployment(name, namespace string) *DeploymentApplyConfiguration {
b := &DeploymentApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("Deployment")
b.WithAPIVersion("apps/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(deployment.Name)
b.WithNamespace(deployment.Namespace)
b.WithKind("Deployment")
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
// 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 *DeploymentApplyConfiguration) WithKind(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithAPIVersion(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithName(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithGenerateName(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithNamespace(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithUID(value types.UID) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithResourceVersion(value string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithGeneration(value int64) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithLabels(entries map[string]string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *DeploymentApplyConfiguration {
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 *DeploymentApplyConfiguration) WithFinalizers(values ...string) *DeploymentApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *DeploymentApplyConfiguration) 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 *DeploymentApplyConfiguration) WithSpec(value *DeploymentSpecApplyConfiguration) *DeploymentApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyConfiguration) *DeploymentApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *DeploymentApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *DeploymentApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *DeploymentApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *DeploymentApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,98 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func DeploymentCondition() *DeploymentConditionApplyConfiguration {
return &DeploymentConditionApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithType(value appsv1.DeploymentConditionType) *DeploymentConditionApplyConfiguration {
b.Type = &value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *DeploymentConditionApplyConfiguration {
b.Status = &value
return b
}
// WithLastUpdateTime sets the LastUpdateTime 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 LastUpdateTime field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *DeploymentConditionApplyConfiguration {
b.LastUpdateTime = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *DeploymentConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithReason(value string) *DeploymentConditionApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *DeploymentConditionApplyConfiguration) WithMessage(value string) *DeploymentConditionApplyConfiguration {
b.Message = &value
return b
}

View File

@@ -0,0 +1,129 @@
/*
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 (
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// 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 {
// 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
// apply.
func DeploymentSpec() *DeploymentSpecApplyConfiguration {
return &DeploymentSpecApplyConfiguration{}
}
// WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithReplicas(value int32) *DeploymentSpecApplyConfiguration {
b.Replicas = &value
return b
}
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *DeploymentSpecApplyConfiguration {
b.Selector = value
return b
}
// WithTemplate sets the Template 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 Template field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *DeploymentSpecApplyConfiguration {
b.Template = value
return b
}
// WithStrategy sets the Strategy 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 Strategy field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithStrategy(value *DeploymentStrategyApplyConfiguration) *DeploymentSpecApplyConfiguration {
b.Strategy = value
return b
}
// WithMinReadySeconds sets the MinReadySeconds 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 MinReadySeconds field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithMinReadySeconds(value int32) *DeploymentSpecApplyConfiguration {
b.MinReadySeconds = &value
return b
}
// WithRevisionHistoryLimit sets the RevisionHistoryLimit 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 RevisionHistoryLimit field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithRevisionHistoryLimit(value int32) *DeploymentSpecApplyConfiguration {
b.RevisionHistoryLimit = &value
return b
}
// WithPaused sets the Paused 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 Paused field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithPaused(value bool) *DeploymentSpecApplyConfiguration {
b.Paused = &value
return b
}
// WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds 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 ProgressDeadlineSeconds field is set to the value of the last call.
func (b *DeploymentSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *DeploymentSpecApplyConfiguration {
b.ProgressDeadlineSeconds = &value
return b
}

View File

@@ -0,0 +1,134 @@
/*
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
// 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 {
// 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
// apply.
func DeploymentStatus() *DeploymentStatusApplyConfiguration {
return &DeploymentStatusApplyConfiguration{}
}
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *DeploymentStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
// WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.Replicas = &value
return b
}
// WithUpdatedReplicas sets the UpdatedReplicas 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 UpdatedReplicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithUpdatedReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.UpdatedReplicas = &value
return b
}
// WithReadyReplicas sets the ReadyReplicas 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 ReadyReplicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.ReadyReplicas = &value
return b
}
// WithAvailableReplicas sets the AvailableReplicas 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 AvailableReplicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.AvailableReplicas = &value
return b
}
// WithUnavailableReplicas sets the UnavailableReplicas 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 UnavailableReplicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.UnavailableReplicas = &value
return b
}
// WithTerminatingReplicas sets the TerminatingReplicas 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 TerminatingReplicas field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithTerminatingReplicas(value int32) *DeploymentStatusApplyConfiguration {
b.TerminatingReplicas = &value
return b
}
// WithConditions adds the given value to the Conditions 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 Conditions field.
func (b *DeploymentStatusApplyConfiguration) WithConditions(values ...*DeploymentConditionApplyConfiguration) *DeploymentStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}
// WithCollisionCount sets the CollisionCount 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 CollisionCount field is set to the value of the last call.
func (b *DeploymentStatusApplyConfiguration) WithCollisionCount(value int32) *DeploymentStatusApplyConfiguration {
b.CollisionCount = &value
return b
}

View File

@@ -0,0 +1,60 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
)
// 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 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"`
}
// DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with
// apply.
func DeploymentStrategy() *DeploymentStrategyApplyConfiguration {
return &DeploymentStrategyApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *DeploymentStrategyApplyConfiguration) WithType(value appsv1.DeploymentStrategyType) *DeploymentStrategyApplyConfiguration {
b.Type = &value
return b
}
// WithRollingUpdate sets the RollingUpdate 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 RollingUpdate field is set to the value of the last call.
func (b *DeploymentStrategyApplyConfiguration) WithRollingUpdate(value *RollingUpdateDeploymentApplyConfiguration) *DeploymentStrategyApplyConfiguration {
b.RollingUpdate = value
return b
}

View File

@@ -0,0 +1,306 @@
/*
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 (
appsv1 "k8s.io/api/apps/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"
)
// 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"`
// 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 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
// apply.
func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration {
b := &ReplicaSetApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("ReplicaSet")
b.WithAPIVersion("apps/v1")
return b
}
// 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.
// 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.
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 {
return nil, err
}
b.WithName(replicaSet.Name)
b.WithNamespace(replicaSet.Namespace)
b.WithKind("ReplicaSet")
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
// 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 *ReplicaSetApplyConfiguration) WithKind(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithAPIVersion(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithName(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithGenerateName(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithNamespace(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithUID(value types.UID) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithResourceVersion(value string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithGeneration(value int64) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithLabels(entries map[string]string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ReplicaSetApplyConfiguration {
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 *ReplicaSetApplyConfiguration) WithFinalizers(values ...string) *ReplicaSetApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *ReplicaSetApplyConfiguration) 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 *ReplicaSetApplyConfiguration) WithSpec(value *ReplicaSetSpecApplyConfiguration) *ReplicaSetApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyConfiguration) *ReplicaSetApplyConfiguration {
b.Status = value
return b
}
// GetKind retrieves the value of the Kind field in the declarative configuration.
func (b *ReplicaSetApplyConfiguration) GetKind() *string {
return b.TypeMetaApplyConfiguration.Kind
}
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
func (b *ReplicaSetApplyConfiguration) GetAPIVersion() *string {
return b.TypeMetaApplyConfiguration.APIVersion
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *ReplicaSetApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
func (b *ReplicaSetApplyConfiguration) GetNamespace() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Namespace
}

View File

@@ -0,0 +1,88 @@
/*
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 (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// 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 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
// apply.
func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration {
return &ReplicaSetConditionApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *ReplicaSetConditionApplyConfiguration) WithType(value appsv1.ReplicaSetConditionType) *ReplicaSetConditionApplyConfiguration {
b.Type = &value
return b
}
// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *ReplicaSetConditionApplyConfiguration) WithStatus(value corev1.ConditionStatus) *ReplicaSetConditionApplyConfiguration {
b.Status = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call.
func (b *ReplicaSetConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicaSetConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
func (b *ReplicaSetConditionApplyConfiguration) WithReason(value string) *ReplicaSetConditionApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message 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 Message field is set to the value of the last call.
func (b *ReplicaSetConditionApplyConfiguration) WithMessage(value string) *ReplicaSetConditionApplyConfiguration {
b.Message = &value
return b
}

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