Commit Graph

692 Commits (c7947abd9c9729ea491fcd583be8a585cc90f30e)

Author SHA1 Message Date
Meir Fischer 9076e78654 change strValues's type to util.StringSet; rename Comparator to Operator; small syntax fix 2014-07-31 23:56:37 -04:00
Daniel Smith 7dbb6f02fe Begin systemizing files in pkg/registry
Files that have RESTStorage implementations now end in "storage", and
files that have registries now end in "registry". I removed some
underscores in file names, since it seems to be go style not to have
them. I split minion_registry.go into two files.

We should consider splitting this package into two, to make more clear
the separation between the layers.
2014-07-31 17:24:15 -07:00
Clayton Coleman af4d57b39a Expand apiserver tests 2014-07-31 18:59:54 -04:00
Clayton Coleman 8986a0fc4b Remove debugging statement 2014-07-31 18:52:15 -04:00
Daniel Smith 928092e79e Etcd watcher verification
To make sure the etcd watcher works, I changed the replication
controller to use watch.Interface. I made apiserver support watches on
controllers, so replicationController can be run only off of the
apiserver. I made sure all the etcd watch testing that used to be in
replicationController is now tested on the new etcd watcher in
pkg/tools/.
2014-07-31 14:54:30 -07:00
Daniel Smith aa454fea93 Merge pull request #711 from smarterclayton/more_info_about_format_conversion_error
More verbose error on missing field
2014-07-31 14:34:09 -07:00
Clayton Coleman e1b0000404 Merge pull request #717 from nyaxt/atomicupdate_test
Add test for AtomicUpdate
2014-07-31 16:44:24 -04:00
Clayton Coleman 7ce23e43e7 More verbose error on missing field 2014-07-31 14:38:38 -04:00
Clayton Coleman 28d42a79a4 Merge pull request #719 from csrwng/list_replication_controllers
Add a method to list replication controllers
2014-07-31 14:34:58 -04:00
csrwng 19ddfe72df Fixed FakeKubeClient in kubecfg_test 2014-07-31 13:59:58 -04:00
Kouhei Ueno d4a5ba863d Add test for AtomicUpdate 2014-08-01 02:35:38 +09:00
Kouhei Ueno 648b80e5d7 Implement FakeEtcdClient.ExpectNotFoundGet 2014-08-01 02:35:38 +09:00
Kouhei Ueno a3771c9042 AtomicUpdate should use api.Encode 2014-08-01 02:35:38 +09:00
Kouhei Ueno 6dd1e9cbb5 Implement FakeEtcdClient.CompareAndSwap 2014-08-01 02:35:38 +09:00
Kouhei Ueno ccb7e8793b return EtcdErrorNodeExist when Create is called for existing node 2014-08-01 02:35:37 +09:00
Kouhei Ueno d46bfcb132 Fail immediately if f.Err is set 2014-08-01 02:35:37 +09:00
Kouhei Ueno e40cdd50ed Generate modification index only if f.TestIndex is specified.
This is for compatibility with existing tests.
2014-08-01 02:34:08 +09:00
Kouhei Ueno b82bb37c89 FakeEtcdClient: Maintain change index 2014-08-01 02:34:08 +09:00
Dawn Chen 2e8020be8c Update the entire cAdvisor package. There is a version mismatch issue
which cause #707
2014-07-31 10:11:25 -07:00
csrwng a3476fcbca Add a method to list replication controllers 2014-07-31 12:37:02 -04:00
Dawn Chen 76ec7acf91 bump(github.com/google/cadvisor): bdd574b728e8a1e5eb08649d631197620dd09650 2014-07-31 09:14:04 -07:00
Meir Fischer 80b1fa000e structured message for selector; matching functionality 2014-07-31 00:29:42 -04:00
Filipe Brandenburger de405ac126 Improve generation of version information from the git tree
Detect whether the tree is dirty and append a "-dirty" indication to the
git commit (common practice with other repos, e.g. kernel, docker.)

Properly handle the case where a git tree is not found (e.g. building
from archive.)

In the sed expression, look for the variable to be updated
(commitFromGit) instead of hardcoding a line number.

Tested:

- Built from a dirty tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 2d784c684c75-dirty

- Built from a clean tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 505f23a31172

