fix: upgrade packages
k8s.io/api v0.35.0 k8s.io/apimachinery v0.35.0 k8s.io/client-go v0.35.0 k8s.io/component-helpers v0.35.0 Signed-off-by: Raymond Etornam <retornam@users.noreply.github.com>
This commit is contained in:
parent
c881f6d2d0
commit
91cff47a77
|
|
@ -1 +1 @@
|
|||
vendor/* linguist-generated=true
|
||||
vendor/** linguist-generated linguist-vendored
|
||||
|
|
|
|||
11
go.mod
11
go.mod
|
|
@ -4,11 +4,11 @@ go 1.25
|
|||
|
||||
require (
|
||||
github.com/golang/glog v1.2.5
|
||||
k8s.io/api v0.23.4
|
||||
k8s.io/apimachinery v0.23.4
|
||||
k8s.io/client-go v0.23.4
|
||||
k8s.io/component-helpers v0.23.4
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.0.0
|
||||
k8s.io/api v0.35.0
|
||||
k8s.io/apimachinery v0.35.0
|
||||
k8s.io/client-go v0.35.0
|
||||
k8s.io/component-helpers v0.35.0
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
@ -46,7 +46,6 @@ require (
|
|||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
k8s.io/klog v1.0.0 // indirect
|
||||
k8s.io/klog/v2 v2.30.0 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
|
||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
|
||||
|
|
|
|||
9
go.sum
9
go.sum
|
|
@ -608,16 +608,13 @@ k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0=
|
|||
k8s.io/component-helpers v0.23.4 h1:zCLeBuo3Qs0BqtJu767RXJgs5S9ruFJZcbM1aD+cMmc=
|
||||
k8s.io/component-helpers v0.23.4/go.mod h1:1Pl7L4zukZ054ElzRbvmZ1FJIU8roBXFOeRFu8zipa4=
|
||||
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
|
||||
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||
k8s.io/klog/v2 v2.3.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||
k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw=
|
||||
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4=
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
|
||||
k8s.io/utils v0.0.0-20200327001022-6496210b90e8/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
|
||||
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE=
|
||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
|
|
@ -626,8 +623,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
|||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s=
|
||||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.0.0 h1:0TUypniRylQye1IqOQLxaLPa+TNuO5MQ2dycNgLK/ko=
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.0.0/go.mod h1:e30PD56mVu/vIRIkP+V1oqwY1EpnIhJ10VdBuHAJ/jk=
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0 h1:IKsKAnscMyIOqyl8s8V7guTcx0QBEa6OT57EPgAgpmM=
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0/go.mod h1:DhZ52sQMJHW21+JXyA2LRUPRIxKnrNrwh+QFV+2tVA4=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
language: go
|
||||
go_import_path: k8s.io/klog
|
||||
dist: xenial
|
||||
go:
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- 1.12.x
|
||||
script:
|
||||
- go get -t -v ./...
|
||||
- diff -u <(echo -n) <(gofmt -d .)
|
||||
- diff -u <(echo -n) <(golint $(go list -e ./...))
|
||||
- go tool vet . || go vet .
|
||||
- go test -v -race ./...
|
||||
install:
|
||||
- go get golang.org/x/lint/golint
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# Contributing Guidelines
|
||||
|
||||
Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt:
|
||||
|
||||
_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._
|
||||
|
||||
## Getting Started
|
||||
|
||||
We have full documentation on how to get started contributing here:
|
||||
|
||||
- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
|
||||
- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
|
||||
- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers
|
||||
|
||||
## Mentorship
|
||||
|
||||
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
|
||||
|
||||
## Contact Information
|
||||
|
||||
- [Slack](https://kubernetes.slack.com/messages/sig-architecture)
|
||||
- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture)
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, "control" means (i) the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code,
|
||||
generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included
|
||||
in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
||||
is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative Works
|
||||
shall not include works that remain separable from, or merely link (or bind by
|
||||
name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative Works
|
||||
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
||||
by the copyright owner or by an individual or Legal Entity authorized to submit
|
||||
on behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
||||
such license applies only to those patent claims licensable by such Contributor
|
||||
that are necessarily infringed by their Contribution(s) alone or by combination
|
||||
of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory
|
||||
patent infringement, then any patent licenses granted to You under this License
|
||||
for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form,
|
||||
provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of
|
||||
this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form
|
||||
of the Work, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the
|
||||
attribution notices contained within such NOTICE file, excluding those notices
|
||||
that do not pertain to any part of the Derivative Works, in at least one of the
|
||||
following places: within a NOTICE text file distributed as part of the
|
||||
Derivative Works; within the Source form or documentation, if provided along
|
||||
with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents of
|
||||
the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works that
|
||||
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
||||
provided that such additional attribution notices cannot be construed as
|
||||
modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction, or
|
||||
distribution of Your modifications, or for any such Derivative Works as a whole,
|
||||
provided Your use, reproduction, and distribution of the Work otherwise complies
|
||||
with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
||||
for inclusion in the Work by You to the Licensor shall be under the terms and
|
||||
conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
||||
any separate license agreement you may have executed with Licensor regarding
|
||||
such Contributions.
|
||||
|
||||
6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the Licensor, except as required for
|
||||
reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the
|
||||
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||
including, without limitation, any warranties or conditions of TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
||||
solely responsible for determining the appropriateness of using or
|
||||
redistributing the Work and assume any risks associated with Your exercise of
|
||||
permissions under this License.
|
||||
|
||||
8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence),
|
||||
contract, or otherwise, unless required by applicable law (such as deliberate
|
||||
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License or
|
||||
out of the use or inability to use the Work (including but not limited to
|
||||
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||
any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to
|
||||
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
||||
other liability obligations and/or rights consistent with this License. However,
|
||||
in accepting such obligations, You may act only on Your own behalf and on Your
|
||||
sole responsibility, not on behalf of any other Contributor, and only if You
|
||||
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate
|
||||
notice, with the fields enclosed by brackets "[]" replaced with your own
|
||||
identifying information. (Don't include the brackets!) The text should be
|
||||
enclosed in the appropriate comment syntax for the file format. We also
|
||||
recommend that a file or class name and description of purpose be included on
|
||||
the same "printed page" as the copyright notice for easier identification within
|
||||
third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
reviewers:
|
||||
- jayunit100
|
||||
- hoegaarden
|
||||
- andyxning
|
||||
- neolit123
|
||||
- pohly
|
||||
- yagonobre
|
||||
- vincepri
|
||||
- detiber
|
||||
approvers:
|
||||
- dims
|
||||
- thockin
|
||||
- justinsb
|
||||
- tallclair
|
||||
- piosz
|
||||
- brancz
|
||||
- DirectXMan12
|
||||
- lavalamp
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
klog
|
||||
====
|
||||
|
||||
klog is a permanent fork of https://github.com/golang/glog.
|
||||
|
||||
## Why was klog created?
|
||||
|
||||
The decision to create klog was one that wasn't made lightly, but it was necessary due to some
|
||||
drawbacks that are present in [glog](https://github.com/golang/glog). Ultimately, the fork was created due to glog not being under active development; this can be seen in the glog README:
|
||||
|
||||
> The code in this repo [...] is not itself under development
|
||||
|
||||
This makes us unable to solve many use cases without a fork. The factors that contributed to needing feature development are listed below:
|
||||
|
||||
* `glog` [presents a lot "gotchas"](https://github.com/kubernetes/kubernetes/issues/61006) and introduces challenges in containerized environments, all of which aren't well documented.
|
||||
* `glog` doesn't provide an easy way to test logs, which detracts from the stability of software using it
|
||||
* A long term goal is to implement a logging interface that allows us to add context, change output format, etc.
|
||||
|
||||
Historical context is available here:
|
||||
|
||||
* https://github.com/kubernetes/kubernetes/issues/61006
|
||||
* https://github.com/kubernetes/kubernetes/issues/70264
|
||||
* https://groups.google.com/forum/#!msg/kubernetes-sig-architecture/wCWiWf3Juzs/hXRVBH90CgAJ
|
||||
* https://groups.google.com/forum/#!msg/kubernetes-dev/7vnijOMhLS0/1oRiNtigBgAJ
|
||||
|
||||
----
|
||||
|
||||
How to use klog
|
||||
===============
|
||||
- Replace imports for `github.com/golang/glog` with `k8s.io/klog`
|
||||
- Use `klog.InitFlags(nil)` explicitly for initializing global flags as we no longer use `init()` method to register the flags
|
||||
- You can now use `log-file` instead of `log-dir` for logging to a single file (See `examples/log_file/usage_log_file.go`)
|
||||
- If you want to redirect everything logged using klog somewhere else (say syslog!), you can use `klog.SetOutput()` method and supply a `io.Writer`. (See `examples/set_output/usage_set_output.go`)
|
||||
- For more logging conventions (See [Logging Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md))
|
||||
|
||||
### Coexisting with glog
|
||||
This package can be used side by side with glog. [This example](examples/coexist_glog/coexist_glog.go) shows how to initialize and syncronize flags from the global `flag.CommandLine` FlagSet. In addition, the example makes use of stderr as combined output by setting `alsologtostderr` (or `logtostderr`) to `true`.
|
||||
|
||||
## Community, discussion, contribution, and support
|
||||
|
||||
Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/).
|
||||
|
||||
You can reach the maintainers of this project at:
|
||||
|
||||
- [Slack](https://kubernetes.slack.com/messages/sig-architecture)
|
||||
- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture)
|
||||
|
||||
### Code of conduct
|
||||
|
||||
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).
|
||||
|
||||
----
|
||||
|
||||
glog
|
||||
====
|
||||
|
||||
Leveled execution logs for Go.
|
||||
|
||||
This is an efficient pure Go implementation of leveled logs in the
|
||||
manner of the open source C++ package
|
||||
https://github.com/google/glog
|
||||
|
||||
By binding methods to booleans it is possible to use the log package
|
||||
without paying the expense of evaluating the arguments to the log.
|
||||
Through the -vmodule flag, the package also provides fine-grained
|
||||
control over logging at the file level.
|
||||
|
||||
The comment from glog.go introduces the ideas:
|
||||
|
||||
Package glog implements logging analogous to the Google-internal
|
||||
C++ INFO/ERROR/V setup. It provides functions Info, Warning,
|
||||
Error, Fatal, plus formatting variants such as Infof. It
|
||||
also provides V-style logging controlled by the -v and
|
||||
-vmodule=file=2 flags.
|
||||
|
||||
Basic examples:
|
||||
|
||||
glog.Info("Prepare to repel boarders")
|
||||
|
||||
glog.Fatalf("Initialization failed: %s", err)
|
||||
|
||||
See the documentation for the V function for an explanation
|
||||
of these examples:
|
||||
|
||||
if glog.V(2) {
|
||||
glog.Info("Starting transaction...")
|
||||
}
|
||||
|
||||
glog.V(2).Infoln("Processed", nItems, "elements")
|
||||
|
||||
|
||||
The repository contains an open source version of the log package
|
||||
used inside Google. The master copy of the source lives inside
|
||||
Google, not here. The code in this repo is for export only and is not itself
|
||||
under development. Feature requests will be ignored.
|
||||
|
||||
Send bug reports to golang-nuts@googlegroups.com.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Release Process
|
||||
|
||||
The `klog` is released on an as-needed basis. The process is as follows:
|
||||
|
||||
1. An issue is proposing a new release with a changelog since the last release
|
||||
1. All [OWNERS](OWNERS) must LGTM this release
|
||||
1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION`
|
||||
1. The release issue is closed
|
||||
1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released`
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# Defined below are the security contacts for this repo.
|
||||
#
|
||||
# They are the contact point for the Product Security Committee to reach out
|
||||
# to for triaging and handling of incoming issues.
|
||||
#
|
||||
# The below names agree to abide by the
|
||||
# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
|
||||
# and will be removed and replaced if they violate that agreement.
|
||||
#
|
||||
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
|
||||
# INSTRUCTIONS AT https://kubernetes.io/security/
|
||||
|
||||
dims
|
||||
thockin
|
||||
justinsb
|
||||
tallclair
|
||||
piosz
|
||||
brancz
|
||||
DirectXMan12
|
||||
lavalamp
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# Kubernetes Community Code of Conduct
|
||||
|
||||
Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,139 +0,0 @@
|
|||
// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/
|
||||
//
|
||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// 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.
|
||||
|
||||
// File I/O for logs.
|
||||
|
||||
package klog
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// MaxSize is the maximum size of a log file in bytes.
|
||||
var MaxSize uint64 = 1024 * 1024 * 1800
|
||||
|
||||
// logDirs lists the candidate directories for new log files.
|
||||
var logDirs []string
|
||||
|
||||
func createLogDirs() {
|
||||
if logging.logDir != "" {
|
||||
logDirs = append(logDirs, logging.logDir)
|
||||
}
|
||||
logDirs = append(logDirs, os.TempDir())
|
||||
}
|
||||
|
||||
var (
|
||||
pid = os.Getpid()
|
||||
program = filepath.Base(os.Args[0])
|
||||
host = "unknownhost"
|
||||
userName = "unknownuser"
|
||||
)
|
||||
|
||||
func init() {
|
||||
h, err := os.Hostname()
|
||||
if err == nil {
|
||||
host = shortHostname(h)
|
||||
}
|
||||
|
||||
current, err := user.Current()
|
||||
if err == nil {
|
||||
userName = current.Username
|
||||
}
|
||||
|
||||
// Sanitize userName since it may contain filepath separators on Windows.
|
||||
userName = strings.Replace(userName, `\`, "_", -1)
|
||||
}
|
||||
|
||||
// shortHostname returns its argument, truncating at the first period.
|
||||
// For instance, given "www.google.com" it returns "www".
|
||||
func shortHostname(hostname string) string {
|
||||
if i := strings.Index(hostname, "."); i >= 0 {
|
||||
return hostname[:i]
|
||||
}
|
||||
return hostname
|
||||
}
|
||||
|
||||
// logName returns a new log file name containing tag, with start time t, and
|
||||
// the name for the symlink for tag.
|
||||
func logName(tag string, t time.Time) (name, link string) {
|
||||
name = fmt.Sprintf("%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d",
|
||||
program,
|
||||
host,
|
||||
userName,
|
||||
tag,
|
||||
t.Year(),
|
||||
t.Month(),
|
||||
t.Day(),
|
||||
t.Hour(),
|
||||
t.Minute(),
|
||||
t.Second(),
|
||||
pid)
|
||||
return name, program + "." + tag
|
||||
}
|
||||
|
||||
var onceLogDirs sync.Once
|
||||
|
||||
// create creates a new log file and returns the file and its filename, which
|
||||
// contains tag ("INFO", "FATAL", etc.) and t. If the file is created
|
||||
// successfully, create also attempts to update the symlink for that tag, ignoring
|
||||
// errors.
|
||||
// The startup argument indicates whether this is the initial startup of klog.
|
||||
// If startup is true, existing files are opened for appending instead of truncated.
|
||||
func create(tag string, t time.Time, startup bool) (f *os.File, filename string, err error) {
|
||||
if logging.logFile != "" {
|
||||
f, err := openOrCreate(logging.logFile, startup)
|
||||
if err == nil {
|
||||
return f, logging.logFile, nil
|
||||
}
|
||||
return nil, "", fmt.Errorf("log: unable to create log: %v", err)
|
||||
}
|
||||
onceLogDirs.Do(createLogDirs)
|
||||
if len(logDirs) == 0 {
|
||||
return nil, "", errors.New("log: no log dirs")
|
||||
}
|
||||
name, link := logName(tag, t)
|
||||
var lastErr error
|
||||
for _, dir := range logDirs {
|
||||
fname := filepath.Join(dir, name)
|
||||
f, err := openOrCreate(fname, startup)
|
||||
if err == nil {
|
||||
symlink := filepath.Join(dir, link)
|
||||
os.Remove(symlink) // ignore err
|
||||
os.Symlink(name, symlink) // ignore err
|
||||
return f, fname, nil
|
||||
}
|
||||
lastErr = err
|
||||
}
|
||||
return nil, "", fmt.Errorf("log: cannot create log: %v", lastErr)
|
||||
}
|
||||
|
||||
// The startup argument indicates whether this is the initial startup of klog.
|
||||
// If startup is true, existing files are opened for appending instead of truncated.
|
||||
func openOrCreate(name string, startup bool) (*os.File, error) {
|
||||
if startup {
|
||||
f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
||||
return f, err
|
||||
}
|
||||
f, err := os.Create(name)
|
||||
return f, err
|
||||
}
|
||||
|
|
@ -174,7 +174,7 @@ gopkg.in/yaml.v2
|
|||
# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b => gopkg.in/yaml.v3 v3.0.0-20220521103104-8f96da9f5d5e
|
||||
## explicit
|
||||
gopkg.in/yaml.v3
|
||||
# k8s.io/api v0.23.4 => k8s.io/api v0.23.4
|
||||
# k8s.io/api v0.35.0 => k8s.io/api v0.23.4
|
||||
## explicit; go 1.16
|
||||
k8s.io/api/admissionregistration/v1
|
||||
k8s.io/api/admissionregistration/v1beta1
|
||||
|
|
@ -221,7 +221,7 @@ k8s.io/api/scheduling/v1beta1
|
|||
k8s.io/api/storage/v1
|
||||
k8s.io/api/storage/v1alpha1
|
||||
k8s.io/api/storage/v1beta1
|
||||
# k8s.io/apimachinery v0.23.4 => k8s.io/apimachinery v0.23.4
|
||||
# k8s.io/apimachinery v0.35.0 => k8s.io/apimachinery v0.23.4
|
||||
## explicit; go 1.16
|
||||
k8s.io/apimachinery/pkg/api/errors
|
||||
k8s.io/apimachinery/pkg/api/meta
|
||||
|
|
@ -267,7 +267,7 @@ k8s.io/apimachinery/pkg/version
|
|||
k8s.io/apimachinery/pkg/watch
|
||||
k8s.io/apimachinery/third_party/forked/golang/json
|
||||
k8s.io/apimachinery/third_party/forked/golang/reflect
|
||||
# k8s.io/client-go v0.23.4 => k8s.io/client-go v0.23.4
|
||||
# k8s.io/client-go v0.35.0 => k8s.io/client-go v0.23.4
|
||||
## explicit; go 1.16
|
||||
k8s.io/client-go/applyconfigurations/admissionregistration/v1
|
||||
k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1
|
||||
|
|
@ -491,12 +491,9 @@ k8s.io/client-go/util/flowcontrol
|
|||
k8s.io/client-go/util/homedir
|
||||
k8s.io/client-go/util/keyutil
|
||||
k8s.io/client-go/util/workqueue
|
||||
# k8s.io/component-helpers v0.23.4 => k8s.io/component-helpers v0.23.4
|
||||
# k8s.io/component-helpers v0.35.0 => k8s.io/component-helpers v0.23.4
|
||||
## explicit; go 1.16
|
||||
k8s.io/component-helpers/storage/volume
|
||||
# k8s.io/klog v1.0.0
|
||||
## explicit; go 1.12
|
||||
k8s.io/klog
|
||||
# k8s.io/klog/v2 v2.30.0
|
||||
## explicit; go 1.13
|
||||
k8s.io/klog/v2
|
||||
|
|
@ -517,7 +514,7 @@ k8s.io/utils/trace
|
|||
## explicit; go 1.16
|
||||
sigs.k8s.io/json
|
||||
sigs.k8s.io/json/internal/golang/encoding/json
|
||||
# sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.0.0
|
||||
# sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0
|
||||
## explicit; go 1.13
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6/controller
|
||||
sigs.k8s.io/sig-storage-lib-external-provisioner/v6/controller/metrics
|
||||
|
|
|
|||
172
vendor/sigs.k8s.io/sig-storage-lib-external-provisioner/v6/controller/controller.go
generated
vendored
172
vendor/sigs.k8s.io/sig-storage-lib-external-provisioner/v6/controller/controller.go
generated
vendored
|
|
@ -45,13 +45,14 @@ import (
|
|||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
corelistersv1 "k8s.io/client-go/listers/core/v1"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/tools/leaderelection"
|
||||
"k8s.io/client-go/tools/leaderelection/resourcelock"
|
||||
"k8s.io/client-go/tools/record"
|
||||
ref "k8s.io/client-go/tools/reference"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
glog "k8s.io/klog"
|
||||
klog "k8s.io/klog/v2"
|
||||
"sigs.k8s.io/sig-storage-lib-external-provisioner/v6/controller/metrics"
|
||||
"sigs.k8s.io/sig-storage-lib-external-provisioner/v6/util"
|
||||
)
|
||||
|
|
@ -130,6 +131,7 @@ type ProvisionController struct {
|
|||
volumeInformer cache.SharedInformer
|
||||
volumes cache.Store
|
||||
classInformer cache.SharedInformer
|
||||
nodeLister corelistersv1.NodeLister
|
||||
classes cache.Store
|
||||
|
||||
// To determine if the informer is internal or external
|
||||
|
|
@ -498,6 +500,22 @@ func ClassesInformer(informer cache.SharedInformer) func(*ProvisionController) e
|
|||
}
|
||||
}
|
||||
|
||||
// NodesLister sets the informer to use for accessing Nodes.
|
||||
// This is needed only for PVCs which have a selected node.
|
||||
// Defaults to using a GET instead of an informer.
|
||||
//
|
||||
// Which approach is better depends on factors like cluster size and
|
||||
// ratio of PVCs with a selected node.
|
||||
func NodesLister(nodeLister corelistersv1.NodeLister) func(*ProvisionController) error {
|
||||
return func(c *ProvisionController) error {
|
||||
if c.HasRun() {
|
||||
return errRuntime
|
||||
}
|
||||
c.nodeLister = nodeLister
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// MetricsInstance defines which metrics collection to update. Default: metrics.Metrics.
|
||||
func MetricsInstance(m metrics.Metrics) func(*ProvisionController) error {
|
||||
return func(c *ProvisionController) error {
|
||||
|
|
@ -608,7 +626,7 @@ func NewProvisionController(
|
|||
) *ProvisionController {
|
||||
id, err := os.Hostname()
|
||||
if err != nil {
|
||||
glog.Fatalf("Error getting hostname: %v", err)
|
||||
klog.Fatalf("Error getting hostname: %v", err)
|
||||
}
|
||||
// add a uniquifier so that two processes on the same host don't accidentally both become active
|
||||
id = id + "_" + string(uuid.NewUUID())
|
||||
|
|
@ -616,7 +634,7 @@ func NewProvisionController(
|
|||
|
||||
v1.AddToScheme(scheme.Scheme)
|
||||
broadcaster := record.NewBroadcaster()
|
||||
broadcaster.StartLogging(glog.Infof)
|
||||
broadcaster.StartLogging(klog.Infof)
|
||||
broadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: client.CoreV1().Events(v1.NamespaceAll)})
|
||||
eventRecorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: component})
|
||||
|
||||
|
|
@ -650,7 +668,7 @@ func NewProvisionController(
|
|||
for _, option := range options {
|
||||
err := option(controller)
|
||||
if err != nil {
|
||||
glog.Fatalf("Error processing controller options: %s", err)
|
||||
klog.Fatalf("Error processing controller options: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -692,13 +710,16 @@ func NewProvisionController(
|
|||
controller.claimInformer = informer.Core().V1().PersistentVolumeClaims().Informer()
|
||||
controller.claimInformer.AddEventHandler(claimHandler)
|
||||
}
|
||||
controller.claimInformer.AddIndexers(cache.Indexers{uidIndex: func(obj interface{}) ([]string, error) {
|
||||
err = controller.claimInformer.AddIndexers(cache.Indexers{uidIndex: func(obj interface{}) ([]string, error) {
|
||||
uid, err := getObjectUID(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return []string{uid}, nil
|
||||
}})
|
||||
if err != nil {
|
||||
klog.Fatalf("Error setting indexer %s for pvc informer: %v", uidIndex, err)
|
||||
}
|
||||
controller.claimsIndexer = controller.claimInformer.GetIndexer()
|
||||
|
||||
// -----------------
|
||||
|
|
@ -732,7 +753,7 @@ func NewProvisionController(
|
|||
controller.classes = controller.classInformer.GetStore()
|
||||
|
||||
if controller.createProvisionerPVLimiter != nil {
|
||||
glog.V(2).Infof("Using saving PVs to API server in background")
|
||||
klog.V(2).Infof("Using saving PVs to API server in background")
|
||||
controller.volumeStore = NewVolumeStoreQueue(client, controller.createProvisionerPVLimiter, controller.claimsIndexer, controller.eventRecorder)
|
||||
} else {
|
||||
if controller.createProvisionedPVBackoff == nil {
|
||||
|
|
@ -750,7 +771,7 @@ func NewProvisionController(
|
|||
//Cap: controller.createProvisionedPVInterval,
|
||||
}
|
||||
}
|
||||
glog.V(2).Infof("Using blocking saving PVs to API server")
|
||||
klog.V(2).Infof("Using blocking saving PVs to API server")
|
||||
controller.volumeStore = NewBackoffStore(client, controller.eventRecorder, controller.createProvisionedPVBackoff, controller)
|
||||
}
|
||||
|
||||
|
|
@ -780,9 +801,7 @@ func (ctrl *ProvisionController) enqueueClaim(obj interface{}) {
|
|||
utilruntime.HandleError(err)
|
||||
return
|
||||
}
|
||||
if ctrl.claimQueue.NumRequeues(uid) == 0 {
|
||||
ctrl.claimQueue.Add(uid)
|
||||
}
|
||||
ctrl.claimQueue.Add(uid)
|
||||
}
|
||||
|
||||
// enqueueVolume takes an obj and converts it into a namespace/name string which
|
||||
|
|
@ -794,11 +813,7 @@ func (ctrl *ProvisionController) enqueueVolume(obj interface{}) {
|
|||
utilruntime.HandleError(err)
|
||||
return
|
||||
}
|
||||
// Re-Adding is harmless but try to add it to the queue only if it is not
|
||||
// already there, because if it is already there we *must* be retrying it
|
||||
if ctrl.volumeQueue.NumRequeues(key) == 0 {
|
||||
ctrl.volumeQueue.Add(key)
|
||||
}
|
||||
ctrl.volumeQueue.Add(key)
|
||||
}
|
||||
|
||||
// forgetVolume Forgets an obj from the given work queue, telling the queue to
|
||||
|
|
@ -817,7 +832,7 @@ func (ctrl *ProvisionController) forgetVolume(obj interface{}) {
|
|||
// Run starts all of this controller's control loops
|
||||
func (ctrl *ProvisionController) Run(ctx context.Context) {
|
||||
run := func(ctx context.Context) {
|
||||
glog.Infof("Starting provisioner controller %s!", ctrl.component)
|
||||
klog.Infof("Starting provisioner controller %s!", ctrl.component)
|
||||
defer utilruntime.HandleCrash()
|
||||
defer ctrl.claimQueue.ShutDown()
|
||||
defer ctrl.volumeQueue.ShutDown()
|
||||
|
|
@ -836,11 +851,11 @@ func (ctrl *ProvisionController) Run(ctx context.Context) {
|
|||
}...)
|
||||
http.Handle(ctrl.metricsPath, promhttp.Handler())
|
||||
address := net.JoinHostPort(ctrl.metricsAddress, strconv.FormatInt(int64(ctrl.metricsPort), 10))
|
||||
glog.Infof("Starting metrics server at %s\n", address)
|
||||
klog.Infof("Starting metrics server at %s\n", address)
|
||||
go wait.Forever(func() {
|
||||
err := http.ListenAndServe(address, nil)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to listen on %s: %v", address, err)
|
||||
klog.Errorf("Failed to listen on %s: %v", address, err)
|
||||
}
|
||||
}, 5*time.Second)
|
||||
}
|
||||
|
|
@ -866,7 +881,7 @@ func (ctrl *ProvisionController) Run(ctx context.Context) {
|
|||
go wait.Until(func() { ctrl.runVolumeWorker(ctx) }, time.Second, ctx.Done())
|
||||
}
|
||||
|
||||
glog.Infof("Started provisioner controller %s!", ctrl.component)
|
||||
klog.Infof("Started provisioner controller %s!", ctrl.component)
|
||||
|
||||
select {}
|
||||
}
|
||||
|
|
@ -884,7 +899,7 @@ func (ctrl *ProvisionController) Run(ctx context.Context) {
|
|||
EventRecorder: ctrl.eventRecorder,
|
||||
})
|
||||
if err != nil {
|
||||
glog.Fatalf("Error creating lock: %v", err)
|
||||
klog.Fatalf("Error creating lock: %v", err)
|
||||
}
|
||||
|
||||
leaderelection.RunOrDie(ctx, leaderelection.LeaderElectionConfig{
|
||||
|
|
@ -895,7 +910,7 @@ func (ctrl *ProvisionController) Run(ctx context.Context) {
|
|||
Callbacks: leaderelection.LeaderCallbacks{
|
||||
OnStartedLeading: run,
|
||||
OnStoppedLeading: func() {
|
||||
glog.Fatalf("leaderelection lost")
|
||||
klog.Fatalf("leaderelection lost")
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -940,14 +955,14 @@ func (ctrl *ProvisionController) processNextClaimWorkItem(ctx context.Context) b
|
|||
|
||||
if err := ctrl.syncClaimHandler(ctx, key); err != nil {
|
||||
if ctrl.failedProvisionThreshold == 0 {
|
||||
glog.Warningf("Retrying syncing claim %q, failure %v", key, ctrl.claimQueue.NumRequeues(obj))
|
||||
klog.Warningf("Retrying syncing claim %q, failure %v", key, ctrl.claimQueue.NumRequeues(obj))
|
||||
ctrl.claimQueue.AddRateLimited(obj)
|
||||
} else if ctrl.claimQueue.NumRequeues(obj) < ctrl.failedProvisionThreshold {
|
||||
glog.Warningf("Retrying syncing claim %q because failures %v < threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold)
|
||||
klog.Warningf("Retrying syncing claim %q because failures %v < threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold)
|
||||
ctrl.claimQueue.AddRateLimited(obj)
|
||||
} else {
|
||||
glog.Errorf("Giving up syncing claim %q because failures %v >= threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold)
|
||||
glog.V(2).Infof("Removing PVC %s from claims in progress", key)
|
||||
klog.Errorf("Giving up syncing claim %q because failures %v >= threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold)
|
||||
klog.V(2).Infof("Removing PVC %s from claims in progress", key)
|
||||
ctrl.claimsInProgress.Delete(key) // This can leak a volume that's being provisioned in the background!
|
||||
// Done but do not Forget: it will not be in the queue but NumRequeues
|
||||
// will be saved until the obj is deleted from kubernetes
|
||||
|
|
@ -995,13 +1010,13 @@ func (ctrl *ProvisionController) processNextVolumeWorkItem(ctx context.Context)
|
|||
|
||||
if err := ctrl.syncVolumeHandler(ctx, key); err != nil {
|
||||
if ctrl.failedDeleteThreshold == 0 {
|
||||
glog.Warningf("Retrying syncing volume %q, failure %v", key, ctrl.volumeQueue.NumRequeues(obj))
|
||||
klog.Warningf("Retrying syncing volume %q, failure %v", key, ctrl.volumeQueue.NumRequeues(obj))
|
||||
ctrl.volumeQueue.AddRateLimited(obj)
|
||||
} else if ctrl.volumeQueue.NumRequeues(obj) < ctrl.failedDeleteThreshold {
|
||||
glog.Warningf("Retrying syncing volume %q because failures %v < threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedDeleteThreshold)
|
||||
klog.Warningf("Retrying syncing volume %q because failures %v < threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedDeleteThreshold)
|
||||
ctrl.volumeQueue.AddRateLimited(obj)
|
||||
} else {
|
||||
glog.Errorf("Giving up syncing volume %q because failures %v >= threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedDeleteThreshold)
|
||||
klog.Errorf("Giving up syncing volume %q because failures %v >= threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedDeleteThreshold)
|
||||
// Done but do not Forget: it will not be in the queue but NumRequeues
|
||||
// will be saved until the obj is deleted from kubernetes
|
||||
}
|
||||
|
|
@ -1047,7 +1062,7 @@ func (ctrl *ProvisionController) syncVolumeHandler(ctx context.Context, key stri
|
|||
return err
|
||||
}
|
||||
if !exists {
|
||||
utilruntime.HandleError(fmt.Errorf("volume %q in work queue no longer exists", key))
|
||||
// Already deleted, nothing to do anymore.
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1075,20 +1090,20 @@ func (ctrl *ProvisionController) syncClaim(ctx context.Context, obj interface{})
|
|||
// Provisioning is 100% finished / not in progress.
|
||||
switch err {
|
||||
case nil:
|
||||
glog.V(5).Infof("Claim processing succeeded, removing PVC %s from claims in progress", claim.UID)
|
||||
klog.V(5).Infof("Claim processing succeeded, removing PVC %s from claims in progress", claim.UID)
|
||||
case errStopProvision:
|
||||
glog.V(5).Infof("Stop provisioning, removing PVC %s from claims in progress", claim.UID)
|
||||
klog.V(5).Infof("Stop provisioning, removing PVC %s from claims in progress", claim.UID)
|
||||
// Our caller would requeue if we pass on this special error; return nil instead.
|
||||
err = nil
|
||||
default:
|
||||
glog.V(2).Infof("Final error received, removing PVC %s from claims in progress", claim.UID)
|
||||
klog.V(2).Infof("Final error received, removing PVC %s from claims in progress", claim.UID)
|
||||
}
|
||||
ctrl.claimsInProgress.Delete(string(claim.UID))
|
||||
return err
|
||||
}
|
||||
if status == ProvisioningInBackground {
|
||||
// Provisioning is in progress in background.
|
||||
glog.V(2).Infof("Temporary error received, adding PVC %s to claims in progress", claim.UID)
|
||||
klog.V(2).Infof("Temporary error received, adding PVC %s to claims in progress", claim.UID)
|
||||
ctrl.claimsInProgress.Store(string(claim.UID), claim)
|
||||
} else {
|
||||
// status == ProvisioningNoChange.
|
||||
|
|
@ -1172,7 +1187,7 @@ func (ctrl *ProvisionController) shouldProvision(ctx context.Context, claim *v1.
|
|||
claimClass := util.GetPersistentVolumeClaimClass(claim)
|
||||
class, err := ctrl.getStorageClass(claimClass)
|
||||
if err != nil {
|
||||
glog.Errorf("Error getting claim %q's StorageClass's fields: %v", claimToClaimKey(claim), err)
|
||||
klog.Errorf("Error getting claim %q's StorageClass's fields: %v", claimToClaimKey(claim), err)
|
||||
return false, err
|
||||
}
|
||||
if class.Provisioner != ctrl.provisionerName {
|
||||
|
|
@ -1300,7 +1315,7 @@ func (ctrl *ProvisionController) rescheduleProvisioning(ctx context.Context, cla
|
|||
// here
|
||||
// (https://github.com/kubernetes/client-go/blob/eb0bad8167df60e402297b26e2cee1bddffde108/tools/cache/store.go#L154-L162).
|
||||
// Log the error and hope that a regular cache update will resolve it.
|
||||
glog.Warningf("update claim informer cache for PersistentVolumeClaim %q: %v", claimToClaimKey(newClaim), err)
|
||||
klog.Warningf("update claim informer cache for PersistentVolumeClaim %q: %v", claimToClaimKey(newClaim), err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
@ -1314,16 +1329,16 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
// Most code here is identical to that found in controller.go of kube's PV controller...
|
||||
claimClass := util.GetPersistentVolumeClaimClass(claim)
|
||||
operation := fmt.Sprintf("provision %q class %q", claimToClaimKey(claim), claimClass)
|
||||
glog.Info(logOperation(operation, "started"))
|
||||
klog.Info(logOperation(operation, "started"))
|
||||
|
||||
// A previous doProvisionClaim may just have finished while we were waiting for
|
||||
// the locks. Check that PV (with deterministic name) hasn't been provisioned
|
||||
// yet.
|
||||
pvName := ctrl.getProvisionedVolumeNameForClaim(claim)
|
||||
volume, err := ctrl.client.CoreV1().PersistentVolumes().Get(ctx, pvName, metav1.GetOptions{})
|
||||
if err == nil && volume != nil {
|
||||
_, exists, err := ctrl.volumes.GetByKey(pvName)
|
||||
if err == nil && exists {
|
||||
// Volume has been already provisioned, nothing to do.
|
||||
glog.Info(logOperation(operation, "persistentvolume %q already exists, skipping", pvName))
|
||||
klog.Info(logOperation(operation, "persistentvolume %q already exists, skipping", pvName))
|
||||
return ProvisioningFinished, errStopProvision
|
||||
}
|
||||
|
||||
|
|
@ -1331,14 +1346,14 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
// provisioned)
|
||||
claimRef, err := ref.GetReference(scheme.Scheme, claim)
|
||||
if err != nil {
|
||||
glog.Error(logOperation(operation, "unexpected error getting claim reference: %v", err))
|
||||
klog.Error(logOperation(operation, "unexpected error getting claim reference: %v", err))
|
||||
return ProvisioningNoChange, err
|
||||
}
|
||||
|
||||
// Check if this provisioner can provision this claim.
|
||||
if err = ctrl.canProvision(ctx, claim); err != nil {
|
||||
ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, "ProvisioningFailed", err.Error())
|
||||
glog.Error(logOperation(operation, "failed to provision volume: %v", err))
|
||||
klog.Error(logOperation(operation, "failed to provision volume: %v", err))
|
||||
return ProvisioningFinished, errStopProvision
|
||||
}
|
||||
|
||||
|
|
@ -1346,14 +1361,14 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
// retry the claim because the storageClass can be fixed/(re)created independently of the claim
|
||||
class, err := ctrl.getStorageClass(claimClass)
|
||||
if err != nil {
|
||||
glog.Error(logOperation(operation, "error getting claim's StorageClass's fields: %v", err))
|
||||
klog.Error(logOperation(operation, "error getting claim's StorageClass's fields: %v", err))
|
||||
return ProvisioningFinished, err
|
||||
}
|
||||
if !ctrl.knownProvisioner(class.Provisioner) {
|
||||
// class.Provisioner has either changed since shouldProvision() or
|
||||
// annDynamicallyProvisioned contains different provisioner than
|
||||
// class.Provisioner.
|
||||
glog.Error(logOperation(operation, "unknown provisioner %q requested in claim's StorageClass", class.Provisioner))
|
||||
klog.Error(logOperation(operation, "unknown provisioner %q requested in claim's StorageClass", class.Provisioner))
|
||||
return ProvisioningFinished, errStopProvision
|
||||
}
|
||||
|
||||
|
|
@ -1361,7 +1376,11 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
if ctrl.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.11.0")) {
|
||||
// Get SelectedNode
|
||||
if nodeName, ok := getString(claim.Annotations, annSelectedNode, annAlphaSelectedNode); ok {
|
||||
selectedNode, err = ctrl.client.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) // TODO (verult) cache Nodes
|
||||
if ctrl.nodeLister != nil {
|
||||
selectedNode, err = ctrl.nodeLister.Get(nodeName)
|
||||
} else {
|
||||
selectedNode, err = ctrl.client.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) // TODO (verult) cache Nodes
|
||||
}
|
||||
if err != nil {
|
||||
err = fmt.Errorf("failed to get target node: %v", err)
|
||||
ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, "ProvisioningFailed", err.Error())
|
||||
|
|
@ -1383,7 +1402,7 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
if err != nil {
|
||||
if ierr, ok := err.(*IgnoredError); ok {
|
||||
// Provision ignored, do nothing and hope another provisioner will provision it.
|
||||
glog.Info(logOperation(operation, "volume provision ignored: %v", ierr))
|
||||
klog.Info(logOperation(operation, "volume provision ignored: %v", ierr))
|
||||
return ProvisioningFinished, errStopProvision
|
||||
}
|
||||
err = fmt.Errorf("failed to provision volume with StorageClass %q: %v", claimClass, err)
|
||||
|
|
@ -1397,14 +1416,14 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
//
|
||||
// `selectedNode` must be removed to notify scheduler to schedule again.
|
||||
if errLabel := ctrl.rescheduleProvisioning(ctx, claim); errLabel != nil {
|
||||
glog.Info(logOperation(operation, "volume rescheduling failed: %v", errLabel))
|
||||
klog.Info(logOperation(operation, "volume rescheduling failed: %v", errLabel))
|
||||
// If unsetting that label fails in ctrl.rescheduleProvisioning, we
|
||||
// keep the volume in the work queue as if the provisioner had
|
||||
// returned ProvisioningFinished and simply try again later.
|
||||
return ProvisioningFinished, err
|
||||
}
|
||||
// Label was removed, stop working on the volume.
|
||||
glog.Info(logOperation(operation, "volume rescheduled because: %v", err))
|
||||
klog.Info(logOperation(operation, "volume rescheduled because: %v", err))
|
||||
return ProvisioningFinished, errStopProvision
|
||||
}
|
||||
|
||||
|
|
@ -1417,7 +1436,7 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
return result, err
|
||||
}
|
||||
|
||||
glog.Info(logOperation(operation, "volume %q provisioned", volume.Name))
|
||||
klog.Info(logOperation(operation, "volume %q provisioned", volume.Name))
|
||||
|
||||
// Set ClaimRef and the PV controller will bind and set annBoundByController for us
|
||||
volume.Spec.ClaimRef = claimRef
|
||||
|
|
@ -1434,11 +1453,14 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
metav1.SetMetaDataAnnotation(&volume.ObjectMeta, annClass, claimClass)
|
||||
}
|
||||
|
||||
glog.Info(logOperation(operation, "succeeded"))
|
||||
klog.Info(logOperation(operation, "succeeded"))
|
||||
|
||||
if err := ctrl.volumeStore.StoreVolume(claim, volume); err != nil {
|
||||
return ProvisioningFinished, err
|
||||
}
|
||||
if err = ctrl.volumes.Add(volume); err != nil {
|
||||
utilruntime.HandleError(err)
|
||||
}
|
||||
return ProvisioningFinished, nil
|
||||
}
|
||||
|
||||
|
|
@ -1447,58 +1469,49 @@ func (ctrl *ProvisionController) provisionClaimOperation(ctx context.Context, cl
|
|||
// (requeue the volume) or not
|
||||
func (ctrl *ProvisionController) deleteVolumeOperation(ctx context.Context, volume *v1.PersistentVolume) error {
|
||||
operation := fmt.Sprintf("delete %q", volume.Name)
|
||||
glog.Info(logOperation(operation, "started"))
|
||||
klog.Info(logOperation(operation, "started"))
|
||||
|
||||
// This method may have been waiting for a volume lock for some time.
|
||||
// Our check does not have to be as sophisticated as PV controller's, we can
|
||||
// trust that the PV controller has set the PV to Released/Failed and it's
|
||||
// ours to delete
|
||||
newVolume, err := ctrl.client.CoreV1().PersistentVolumes().Get(ctx, volume.Name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if !ctrl.shouldDelete(ctx, newVolume) {
|
||||
glog.Info(logOperation(operation, "persistentvolume no longer needs deletion, skipping"))
|
||||
return nil
|
||||
}
|
||||
|
||||
err = ctrl.provisioner.Delete(ctx, volume)
|
||||
err := ctrl.provisioner.Delete(ctx, volume)
|
||||
if err != nil {
|
||||
if ierr, ok := err.(*IgnoredError); ok {
|
||||
// Delete ignored, do nothing and hope another provisioner will delete it.
|
||||
glog.Info(logOperation(operation, "volume deletion ignored: %v", ierr))
|
||||
klog.Info(logOperation(operation, "volume deletion ignored: %v", ierr))
|
||||
return nil
|
||||
}
|
||||
// Delete failed, emit an event.
|
||||
glog.Error(logOperation(operation, "volume deletion failed: %v", err))
|
||||
klog.Error(logOperation(operation, "volume deletion failed: %v", err))
|
||||
ctrl.eventRecorder.Event(volume, v1.EventTypeWarning, "VolumeFailedDelete", err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
glog.Info(logOperation(operation, "volume deleted"))
|
||||
klog.Info(logOperation(operation, "volume deleted"))
|
||||
|
||||
// Delete the volume
|
||||
if err = ctrl.client.CoreV1().PersistentVolumes().Delete(ctx, volume.Name, metav1.DeleteOptions{}); err != nil {
|
||||
// Oops, could not delete the volume and therefore the controller will
|
||||
// try to delete the volume again on next update.
|
||||
glog.Info(logOperation(operation, "failed to delete persistentvolume: %v", err))
|
||||
klog.Info(logOperation(operation, "failed to delete persistentvolume: %v", err))
|
||||
return err
|
||||
}
|
||||
|
||||
if ctrl.addFinalizer {
|
||||
if len(newVolume.ObjectMeta.Finalizers) > 0 {
|
||||
if len(volume.ObjectMeta.Finalizers) > 0 {
|
||||
// Remove external-provisioner finalizer
|
||||
|
||||
// need to get the pv again because the delete has updated the object with a deletion timestamp
|
||||
newVolume, err := ctrl.client.CoreV1().PersistentVolumes().Get(ctx, volume.Name, metav1.GetOptions{})
|
||||
volumeObj, exists, err := ctrl.volumes.GetByKey(volume.Name)
|
||||
if err != nil {
|
||||
// If the volume is not found return, otherwise error
|
||||
if !apierrs.IsNotFound(err) {
|
||||
glog.Info(logOperation(operation, "failed to get persistentvolume to update finalizer: %v", err))
|
||||
return err
|
||||
}
|
||||
klog.Info(logOperation(operation, "failed to get persistentvolume to update finalizer: %v", err))
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
// If the volume is not found return
|
||||
return nil
|
||||
}
|
||||
newVolume, ok := volumeObj.(*v1.PersistentVolume)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected volume but got %+v", volumeObj)
|
||||
}
|
||||
finalizers := make([]string, 0)
|
||||
for _, finalizer := range newVolume.ObjectMeta.Finalizers {
|
||||
if finalizer != finalizerPV {
|
||||
|
|
@ -1513,7 +1526,7 @@ func (ctrl *ProvisionController) deleteVolumeOperation(ctx context.Context, volu
|
|||
if !apierrs.IsNotFound(err) {
|
||||
// Couldn't remove finalizer and the object still exists, the controller may
|
||||
// try to remove the finalizer again on the next update
|
||||
glog.Info(logOperation(operation, "failed to remove finalizer for persistentvolume: %v", err))
|
||||
klog.Info(logOperation(operation, "failed to remove finalizer for persistentvolume: %v", err))
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -1521,9 +1534,12 @@ func (ctrl *ProvisionController) deleteVolumeOperation(ctx context.Context, volu
|
|||
}
|
||||
}
|
||||
|
||||
glog.Info(logOperation(operation, "persistentvolume deleted"))
|
||||
klog.Info(logOperation(operation, "persistentvolume deleted"))
|
||||
|
||||
glog.Info(logOperation(operation, "succeeded"))
|
||||
if err = ctrl.volumes.Delete(volume); err != nil {
|
||||
utilruntime.HandleError(err)
|
||||
}
|
||||
klog.Info(logOperation(operation, "succeeded"))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import (
|
|||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/tools/record"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
"k8s.io/klog"
|
||||
klog "k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// VolumeStore is an interface that's used to save PersistentVolumes to API server.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
glog "k8s.io/klog"
|
||||
klog "k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// Common allocation units
|
||||
|
|
@ -107,10 +107,10 @@ func FindDNSIP(ctx context.Context, client kubernetes.Interface) (dnsip string)
|
|||
var dnssvc *v1.Service
|
||||
coredns, err := client.CoreV1().Services(metav1.NamespaceSystem).Get(ctx, "coredns", metav1.GetOptions{})
|
||||
if err != nil {
|
||||
glog.Warningf("error getting coredns service: %v. Falling back to kube-dns\n", err)
|
||||
klog.Warningf("error getting coredns service: %v. Falling back to kube-dns\n", err)
|
||||
kubedns, err := client.CoreV1().Services(metav1.NamespaceSystem).Get(ctx, "kube-dns", metav1.GetOptions{})
|
||||
if err != nil {
|
||||
glog.Errorf("error getting kube-dns service: %v\n", err)
|
||||
klog.Errorf("error getting kube-dns service: %v\n", err)
|
||||
return ""
|
||||
}
|
||||
dnssvc = kubedns
|
||||
|
|
@ -118,7 +118,7 @@ func FindDNSIP(ctx context.Context, client kubernetes.Interface) (dnsip string)
|
|||
dnssvc = coredns
|
||||
}
|
||||
if len(dnssvc.Spec.ClusterIP) == 0 {
|
||||
glog.Errorf("DNS service ClusterIP bad\n")
|
||||
klog.Errorf("DNS service ClusterIP bad\n")
|
||||
return ""
|
||||
}
|
||||
return dnssvc.Spec.ClusterIP
|
||||
|
|
@ -126,16 +126,16 @@ func FindDNSIP(ctx context.Context, client kubernetes.Interface) (dnsip string)
|
|||
|
||||
// LookupHost looks up IP addresses of hostname on specified DNS server
|
||||
func LookupHost(hostname string, serverip string) (iplist []string, err error) {
|
||||
glog.V(4).Infof("lookuphost %q on %q\n", hostname, serverip)
|
||||
klog.V(4).Infof("lookuphost %q on %q\n", hostname, serverip)
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion(dns.Fqdn(hostname), dns.TypeA)
|
||||
in, err := dns.Exchange(m, JoinHostPort(serverip, "53"))
|
||||
if err != nil {
|
||||
glog.Errorf("dns lookup of %q failed: err %v", hostname, err)
|
||||
klog.Errorf("dns lookup of %q failed: err %v", hostname, err)
|
||||
return nil, err
|
||||
}
|
||||
for _, a := range in.Answer {
|
||||
glog.V(4).Infof("lookuphost answer: %v\n", a)
|
||||
klog.V(4).Infof("lookuphost answer: %v\n", a)
|
||||
if t, ok := a.(*dns.A); ok {
|
||||
iplist = append(iplist, t.A.String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue