Commit Graph

64 Commits

Author SHA1 Message Date
Clayton Coleman
bddef32193 Prepare EtcdHelper to extract more data from Node
In order to support graceful deletion, the resource object will
need access to the TTL value in etcd.  Also, in the future we
may want to get the creation index (distinct from modifiedindex)
and expose it to clients.  Change EtcdResourceVersioner to be
more type specific (objects vs lists) and provide a default
implementation that relies on the internal API convention.

Also, rename etcd_tools.go to etcd_helper.go and split a few
things up.
2015-03-16 15:33:50 -04:00
Clayton Coleman
4ca90e0343 FakeEtcdClient should return KeyNotFound on Delete 2015-03-16 14:22:03 -04:00
Jerzy Szczepkowski
ba9d02c0c7 Cleanup: removed BoundPodFactory.
Removed unused code: BoundPodFactory. Fixes #5384.
2015-03-13 10:44:25 +01:00
Salvatore Dario Minonne
925fa6baf8 Adding fields selector 2015-03-10 22:13:10 +01:00
Mike Danese
5cbf89c060 plumb through changes on ReplicationController and Service 2015-03-04 10:38:42 -08:00
Clayton Coleman
3d290089ae Minimal status mutation change
PUT /api/v1beta3/namespaces/default/pods/foo/status
    {
      "metadata": {...}, // allowed for valid values
      "spec": {}, // ignored
      "status": {...}, // allowed, except for Host
    }

Exposes the simplest possibly change. Needs a slight refactoring
to RESTUpdateStrategy to split merging which can be done in a
follow up.
2015-03-01 22:35:17 -05:00
Daniel Smith
650f6cb826 Revert "Multi-port Endpoints" 2015-02-23 13:53:21 -08:00
Tim Hockin
160f288832 Implement multi-port Endpoints
This is a part of multi-port services.
2015-02-22 09:35:12 -08:00
Tim Hockin
ae0062d001 Part 2 of plural ports: make endpoints a struct
Includes conversions for v1b[12] and tests and fixups for call sites.
2015-02-18 19:54:15 -08:00
Tim Hockin
34eaa0dbd6 Part 1 of plural ports: Add protocol to Endpoints
This makes it easier to make the second step, which is moving endpoints
to a struct instead of a string.
2015-02-18 18:58:04 -08:00
Clayton Coleman
7a93af57c0 Remove pods from pkg/registry/etcd/etcd.go since they are in their own type
Altered the master initialization code
2015-02-16 10:09:27 -05:00
Saad Ali
3bc8f4e793 Merge pull request #4359 from erictune/no_bound_pod_envs
Stop putting env vars into BoundPods.
2015-02-12 09:12:19 -08:00
Eric Tune
5b4569697f Stop putting env vars into BoundPods.
They will still show up in etcd.  They never were available
through the API.

A subsequent PR(s) will rip out all BoundPods code.
Working in small increments.

This PR will cause users on lagging cloud providers
to not get env vars in their pods if they update to this code.
They have already been warned via email.