- Built from an archive:
    $ hack/build-go.sh
    WARNING: unable to find git commit, falling back to commitFromGit = `(none)`
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build (none)

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:57 -07:00
Filipe Brandenburger 7e56609139 Handle -version flag on all commands
Tested: Passed -version argument to kubelet (and all other binaries):
  $ output/go/bin/kubecfg -version
  Kubernetes version 0.1, build 6454a541fd56

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:56 -07:00
brendandburns 76e2cd70f7 Merge pull request #683 from smarterclayton/slightly_pause_on_return
Slightly pause on requests to allow most to finish
2014-07-30 16:05:15 -07:00
Dawn Chen 21513b1e08 Merge pull request #691 from dchen1107/restart
Add RestartPolicy to Pod and PodTemplate
2014-07-30 15:32:20 -07:00
Dawn Chen 2740fb0abf Add RestartPolicy to Pod and PodTemplate 2014-07-30 15:31:27 -07:00
Daniel Smith c5ca032287 Merge pull request #706 from brendandburns/proxy
Revert the revert and fix tests.
2014-07-30 15:19:12 -07:00
brendandburns 59c5fb11c0 Merge pull request #672 from lavalamp/customConversionFuncs
Custom conversion funcs
2014-07-30 15:09:01 -07:00
Brendan Burns 2cbe2c18d4 Add a comment to tickle travis. 2014-07-30 15:06:56 -07:00
Daniel Smith ce586c1448 Test both directions of the conversion. 2014-07-30 15:04:01 -07:00
Brendan Burns 9519a8049b Fixed tests. 2014-07-30 15:02:36 -07:00
Clayton Coleman 1bdeb058e1 Slightly pause on requests to allow most to finish
Currently, every write will result in a 202 (etcd adding a few
ms of latency to each request).  This forces clients to go into
a poll loop and pick a reasonable server poll frequency, which
results in 1 + N queries to the server for the single operation
and adds unavoidable latency to each request which affects their
perception of the service.

Add a very slight (25ms by default) delay to wait for requests
to finish.  For clients doing normal writes this reduces the
requests made against the server to 1.  For clients on long requests
this has no effect.  The downside is that http connections are held
on to for a longer period in high write loads.  The decrease in
perceived latency from the kubecfg is significant.
2014-07-30 17:49:47 -04:00
brendandburns 2486414c16 Merge pull request #690 from smarterclayton/refactor_apiserver_changes
Clean up pkg/apiserver
2014-07-30 14:41:00 -07:00
brendandburns 5443929b84 Merge pull request #702 from fsouza/update-go-dockerclient
third_party: update go-dockerclient
2014-07-30 14:25:37 -07:00
Daniel Smith 242c8cdaec Add custom conversion function system.
As an example, demonstrate how Env.Key's deprecation ought to work.
2014-07-30 14:18:23 -07:00
Clayton Coleman e64a393e1a Move handle* methods to their respective locations
Fix names
2014-07-30 17:15:09 -04:00
Clayton Coleman fe7f611d88 Split operations code and add comments 2014-07-30 17:15:09 -04:00
Clayton Coleman 9069696514 Rename write -> writeJSON 2014-07-30 17:15:09 -04:00
Clayton Coleman b84c9f7a1c Rename methods and move parseTimeout 2014-07-30 17:15:09 -04:00
Clayton Coleman 82b78912fc Move prefix methods 2014-07-30 17:15:09 -04:00
Clayton Coleman a2c86e4c97 Simplify helpers 2014-07-30 17:15:09 -04:00
Clayton Coleman c7d311896e Shorten variable name 2014-07-30 17:15:09 -04:00
Clayton Coleman 8b511832ff Split minion 2014-07-30 17:15:09 -04:00
Clayton Coleman a46f6313bc Split interfaces 2014-07-30 17:15:09 -04:00
Clayton Coleman d5e22bfe2a Split index 2014-07-30 17:14:07 -04:00
Clayton Coleman b70a145161 Split operations test 2014-07-30 17:14:06 -04:00
Clayton Coleman db51ea2a17 Split async 2014-07-30 17:14:06 -04:00
Clayton Coleman b911d9265a Split watch 2014-07-30 17:14:06 -04:00
erictune a41aeeca67 Merge pull request #701 from SebastianM/misspelling
fix misspelling
2014-07-30 13:36:14 -07:00
Francisco Souza 2a345ffa9e third_party: update go-dockerclient
math.MaxInt64 represents 8 exabytes, which is a good limit for memory.
Also, this is the type used by Docker, so it's not possible to get any
value bigger than math.MaxInt64 as memory limit (both ram and swap) on a
Docker container.

