VOL-1497 : Add more control to kv/memory access
- Added kv locking mechanism (etcd only)
- (watch) control path access whenever possible
- (watch) use a transaction for updates and merge with memory
- cleaned up vendoring
- misc changes to fix exceptions found along the way
Amendments:
- Copyright header got removed in auto-generated file
- Changed default locking to false for KV list operation
- Updated backend api to allow the passing of locking parameter
Change-Id: Ie1a55d3ca8b9d92ae71a85ce42bb22fcf1419e2c
diff --git a/vendor/k8s.io/klog/.travis.yml b/vendor/k8s.io/klog/.travis.yml
index fc0d2ca..0f508da 100644
--- a/vendor/k8s.io/klog/.travis.yml
+++ b/vendor/k8s.io/klog/.travis.yml
@@ -1,4 +1,5 @@
language: go
+go_import_path: k8s.io/klog
dist: xenial
go:
- 1.9.x
diff --git a/vendor/k8s.io/klog/CONTRIBUTING.md b/vendor/k8s.io/klog/CONTRIBUTING.md
index de47115..574a56a 100644
--- a/vendor/k8s.io/klog/CONTRIBUTING.md
+++ b/vendor/k8s.io/klog/CONTRIBUTING.md
@@ -8,10 +8,6 @@
We have full documentation on how to get started contributing here:
-<!---
-If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources
--->
-
- [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
@@ -20,12 +16,7 @@
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
-<!---
-Custom Information - if you're copying this template for the first time you can add custom content here, for example:
-
## Contact Information
-- [Slack channel](https://kubernetes.slack.com/messages/kubernetes-users) - Replace `kubernetes-users` with your slack channel string, this will send users directly to your channel.
-- [Mailing list](URL)
-
--->
+- [Slack](https://kubernetes.slack.com/messages/sig-architecture)
+- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture)
diff --git a/vendor/k8s.io/klog/OWNERS b/vendor/k8s.io/klog/OWNERS
index 56b0eb0..d0168e8 100644
--- a/vendor/k8s.io/klog/OWNERS
+++ b/vendor/k8s.io/klog/OWNERS
@@ -1,4 +1,4 @@
-# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
+# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- dims
diff --git a/vendor/k8s.io/klog/README.md b/vendor/k8s.io/klog/README.md
index a747f53..6cb6d16 100644
--- a/vendor/k8s.io/klog/README.md
+++ b/vendor/k8s.io/klog/README.md
@@ -5,6 +5,32 @@
----
+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/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
====
@@ -26,20 +52,20 @@
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")
diff --git a/vendor/k8s.io/klog/code-of-conduct.md b/vendor/k8s.io/klog/code-of-conduct.md
new file mode 100644
index 0000000..0d15c00
--- /dev/null
+++ b/vendor/k8s.io/klog/code-of-conduct.md
@@ -0,0 +1,3 @@
+# Kubernetes Community Code of Conduct
+
+Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md)
diff --git a/vendor/k8s.io/klog/klog.go b/vendor/k8s.io/klog/klog.go
index 13bcc81..733d14b 100644
--- a/vendor/k8s.io/klog/klog.go
+++ b/vendor/k8s.io/klog/klog.go
@@ -43,7 +43,7 @@
// Logs are written to standard error instead of to files.
// -alsologtostderr=false
// Logs are written to standard error as well as to files.
-// -stderrthreshold=ERROR
+// -stderrthreshold=INFO
// Log events at or above this severity are logged to standard
// error as well as to files.
// -log_dir=""
@@ -396,8 +396,8 @@
}
func init() {
- // Default stderrThreshold is ERROR.
- logging.stderrThreshold = errorLog
+ // Default stderrThreshold is INFO.
+ logging.stderrThreshold = infoLog
logging.setVState(0, nil, false)
go logging.flushDaemon()
@@ -410,9 +410,9 @@
}
flagset.StringVar(&logging.logDir, "log_dir", "", "If non-empty, write log files in this directory")
flagset.StringVar(&logging.logFile, "log_file", "", "If non-empty, use this log file")
- flagset.BoolVar(&logging.toStderr, "logtostderr", false, "log to standard error instead of files")
+ flagset.BoolVar(&logging.toStderr, "logtostderr", true, "log to standard error instead of files")
flagset.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files")
- flagset.Var(&logging.verbosity, "v", "log level for V logs")
+ flagset.Var(&logging.verbosity, "v", "number for the log level verbosity")
flagset.BoolVar(&logging.skipHeaders, "skip_headers", false, "If true, avoid header prefixes in the log messages")
flagset.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr")
flagset.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging")
@@ -739,7 +739,9 @@
}
data := buf.Bytes()
if l.toStderr {
- os.Stderr.Write(data)
+ if s >= l.stderrThreshold.get() {
+ os.Stderr.Write(data)
+ }
} else {
if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() {
os.Stderr.Write(data)
@@ -934,7 +936,7 @@
return nil
}
-const flushInterval = 30 * time.Second
+const flushInterval = 5 * time.Second
// flushDaemon periodically flushes the log file buffers.
func (l *loggingT) flushDaemon() {