Commit Graph

196 Commits

Author SHA1 Message Date
Daniel Smith
f0b5fba988 Improve cache behavior
* don't block while filling cache
* make cache wait for pending calls
2015-01-12 16:20:25 -08:00
Daniel Smith
6e70853e83 genericize ip cache 2015-01-12 16:04:43 -08:00
Tim Hockin
4fcd496d59 change everything to use new util/errors 2015-01-08 22:10:03 -08:00
Tim Hockin
cd29ba7ebc Add new util/errors pkg 2015-01-08 21:59:23 -08:00
Joe Beda
7abd90e9df Generic way to import 'flag' flags into the 'pflag' system.
Start with kubectl but with an eye toward switching everything over to pflag.
2015-01-08 15:25:31 -08:00
Clayton Coleman
7fd887df61 Enable v1beta3 API via --runtime_config=api/v1beta3 flag
This exposes the proper v1beta3 API endpoint when the user specifies
the --runtime_config=api/v1beta3 argument to the apiserver. v1beta3
is still considered experimental and subject to change.

--runtime_config is a map of string keys and values, that can be
specified by providing

    --runtime_config=a=b,b=c,d,e

Only the key must be specified, the value can be omitted.

Enables v1beta3 in hack/local-up-cluster.sh and hack/test-cmd.sh
2015-01-08 13:01:24 -05:00
Daniel Smith
894a3e6d3f Wire resource.Quantity into api 2015-01-07 15:21:34 -08:00
Rohit Jnagal
62ecd5f3ff Fix few vet errors.
There are quite a few 'composite literal uses unkeyed fields' errors that I have kept out of this patch.
And there's a couple where vet just seems confused. These are the easiest ones.
2015-01-07 08:40:16 +00:00
Joe Beda
b736b42585 Merge pull request #3224 from liggitt/self_signed
Automatically serve API on https with self-signed cert if no cert is provided
2015-01-06 10:29:05 -08:00
Eric Tune
25a19039fb Merge pull request #3250 from a-robinson/failure
Minor doc/comment fixes that came up while reading through some code.
2015-01-06 10:18:36 -08:00
Alex Robinson
d8dab5dfb9 Minor doc/comment fixes that came up while reading through some code. 2015-01-06 18:05:33 +00:00
Jordan Liggitt
b36a44f036 Automatically serve API on https with self-signed cert 2015-01-06 09:36:29 -05:00
saadali
4bf191a30a Update copyright year for files created today to current year 2015-01-05 17:01:02 -08:00
Tim Hockin
03baa7234a Merge pull request #3225 from dchen1107/clean
Move GetHostName and GetDockerEndpoint methods to pkg/util
2015-01-05 16:21:51 -08:00
saadali
f92f830e1f Modify hash to be computed using spew library so that nested object values are used instead of pointer 2015-01-05 15:48:06 -08:00
Dawn Chen
f718957a79 Move GetHostName and GetDockerEndpoint methods to pkg/util 2015-01-05 11:44:21 -08:00
Tim Hockin
e4d239cbb1 Util to test if all ptr fields are nil 2015-01-03 23:57:43 -08:00
Tim Hockin
fc69379b8c Add a util/mount pkg 2014-12-30 14:38:49 -08:00
Tim Hockin
e045c6ce2f Split portals into host and container
After this DNS is resolvable from the host, if the DNS server is targetted
explicitly.  This does NOT add the cluster DNS to the host's resolv.conf.  That
is a larger problem, with distro-specific tie-ins and circular deps.
2014-12-29 09:18:12 -08:00
Vishnu Kannan
6f53f33fda Set oom_score_adj for kubelet and kube-proxy to a low value to help them survive system memory pressure. 2014-12-24 00:34:28 +00:00
Daniel Smith
545d87d554 Move clock to util 2014-12-22 14:14:03 -08:00
Joe Beda
93ed9173e3 Merge pull request #2781 from commonlisp/master
simplify util.ErrorList by eliminating errorListInternal
2014-12-16 15:43:55 -08:00
Brendan Burns
2d1b279311 Merge pull request #2905 from smarterclayton/misc_cleanup
Small fixes to prepare for v1beta3
2014-12-15 11:49:29 -08:00
Clayton Coleman
a636e44e3d Add a side-by-side diff option for verbose output
Make regular diff better by eliding pointer values
2014-12-12 18:14:46 -05:00
George Kuan
5e1fc1f4e0 Fixes #1605: make ErrorList introspectable by replacing ErrorList and
ErrorList#ToError with []error and util.SliceToError() respectively
2014-12-12 10:56:31 -08:00
Clayton Coleman
c5ba95ee26 Add Type() method on flags for compat with pflag library
Allows our flag objects to be used with both golang flags and pflags
2014-12-11 20:10:54 -05:00
Jordan Liggitt
51bfb50698 Use util.Time consistently in types.go 2014-12-11 11:14:25 -05:00
Satnam Singh
7582884f30 Do not consider an empty string to be an error in list.go 2014-12-10 11:41:13 -08:00
Clayton Coleman
2c27f7d332 Allow an empty service 2014-12-09 12:48:53 -05:00
Tim Hockin
5ecce5d60c Add util to validate namespaced names 2014-12-08 15:31:43 -08:00
Eric Tune
64f1084c1a Rename util.config.Watcher -> util.config.Broadcaster.
Watch is a widely used term in the codebase, which doesn't capture
the key feature of this type: broadcasting a change to several
listeners.
2014-12-04 00:10:27 -08:00
Tim Hockin
c31b3f04de Merge pull request #2722 from thockin/iptables
strip quotes in back-compat iptables
2014-12-03 16:10:00 -08:00
Daniel Smith
7aaf76af6e Merge pull request #2661 from smarterclayton/allow_loops_to_exit
Add a util.Forever variant that ends on a stop channel
2014-12-03 11:52:59 -08:00
Tim Hockin
b1470b6672 strip quotes in back-compat iptables 2014-12-03 08:34:34 -08:00
Sam Ghods
6399854240 Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
2014-12-02 16:25:28 -08:00
Sam Ghods
9a9a1e0939 Move from go-yaml/yaml to ghodss/yaml 2014-12-02 16:24:05 -08:00
Tim Hockin
89875ef09d Loosen DNS 952 for labels 2014-12-01 12:30:43 -08:00
Clayton Coleman
740b824ac2 Add a util.Forever variant that ends on a stop channel 2014-11-28 15:15:52 -05:00
Tim Hockin
e925deccb0 Fix iptables for old systems
The iptables args list needs to include all fields as they are eventually spit
out by iptables-save.  This is because some systems do not support the
'iptables -C' arg, and so fall back on parsing iptables-save output.  If this
does not match, it will not pass the check.  For example: adding the /32 on
the destination IP arg is not strictly required, but causes this list to not
match the final iptables-save output.  This is fragile and I hope one day we
can stop supporting such old iptables versions.
2014-11-26 12:50:44 -08:00
Tim Hockin
95a9098311 fix 'go vet' warnings 2014-11-21 09:45:28 +08:00
Tim Hockin
ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00
Deyuan Deng
762e9a0f57 Create a backgroud task to register static list of machines. 2014-11-20 20:22:32 -05:00
Tim Hockin
8fdaa5d453 Merge pull request #2067 from hmrm/iptables-compatibility
Remove iptables >1.4.11 specific functionality
2014-11-18 08:54:38 -08:00
Haney Maxwell
5d69faa6d6 Allow proxy to run on systems with iptables <1.4.11 2014-11-17 13:37:46 -08:00
Tim Hockin
9c218f0a19 Cleanups of ipv6 changes.
I was late re-reviewing and some comments did not get resolved.
2014-11-17 09:33:14 -08:00
Brendan Burns
2aa52d043b Add external services v2 support. 2014-11-14 11:32:54 -08:00
Brendan Burns
c2485a4056 Merge pull request #2147 from justinsb/ipv6
Initial ipv6 / iptables work
2014-11-14 10:34:37 -08:00
Clayton Coleman
6d31c2bf8a util.EncodeJSON proven harmful, remove it everywhere
People were misusing EncodeJSON in tests when they should be using
runtime.EncodeOrDie(testapi.Codec(), obj).  Removing the potential
for cutting self on sharp objects.
2014-11-13 10:38:13 -05:00
Justin SB
9a053a4b59 Initial ipv6 / iptables work 2014-11-03 15:23:04 -08:00
Brendan Burns
a624630112 Add some blocking so that we don't generate identical UUIDs for API objects. 2014-11-03 13:27:59 -08:00
Deyuan Deng
acf9d23b32 Stop httptest server. 2014-10-30 21:37:08 -04:00
Daniel Smith
d05dad6c59 Add runner utility. 2014-10-29 11:29:28 -07:00
Brendan Burns
b59e49fa13 Add support for git volumes. 2014-10-27 16:35:52 -07:00
Daniel Smith
15c5012933 Add lock to fake handler to avoid races. 2014-10-15 17:46:28 -07:00
Clayton Coleman
935e97d59d Move ObjectDiff into util 2014-10-09 17:23:43 -04:00
deads2k
e348b939bf make api match intent with less specific type 2014-10-08 10:01:55 -04:00
Tim Hockin
45f9f39b51 Merge pull request #1597 from thockin/iptables
Add a pkg for iptables support
2014-10-07 17:31:34 -07:00
Brendan Burns
5bdb061f14 Fix the exec test, on os x false and true have different paths, but they're in $PATH on all. 2014-10-07 13:26:25 -07:00
Tim Hockin
4bbe6a10ff Add a pkg for iptables support
This makes iptables an injectable dependency.  The test for this started off
simple, but got a bit out of hand.  It's starting to become a mocking
framework.
2014-10-07 11:36:46 -07:00
Daniel Smith
051d50e98d Merge pull request #1592 from thockin/utilexec
Add a util/exec interface for testing execs.
2014-10-07 11:26:27 -07:00
Clayton Coleman
d3e51a0f24 Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
2014-10-07 11:12:16 -04:00
Tim Hockin
0d74fe74cd Add a flag-compatible wrapper for net.IPNet 2014-10-06 18:28:49 -07:00
Daniel Smith
6449b30ca4 Merge pull request #1593 from thockin/utilerrlist
Move ErrorList to util
2014-10-06 16:59:34 -07:00
Tim Hockin
20a1829dad Add a util/exec interface for testing execs. 2014-10-06 16:52:25 -07:00
Tim Hockin
7e83211840 Move ErrorList to util 2014-10-06 12:12:35 -07:00
Tim Hockin
0ad0a247c4 Flag-compatible IP type 2014-10-06 11:29:22 -07:00
Clayton Coleman
ff2eca97d9 Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases.
* Supports KUBE_API_VERSION on test cases for controlling which
  api version they test against