Relevant discussion at #589 (more precisely,
https://github.com/GoogleCloudPlatform/kubernetes/pull/589#issuecomment-50640605).
2014-07-30 15:18:42 -03:00
Sebastian Müller e1172fc78c fix misspelling 2014-07-30 20:10:12 +02:00
Clayton Coleman dc6fdc423d Merge pull request #627 from lavalamp/fix
Add /version to server and check it in client.
2014-07-30 12:52:15 -04:00
Dan McPherson d94f5c3360 Fixing typo 2014-07-30 16:45:53 +02:00
Brendan Burns 448a4b7d69 Revert "Revert "Add support for stopping a proxier.""
This reverts commit 19beaf71b5.
2014-07-30 06:52:03 -07:00
brendandburns 0ad9221f5c Merge pull request #695 from danmcp/fix_golint_warnings
Fixing golint warnings
2014-07-30 06:49:27 -07:00
Dan McPherson d5fcaa1f03 Fixing golint warnings 2014-07-30 13:41:09 +02:00
Daniel Smith 19beaf71b5 Revert "Add support for stopping a proxier." 2014-07-29 23:24:57 -07:00
Daniel Smith 00bdeecb63 Merge pull request #682 from brendandburns/proxy
Add support for stopping a proxier.
2014-07-29 23:20:55 -07:00
brendandburns b0d18b2af0 Merge pull request #571 from lavalamp/master
Decode/Encode everywhere
2014-07-29 17:19:33 -07:00
Daniel Smith 2396bdfa1b Incorporate new types into versioned api system.
* Made externalize/internalize generic to prevent boilerplate.
* Add fuzz testing.
* All objects pass fuzz tests now.
* This turned up some things we'll need to fix eventually. Left TODOs.
2014-07-29 15:46:57 -07:00
Brendan Burns 99f0d2e807 Add support for stopping a proxier. 2014-07-29 15:40:47 -07:00
Rohit Jnagal fbd3e85e9c Fix handling of default cpu shares. 2014-07-29 18:34:16 +00:00
Daniel Smith e10d85efce Merge pull request #685 from smarterclayton/error_on_empty_service
Cleanly delete service without endpoints key
2014-07-29 09:45:31 -07:00
Daniel Smith 4a1660be7c Merge pull request #679 from dchen1107/minionlogs
Fix #663
2014-07-29 09:37:55 -07:00
Daniel Smith 2a0b82a4ed Merge pull request #681 from brendandburns/noisy
Make file error logging edge triggered to reduce log spam.
2014-07-29 09:27:25 -07:00
Clayton Coleman a49b331794 Cleanly delete service without endpoints key
If a service is deleted before the etcd key corresponding to its
endpoints has been created, a 500 error is returned (etcd key
not found).  Instead, key not found should be ignored silently.

There is a potential race condition with the controller creating
endpoints after the service has been deleted which a cleanup task
should handle in the future.