Removed unit tests of BasicBoundPodFactory.
There is adequate coverage in pkg/kubelet/kubelet_test.go.
2015-02-12 08:37:23 -08:00
Clayton Coleman
6f85b655cc Bindings were not correctly removed across namespaces on pod update and delete
BoundPods must be checked for Name and Namespace equality, not just name
equality. In the future, we should also check for UID equality.
2015-02-11 14:35:28 -05:00
Yu-Ju Hong
4a72addaeb Factor out API defaulting from validation logic
Currently, the validation logic validates fields in an object and supply default
values wherever applies. This change factors out defaulting to a set of
defaulting callback functions for decoding (see #1502 for more discussion).

 * This change is based on pull request 2587.

 * Most defaulting has been migrated to defaults.go where the defaulting
   functions are added.

 * validation_test.go and converter_test.go have been adapted to not testing the
   default values.

 * Fixed all tests with that create invalid objects with the absence of
   defaulting logic.
2015-02-03 00:55:42 -08:00
Paul Morie
fd834ae84d Pods should see services only from their own ns 2015-01-14 17:06:36 -05:00
Daniel Smith
35f54addca Update more packages, tests, binaries for quantity
make etcd registry pass test
fix kubelet config for quantity
fix openstack for quantity
fix controller for quantity
fix last tests for quantity
wire into binaries
fix controller manager
fix build for 32 bit systems
2015-01-07 15:21:35 -08:00
Deyuan Deng
45bfcb451b Enable watch on node changes. 2014-12-16 08:12:31 +08:00
Daniel Smith
272bfc97ed Merge pull request #2788 from smarterclayton/roundtrip_node_nodelist
Rename Minions -> Nodes internally
2014-12-10 11:12:15 -08:00
Clayton Coleman
19379b5a38 Internal rename api.Minion -> api.Node 2014-12-10 12:08:18 -05:00
Deyuan Deng
76552423f9 Move watch filter into storage level 2014-12-04 20:15:27 -05:00
markturansky
8af4ccb111 v1beta3 Pod refactor 2014-11-18 09:25:42 -05:00
Daniel Smith
178d0af795 Fix watch for events; add test for interface implementation so it won't break again. 2014-11-12 15:22:08 -08:00
Clayton Coleman
94c873e7a4 Remaining refactor for PodTemplateSpec and fixing test cases 2014-11-11 17:03:20 -05:00
markturansky
bd7643c033 refactor services to v1beta3 2014-11-04 14:23:53 -05:00
deads2k
613bf93eaf expose ParseWatchResourceVersion for downstream use 2014-10-28 16:29:33 -04:00
Clayton Coleman
644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman
91d9a90e4e Replace use of "id" in strings with "name" 2014-10-22 15:59:12 -04:00
Clayton Coleman
bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Daniel Smith
f1e0290605 fix broken test 2014-10-17 15:21:03 -07:00
derekwaynecarr
1d6c937183 Wrong method call to watch service endpoints key 2014-10-17 13:34:42 -04:00
Clayton Coleman
26cff8b9bf Rename the etcd path for pods to be /registry/nodes/<>/boundpods 2014-10-16 19:29:08 -04:00
Clayton Coleman
6ae611aedd Write BoundPods to etcd instead of ContainerManifestList
Rename ManifestFactory -> BoundPodFactory and change the general structure
of the call to focus on BoundPod.
2014-10-16 19:29:08 -04:00
derekwaynecarr
085ca40291 Enforce unique constraint at namespace boundary in etcd, make client and server namespace aware 2014-10-16 13:02:52 -04:00
Brendan Burns
4380637be7 Add update to the pod etcd handler. 2014-10-13 17:27:31 -07:00
Deyuan Deng
15e5b876b8 Change ContainsMinion to GetMinion 2014-10-08 23:41:15 -04:00
Clayton Coleman
82bcdd3b3b Make ResourceVersion a string internally instead of uint64
Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.

This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.
2014-10-07 19:00:26 -04:00
Deyuan Deng
4de810efb4 Rebase to master, change JSONBase to TypeMeta. 2014-10-07 16:22:36 -04:00
Deyuan Deng
c3d9197a4b Rename InsertMinion to CreateMinion. 2014-10-07 16:22:35 -04:00
Deyuan Deng
4a35325f29 Use etcd as backend for minion registry. 2014-10-07 16:22:35 -04: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
derekwaynecarr
b7fcc7d3ec Add ctx to registry test cases 2014-09-26 15:19:22 -04:00
derekwaynecarr
be85ad7a3d Add context object in test cases flows 2014-09-26 11:50:34 -04:00
Brendan Burns
253bce42fe Extract the minion registry from the etcd implementation into the pod registry where it belongs. 2014-09-23 15:42:59 -07:00
Clayton Coleman
5483333e29 Allow server and client to take api version as argument
* Defaults to v1beta1
* apiserver takes -storage_version which controls etcd storage version
  and the version of the client used to connect to other apiservers
* Changed signature of client.New to add version parameter
* All controller code and component code prefers the oldest (most common)
  server version
2014-09-18 23:27:28 -04:00
Clayton Coleman
61e3ce7ddc Make runtime less global for Codec
* Make Codec separate from Scheme
* Move EncodeOrDie off Scheme to take a Codec
* Make Copy work without a Codec
* Create a "latest" package that imports all versions and
  sets global defaults for "most recent encoding"
  * v1beta1 is the current "latest", v1beta2 exists
  * Kill DefaultCodec, replace it with "latest.Codec"
  * This updates the client and etcd to store the latest known version
* EmbeddedObject is per schema and per package now
* Move runtime.DefaultScheme to api.Scheme
* Split out WatchEvent since it's not an API object today, treat it
like a special object in api
* Kill DefaultResourceVersioner, instead place it on "latest" (as the
  package that understands all packages)
* Move objDiff to runtime.ObjectDiff
2014-09-16 16:26:43 -04:00
Clayton Coleman
154a91cd33 Rename runtime.DefaultScheme to latest.Codec for ease of readability 2014-09-16 16:19:35 -04:00
Clayton Coleman
fe614aeda2 Simple refactor for ease of readability
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04:00
Clayton Coleman
3ffe259ac7 Return standard API errors from etcd registry by operation
Adds pkg/api/errors/etcd, which defines default conversions
for common CRUD operations from etcd to api.
2014-09-08 18:46:01 -04:00
Daniel Smith
fc09f988b4 Make tests pass again 2014-09-07 22:26:42 -07:00