* Provides a common flag registration method for CLIs that need
  to connect to an API server (to avoid duplicating flags)
* Ensures errors are properly returned by the server
* Add a Context field to client.Config
2014-10-01 15:23:37 -04:00
Brendan Burns
3ac706a32e Add a rate limiter, use it to rate limit docker pulls. 2014-09-26 11:55:21 -07:00
Jessica Forrester
becf6ca4e7 Move RecoverPanics to be the top level wrapped handler. Add new method to be sure a logger has been generated instead of assuming one has. Move regexp list compilation into a utility and pass regexp list into CORS. 2014-09-09 17:50:18 -04:00
Vojtech Vitek (V-Teq)
59f58cd043 Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:03 +02:00
Daniel Smith
dd862a7c53 Fix flaky scheduler factory test. 2014-08-28 20:32:20 -07:00
Clayton Coleman
9006eadcfe kube-proxy can read config from the apiserver
All clients that talk to a "master" as a host:port or URL
(scheme://host:port) parameter.  Add tests.
2014-08-27 15:49:01 -04:00
Clayton Coleman
286c3c543c Improve the wait.Poll GoDoc and api
Add more tests, and switch to timeouts instead of cycles.
Deflake TestPoller
2014-08-23 12:18:03 -04:00
Clayton Coleman
1c68247954 Merge pull request #909 from lavalamp/scheduler3
Scheduler plugin v1
2014-08-21 19:04:51 -04:00
Paul Morie
47fd5842ad Fix typo in tests 2014-08-21 17:02:28 -04:00
brendandburns
8f5dd8cf63 Merge pull request #984 from thockin/make_vs_new
Rename a bunch of "Make" functions to "New"
2014-08-20 22:06:57 -07:00
Tim Hockin
0f97a73c1b Rename a bunch of "Make" functions to "New"
Also rename some to other names that make better reading.  There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things.  It seemed that "make" there seemed fine.  "New"
is for "constructors".
2014-08-20 21:27:19 -07:00
brendandburns
1bd4ae0c62 Merge pull request #943 from smarterclayton/only_wait_for_acceptance
Clients must wait for completion of actions
2014-08-20 21:01:21 -07:00
Daniel Smith
8a9eaf911f For testability & reuse, move scheduler setup into its own package. 2014-08-20 16:50:02 -07:00
Clayton Coleman
493863eb93 Return immediately when controllers/pods are committed
Add client waiting conditions.
2014-08-20 18:46:10 -04:00
Paul Morie
5331cd6ec0 Add missing case for IntOrString unit tests 2014-08-20 17:22:29 -04:00
derekwaynecarr
8c07a0f524 Fix verify-boilerplate 2014-08-15 13:12:01 -05:00
Paul Morie
c69160059b Change CreationTimestamp to a util.Time and set in each storage implementation
Because time.Time doesn't work correctly with our YAML package, it is necessary
to introduce a type, util.Time, which serializes correctly to JSON and YAML.

Eventually we would like timestamping to cut across storage implementations;
for now, we set it in each storage.
2014-08-14 16:26:29 -04:00
Daniel Smith
ab24790e8f Fix go files with wrong boilerplate 2014-08-12 17:48:00 -07:00
Tim Hockin
7201227cb1 Use IntOrString for HTTP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in HTTP health checks.  Improve tests.
2014-08-10 23:26:42 -07:00
Daniel Smith
079c9043bd Switch to new external fuzz package 2014-08-08 15:54:09 -07:00
Tim Hockin
37309ece6d Rename files: stringlist -> list (similar to set) 2014-08-06 20:13:40 -07:00
Brendan Burns
20a8f03d62 Add dns-952-identifier validation to service ids. 2014-08-05 11:40:48 -07:00
brendandburns
d4860c21a9 Merge pull request #752 from smarterclayton/remove_expect_no_error_util
Remove expectNoError from client, kubelet, and util
2014-08-04 09:15:22 -07:00
Clayton Coleman
f7149926c0 Remove expectNoError from client, kubelet, and util 2014-08-04 09:39:06 -04:00
Daniel Smith
828aed4cc8 Copy docker client structs, adding yaml/json tags.
Use these in our v1beta1 package so that we can pass fuzz test encode/decode.
2014-08-01 15:31:39 -07:00
Daniel Smith
d09b164e67 Add TODOs, clean up, clarify comments, and add one more test. 2014-07-27 19:32:37 -07:00
Daniel Smith
aa92dd7fb2 Add go fuzzer in preparation for testing. Also gofmt a few files that needed it. 2014-07-27 14:54:48 -07:00
Jonathan Boulle
c43035088b assorted formatting and typo fixes 2014-07-24 15:10:36 -07:00
Daniel Smith
05f01a3654 Revert "assorted formatting and typo fixes" 2014-07-18 17:16:30 -07:00
Daniel Smith
211f6b312f Merge pull request #520 from jonboulle/master
assorted formatting and typo fixes
2014-07-18 17:15:30 -07:00
Danny Jones
136c9e112c Renames HasAll to IsSuperset; HasAll uses slice.
For the pedants. HasAll is now called IsSuperset and
the new HasAll method takes a slice instead of a set.
2014-07-18 13:58:43 -07:00
Danny Jones
2d9bad95f8 Added HasAll utility method for string set.
Added HasAll method which detects if one set contains all
of the memebers of another set.

A.HasAll(B) returns true if A is a superset of B.
2014-07-18 13:19:55 -07:00
Jonathan Boulle
9e63c3a633 assorted formatting and typo fixes 2014-07-18 13:02:59 -07:00
Clayton Coleman
38ec4ff8c0 Create a configuration update utility
Extracted from proxy/config
2014-07-16 14:13:25 -04:00