Closes #684
2014-07-29 11:44:46 -04:00
Brendan Burns aa703a4e72 Make file error logging edge triggered to reduce log spam. 2014-07-29 05:38:07 -07:00
Dawn Chen 58008510a0 Fix #663
Return all healthy minions instead of only returning the first several
healthy minions. Without the PR, if the first minion failed with health
check, the machine list is empty, thus GET /api/v1beta1/pods failed
with code 500
2014-07-29 00:24:53 -07:00
Daniel Smith f87bd6b8f9 Merge pull request #628 from jdef/master
named container ports should have sane env var names
2014-07-28 23:05:48 -07:00
Daniel Smith cd0b25f1e5 Merge pull request #639 from rafael/validate_pods
Validate pod on create and update.
2014-07-28 18:49:51 -07:00
Rafael Chacón c9a3ab168d Validate pod on create and update.
* This commit adds pod validations on when creating and updating a pod.
2014-07-28 18:02:30 -07:00
Daniel Smith 1d044e5912 Merge pull request #649 from kelseyhightower/improve_volume_test_coverage
volume: improve test coverage and minor refactoring
2014-07-28 17:46:23 -07:00
Daniel Smith 811d710385 Merge pull request #674 from brendandburns/service
Don't hard code load balancer zone.
2014-07-28 17:15:22 -07:00
Dawn Chen 3627bb5190 Merge pull request #675 from dchen1107/minionlogs
Instead of apiserver panic when proxy a request to a dead minion,
2014-07-28 17:03:02 -07:00
Dawn Chen 8e9864e8fc Instead of apiserver panic when proxy a request to a dead minion,
print out proper message through http.Response
2014-07-28 16:40:29 -07:00
Brendan Burns c717b872a3 Don't hard code load balancer zone. 2014-07-28 15:54:16 -07:00
Daniel Smith 3b8488028d Add /version to server and check it in client.
Will help detect client/version skew and prevent e2e test from passing
while running a version other than the one you think it's running.
2014-07-28 15:45:25 -07:00
Daniel Smith 31a78c3e2b Merge pull request #619 from brendandburns/controller
Make individual controller actions asynchronous.
2014-07-28 15:35:19 -07:00
Brendan Burns 1a3e4f8baf Add some more synchronization. 2014-07-28 15:05:39 -07:00
brendandburns 71b14b464a Merge pull request #623 from smarterclayton/validate_replication_controllers
Add validation to ReplicationControllers
2014-07-28 14:46:47 -07:00
Clayton Coleman 46bb48cf13 Merge pull request #648 from kelseyhightower/improve_health_test_coverage
health: Improve test coverage
2014-07-28 17:08:33 -04:00
Daniel Smith c92e8d38b6 Merge pull request #642 from kelseyhightower/cleanup_master_configs
Add master.Config type and cleanup master configuration
2014-07-28 12:53:31 -07:00
Daniel Smith b3cc696486 All types stored in etcd are now API objects.
This means I made an api.ContainerManifestList, and added a JSONBase to
endpoints (and changed Name -> JSONBase.ID).
2014-07-28 11:27:36 -07:00
Brendan Burns f1d6069b01 Use Decode/Encode in etcd_tools 2014-07-28 11:27:36 -07:00
brendandburns b34a3c8c21 Merge pull request #630 from lavalamp/fuzz
Add go fuzzer in preparation for testing.
2014-07-28 10:44:59 -07:00
brendandburns f073cee13b Merge pull request #636 from kelseyhightower/load_auth_info_tests
kubecfg: improve tests around authentication
2014-07-28 10:44:27 -07:00
Clayton Coleman 4ee3deaaf7 Merge pull request #647 from kelseyhightower/fix_extra_test_flags
Remove extra test flags from all commands
2014-07-28 12:58:57 -04:00
Dan McPherson c4f4f69b93 Fixing Typos 2014-07-28 15:56:20 +02:00
Dan McPherson 7bbc5e2a19 Fixing typos 2014-07-28 15:15:50 +02:00
Daniel Smith d09b164e67 Add TODOs, clean up, clarify comments, and add one more test. 2014-07-27 19:32:37 -07:00
Clayton Coleman 5bc19584a5 Update Service and ReplControllers to validate
Validations are performed on update and on create.
2014-07-27 19:55:03 -04: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
Kelsey Hightower 87fa19cdfe Remove extra test flags from all commands
Currently all commands are being build with extra flags. The extra
flags appear because of a direct import of the testing package from
the fake_etcd_client.go source file.

Remove the direct import of the testing package. Add a tools.T
interface to support existing behavior. Also clean up two TODO items
by remove using of the expectError and expectNoError functions.

Fixes #579
2014-07-27 14:19:18 -07:00
Kelsey Hightower 7b59845843 volume: improve test coverage and minor refactoring
The volume package does not test enough use-cases.

Improve test coverage by adding additional tests and refactoring
current tests to use table testing.

This change introduces a new error var to make testing unsupported
volume type errors easier.

This change does not introduce any changes in behavior.
2014-07-27 14:11:19 -07:00
Clayton Coleman 1047c57c6d Use http.StatusInternalServerError instead of 500 2014-07-27 15:37:03 -04:00
Kelsey Hightower c860ac3afc health: Improve test coverage 2014-07-27 08:44:59 -07:00
Kelsey Hightower 1ca199379f kubecfg: improve tests around authentication
This change adds additional test coverage for the kubecfg
command. There is now a test for the case when the auth info
file does not exist. LoadAuthInfo tests have been refactored
to use table testing.
2014-07-26 22:21:17 -07:00
Kelsey Hightower 6d1be5f0ee Add master.Config type and cleanup master configuration
Setting up a new master.Master instance requires passing
around too many arguments.

Add a master.Config type and group related master configs.
Refactor all commands to instantiate new masters using a
master.Config struct.
2014-07-26 22:07:24 -07:00
Kelsey Hightower 200b2c0ba7 httplog: Improve test coverage 2014-07-26 21:17:10 -07:00