Commit Graph

504 Commits (4c413e794ef04081dd5ed41bbe0b61fc0acc819f)

Author SHA1 Message Date
Brendan Burns f556f2f82f Add some validation for externalized service ports. 2014-11-03 13:36:34 -08:00
Dawn Chen 81785d8cde Merge pull request #2124 from brendandburns/fix
Make endpoints return 400 instead of 500
2014-11-03 08:38:34 -08:00
markturansky 2260b241dc Removed 'Metadata' from all types 2014-11-03 08:47:22 -05:00
Brendan Burns 32a04e48fd Make endpoints return 400 instead of 500 2014-11-02 20:08:06 -08:00
Clayton Coleman 8a2d778248 Merge pull request #2066 from lavalamp/eventing2
Event fixes
2014-10-30 14:19:19 -04:00
Daniel Smith a7cc25f7ff Add namespaces to event creation path. 2014-10-29 18:03:14 -07:00
Clayton Coleman 2c10dd85c3 Merge pull request #2047 from smarterclayton/make_request_testable
Make client.Request/RESTClient more testable and fakeable
2014-10-29 19:33:36 -04:00
Daniel Smith ab9346d107 Use ID instead of Name in v1beta1 & 2 2014-10-29 15:13:44 -07:00
Clayton Coleman 71fecef6f6 Add test coverage and fix a few minor problems 2014-10-29 14:08:37 -04:00
Daniel Smith 94e736e286 Merge pull request #2009 from smarterclayton/unify_meta
Unify Accessor for ObjectMeta/TypeMeta/ListMeta
2014-10-29 09:58:46 -07:00
Clayton Coleman eac933eb44 Make client.Request more testable, break coupling with RESTClient
Moves polling to a function provided by the RESTClient, not innate
to Request. Moves doRequest from RESTClient to Request for clarity.
2014-10-28 23:00:24 -04:00
Dawn Chen f6db096741 Merge pull request #2022 from brendandburns/gc
Add container garbage collection.
2014-10-28 13:37:16 -07:00
Daniel Smith 55c9c06b81 Merge pull request #2001 from VojtechVitek/fix_scheme_panic
Fix reflect panic in runtime/conversion
2014-10-28 13:30:40 -07:00
Brendan Burns 51bf451932 Add container garbage collection. 2014-10-28 12:52:06 -07:00
Vojtech Vitek (V-Teq) 90809c270d Use conversion.EnforcePtr() where appropriate
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-10-28 16:36:09 +01:00
Tim Hockin 9a617344bf Merge pull request #1945 from brendandburns/tests
Add support for git volumes.
2014-10-27 16:55:37 -07:00
Brendan Burns b59e49fa13 Add support for git volumes. 2014-10-27 16:35:52 -07:00
Tim Hockin bb5ca0f91b Respect a requested PortalIP if possible 2014-10-27 14:03:52 -07:00
Clayton Coleman 66ace4c270 Begin to unify ResourceVersioner and SelfLinker
Create a new MetadataAccessor interface that combines both
and use it where previously latest.ResourceVersioner and SelfLinker
were being used.

Adds Namespace to the get/set interface. Adds TODO about future
fast path for metadata (as per thockin's comment)
2014-10-27 16:00:55 -04:00
Tim Hockin 37ffb41b81 Merge pull request #1830 from markturansky/label_validation
add RFC952 validation to labels
2014-10-27 09:54:18 -07:00
Brendan Burns 5d4d60783d Add requirements based scheduling. 2014-10-25 22:08:00 -07:00
Brendan Burns 87c77e5ba7 Start adding git volumes. 2014-10-24 20:44:08 -07:00
markturansky e2365b1f96 add RFC952 label validation 2014-10-24 16:01:52 -04:00
Tim Hockin d6effe3c6d Rename api ErrorList for clarity 2014-10-24 09:43:14 -07:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman 2475eb06cb Remove use of embedded TypeMeta accessor 2014-10-24 11:22:20 -04:00
Clayton Coleman 0f011a055f Implement conversions for v1beta1/2 to internal ObjectMeta 2014-10-24 11:22:20 -04:00
Clayton Coleman 09800643e2 Change validation now that namespace is on ObjectMeta 2014-10-24 11:22:20 -04:00
Clayton Coleman 55163a7df1 Split TypeMeta into ObjectMeta and TypeMeta 2014-10-24 11:22:20 -04:00
Clayton Coleman 3df1c2f29d Use meta.Interface and meta.Accessor 2014-10-23 18:01:25 -04:00
Clayton Coleman e5c924585c Add support for ObjectMeta and ListMeta lookup 2014-10-22 23:56:49 -04:00
Clayton Coleman 35eaf90255 Add UID to MetaAccessor and Ref 2014-10-22 22:59:15 -04:00
Clayton Coleman 1ccb86c760 Rename methods in api/meta to be cleaner 2014-10-22 22:59:12 -04:00
Clayton Coleman 64d98cba73 Move typemeta.go to api/meta/meta.go
Prepares for the meta object to front multiple underlying types
when TypeMeta and ObjectMeta is split in internal and v1beta3, but
combined in v1beta1 and v1beta2
2014-10-22 22:28:06 -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 ad1212b9af Add client time to events 2014-10-22 11:12:17 -07:00
Daniel Smith 0c58ee98c8 Error instead of crash on GetRef of nil object 2014-10-17 10:49:43 -07: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
Clayton Coleman 892942af8f Read BoundPods from etcd instead of ContainerManifestList
There are three values that uniquely identify a pod on a host -
the configuration source (etcd, file, http), the pod name, and the
pod namespace. This change ensures that configuration properly
makes those names unique by changing podFullName to contain both
name (currently ID in v1beta1, Name in v1beta3) and namespace.

The Kubelet does not properly handle information requests for
pods not in the default namespace at this time.
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
Tim Hockin e907011111 Core support for ip-per-service 2014-10-16 08:36:47 -07:00
Eric Tune 6f577aa321 Merge pull request #1789 from lavalamp/eventing4
Add event creation library and implement in scheduler.
2014-10-15 15:55:26 -07:00
Daniel Smith 2987747a0f Merge pull request #1794 from brendandburns/e2e
Add a pod update e2e test in go. Also adjust validation logic a little.
2014-10-15 11:59:30 -07:00
Daniel Smith d4c750a878 Fix vet-go.sh and some things it complained about 2014-10-15 11:56:19 -07:00
Daniel Smith 10214457b7 Make scheduler emit events 2014-10-15 11:42:05 -07:00
Brendan Burns 8d38f8890e Add an e2e test in go. Also adjust validation logic a little to make it more reasonable.
Not integrated into existing e2e yet.
2014-10-14 16:43:00 -07:00
Eric Tune bb5a17488f Use Forbidden valdiation error when no capability 2014-10-14 16:14:28 -07:00
Daniel Smith 841e9e87ff Merge pull request #1713 from brendandburns/update
Add update to the pod etcd handler.
2014-10-13 17:42:30 -07:00
Brendan Burns 4380637be7 Add update to the pod etcd handler. 2014-10-13 17:27:31 -07:00
Daniel Smith d34914517f Shorten 'CodecForVersionOrDie' name, add 'ResourceVersioner' to testapi 2014-10-13 14:58:06 -07:00
Brendan Burns 695fbee343 Merge pull request #1742 from dchen1107/termination
Set EmptyDir when VolumeSource is absent.
2014-10-10 16:27:26 -07:00
Dawn Chen c511b7a0ce Fix #1683 2014-10-10 15:34:48 -07:00
Dawn Chen 5f97413dd5 Merge pull request #1663 from smarterclayton/separate_pod_state_for_health_check
Refactor HealthCheck to take podUUID as its own argument
2014-10-10 09:11:59 -07:00
Tim Hockin d84816aaec Merge pull request #1709 from erictune/move_line
Fix format specifiers in Printf-type functions.
2014-10-09 20:40:35 -07:00
Eric Tune 800284164a Fix format specifiers in Printf-type functions. 2014-10-09 17:06:32 -07:00
Clayton Coleman 935e97d59d Move ObjectDiff into util 2014-10-09 17:23:43 -04:00
Clayton Coleman eea77a1449 Backport the BoundPods type to v1beta1/2/internal 2014-10-09 16:39:55 -04:00
erictune aa30423dc9 Merge pull request #1337 from brendandburns/Sarsate-pd-support
Taking over PD support from sarsate
2014-10-09 09:16:04 -07:00
Danny Jones 4ec25f3b81 Adds support for attaching GCEPersitentDisks
Adds GCEPersistentDisk volume struct
Adds gce-utils to attach disk to kubelet's VM.
Updates config to give compute-rw to every minion.
Adds GCEPersistentDisk to API
Adds ability to mount attached disks
Generalizes PD and adds tests.
PD now uses an pluggable API interface.
Unit Tests more cleanly separates TearDown and SetUp
Modify boilerplate hook to omit build tags
Adds Mounter interface; mount is now built by OS
TearDown() for PD now detaches disk on final refcount
Un-generalized PD; GCE calls moved to cloudprovider

Address comments.
2014-10-08 20:03:59 -07:00
Daniel Smith af5714da12 Fix v1beta2 types having been copied incorrectly. 2014-10-08 14:15:50 -07:00
Clayton Coleman 094bc3796a Update ObjectReference to use ResourceVersion string everywhere
Breaks backwards compat for anyone using older versions
2014-10-08 15:57:38 -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
Daniel Smith 7ffe791486 fix error message in validation test 2014-10-07 13:54:41 -07:00
Daniel Smith 3a62089790 Fix malformed namespace json tag 2014-10-07 13:52:51 -07:00
Clayton Coleman 0a4d4b43f6 Move IsAnAPIObject() declarations to register.go
* Add Namespace, UID, Annotations to internal/v1beta1/v1beta2
* Update v1beta3 with minor consistency tweaks
2014-10-07 14:09:01 -04:00
Daniel Smith 0212c9b29a Merge pull request #1623 from smarterclayton/rename_jsonbase
Rename JSONBase -> TypeMeta in preparation for v1beta3
2014-10-07 10:50:28 -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
Clayton Coleman 363d6554ae Move Policy test helpers into their own file
Since types.go should always be equal to latest API types.go, this
makes future cut and paste refactors easier.
2014-10-07 10:24:40 -04:00
Daniel Smith 6449b30ca4 Merge pull request #1593 from thockin/utilerrlist
Move ErrorList to util
2014-10-06 16:59:34 -07:00
Brendan Burns fca26ccc65 Merge pull request #1569 from dchen1107/termination
Initial support to propagating the termination reasons and image failures
2014-10-06 16:56:23 -07:00
Daniel Smith e26bdd0721 Merge pull request #1591 from smarterclayton/simple_test
Add a Log method on Scheme for better debugging
2014-10-06 15:39:51 -07:00
Dawn Chen 4fdfeaa30e Addressed comments. 2014-10-06 14:41:20 -07:00
Dawn Chen a86d496f9a Fix e2e tests. 2014-10-06 13:37:24 -07:00
Dawn Chen 9861eb7c8e Initial support of propogating the termination reasons and image failure
to apiserver. Deprecated docker.Container from API completely.

Conflicts:
	pkg/api/types.go
	pkg/kubelet/kubelet.go
2014-10-06 13:37:22 -07:00
Tim Hockin 7e83211840 Move ErrorList to util 2014-10-06 12:12:35 -07:00
Clayton Coleman 305db35422 Add a Log method on Scheme for better debugging 2014-10-05 17:17:25 -04:00
Meir Fischer 073940e66f minor comment change for grammar/consistency across v1beta* packages 2014-10-05 01:22:05 -04:00
Sam Ghods 3de1317c15 Remove JSONBase reference from v1beta3/types.go 2014-10-03 19:01:26 -07:00
Clayton Coleman 0ff77ffcb3 Some field names in validation.go not consistent
Fields are (for now) JavaScript style field accessors
2014-10-02 23:43:30 -04:00
Tim Hockin 1dda3072a4 Merge pull request #1525 from erictune/rename_dir
Directory renamed to Dir to match json property
2014-10-02 11:28:27 -07:00
erictune 883bb60b3a Merge pull request #1500 from smarterclayton/refactor_client_again
Refactor the client (again) to better support auth
2014-10-01 14:04:57 -07:00
Eric Tune 9c0769422d Directory renamed to Dir to match json property 2014-10-01 13:35:21 -07:00
Tim Hockin 710832b8b6 Merge pull request #1474 from brendandburns/resource
Add a resource fit predicate.
2014-10-01 13:12:28 -07:00
Tim Hockin db49dc0012 Merge pull request #1458 from brendandburns/dontpull
Add the ability to turn off image pulling.
2014-10-01 12:40:47 -07:00
Brendan Burns 39d03948e7 Add resource fit predicates. 2014-10-01 12:38:09 -07:00
Brendan Burns 4c456015b6 Add the ability to turn off image pulling. 2014-10-01 12:34: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
derekwaynecarr 016d394705 Remove redundant code in validation 2014-10-01 14:29:47 -04:00
derekwaynecarr 6625e58a20 Updates to review comments 2014-10-01 10:57:50 -04:00
derekwaynecarr 0312d80ffa Update test cases to use default context 2014-10-01 10:57:50 -04:00
derekwaynecarr e4ec49ee6b Require namespace on controller, pod, service objects 2014-10-01 10:57:50 -04:00
Tim Hockin 88bf01b008 Merge pull request #1225 from smarterclayton/v1beta3_proposals
Proposal: v1beta3 API overhaul
2014-09-30 16:12:13 -07:00
Dawn Chen e284e14222 Merge pull request #1475 from lavalamp/eventing3
Add GetReference()
2014-09-29 09:18:51 -07:00
Clayton Coleman c0247d92ce Proposal for v1beta3 API
* Separate metadata from objects
* Treat lists differently from resources
* Add UID and Annotations on Metadata
* Introduce BoundPod(s) as distinct from Pod to represent pods
  scheduled onto a host
* Use "spec" instead of "state" and "status" instead of "currentState"
  * Identify current status of objects consistently
  * Use "condition" as the string label for substatus
* All string constants should be PublicGoCapitalized
* Rename Minion -> Node
* Rename ServerOp -> Operation
* Remove ContainerManifest
* Add api-conventions.md document
* Replace PodTemplateSpec in ReplCtrl with ObjectReference
2014-09-29 12:10:36 -04:00
Tim Hockin f2cf958540 Caps for CauseType 2014-09-27 21:48:35 -07:00
Tim Hockin e73de49f81 Caps on StatusReason* 2014-09-27 21:38:51 -07:00
Tim Hockin 523731c509 Capitalize Status.Status 2014-09-27 21:23:51 -07:00
Tim Hockin 1c02af3d16 Kill LivenessProbe.Type 2014-09-27 21:16:30 -07:00
Tim Hockin 04cdf286a4 Make and use api.Protocol type 2014-09-27 20:31:37 -07:00
Daniel Smith 6ac7578699 Add GetReference() 2014-09-26 17:40:07 -07:00
Daniel Smith b972f72248 convert multiple return values into a struct, add SelfLinker 2014-09-26 14:52:16 -07:00
derekwaynecarr ee19ba186d Update to use api.Context 2014-09-26 11:50:34 -04:00
derekwaynecarr 3e685674e7 Add context object to interfaces 2014-09-26 11:50:34 -04:00
Clayton Coleman a5ed10235e Merge pull request #1354 from lavalamp/eventing
Add Event to api types
2014-09-25 16:20:49 -04:00
Daniel Smith 283eaf3931 Add new Event type
* replaces previous Event type, which is too limited.
* Remove writing of old event type.
* Fix serialiazation test to automatically test all types.
2014-09-25 11:31:35 -07:00
Brendan Burns 431caa93df Merge pull request #1335 from dchen1107/exit1
Convert existing kubernetes system to use ContainerStatus, instead of
2014-09-24 21:37:24 -07:00
Daniel Smith bb0cd95a83 fix non-gofmt'd things 2014-09-24 14:27:10 -07:00
Dawn Chen 66eadb514a fix rebase issue. 2014-09-24 11:16:47 -07:00
Dawn Chen 0e6ec3cbfc Convert existing kubernetes system to use ContainerStatus, instead of
docker.Container directly.

Conflicts:
	pkg/kubelet/dockertools/docker.go
	pkg/registry/pod/rest.go
2014-09-24 11:16:46 -07:00
Daniel Smith f211e46f20 handle watch errors everywhere 2014-09-22 17:37:12 -07:00
Clayton Coleman fece926e2b Remove unnecessary EmbeddedObjects
Clarify the tests in embedded_test.go to indicate that unmarshalling
of an internal object (runtime.EmbeddedObject) will not work.  Instead,
consumers should decode raw external objects.
2014-09-22 16:03:07 -04:00
Clayton Coleman e3da2ba2c8 Cleanup watch encoding (remove dupe Encoding)
Move standard watch encode / decode streams to use
runtime.RawExtension and embed API decoding based on
a provided codec.
2014-09-22 16:03:07 -04:00
Clayton Coleman 463a16af36 Add benchmarks for API tests 2014-09-19 17:17:54 -04: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
Brendan Burns dc5a4a8c3f Refactor to clean up names. 2014-09-16 15:19:02 -07:00
erictune 506f51b186 Merge pull request #1330 from brendandburns/privilege
Only allow privileged containers if API server flag set.  Adds capabilities package.
2014-09-16 15:12:26 -07:00
Daniel Smith 0b75f7b543 Merge pull request #1275 from smarterclayton/v1beta2
Create v1beta2 and allow multiple Codec encodings to exist
2014-09-16 14:52:04 -07:00
Clayton Coleman 23307344ee Add round trip tests for default encoding
Turn down iterations a bit for speed
2014-09-16 17:27:59 -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 fe614aeda2 Simple refactor for ease of readability
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04:00
Clayton Coleman 10f68902f6 Add v1beta2 API objects 2014-09-16 16:11:26 -04:00
Brendan Burns 5b9e2a55b5 Add a flag to reject privileged containers in the apiserver. 2014-09-16 11:22:32 -07:00
Paul Morie f94198c7a3 Expose validation method for ReplicationControllerState 2014-09-16 12:55:27 -04:00
Dawn Chen d51c28d757 Merge pull request #1304 from brendandburns/valid
Add some lifecycle validation.
2014-09-15 16:50:03 -07:00
Brendan Burns 6efafb141f Add some lifecycle validation. 2014-09-15 16:45:26 -07:00
Daniel Smith 42dafb0e2e add PluginBase to fuzz functions 2014-09-15 13:15:46 -07:00
Clayton Coleman 0a02c6bcdf Exact copy of v1beta1 as v1beta3 for further iteration 2014-09-12 22:02:27 -04:00
Tim Hockin 9f275c81ac add a 'protocol' field to api.Service 2014-09-12 16:38:17 -07:00
Tim Hockin b566339f0c make service validation test be table-driven 2014-09-12 16:38:17 -07:00
Dan Mace 3a3fab3f82 FEATURE: Support privileged containers in a pod
Add a Privileged field to containers in a pod, in order to facilitate pods
performing administrative tasks such as builds via Docker-in-Docker.

Discussion: https://github.com/GoogleCloudPlatform/kubernetes/issues/391
2014-09-12 09:38:11 -07:00
Dawn Chen 7b46d8c9c5 typo 2014-09-11 16:07:56 -07:00
Dawn Chen 25fbe210f6 Clean up 2014-09-11 15:30:06 -07:00
Dawn Chen 3faf393e7b Introduce ContainerStates. Currently keep it has the same set as PodStatus:
Waiting, Running, Termination. For each state, there are some meaningful
status associated with it.
2014-09-11 15:22:53 -07:00
Dawn Chen ee129cd440 Proposed ContainerStatus for each individual Container in a Pod. 2014-09-11 14:34:21 -07:00
Daniel Smith 48913672d9 Merge pull request #1248 from brendandburns/replicas
Make replica controllers return current state.
2014-09-09 16:27:21 -07:00
brendandburns e9d12fef05 Merge pull request #1250 from dchen1107/cleanup
Small clean up in validation.
2014-09-09 16:24:12 -07:00
Dawn Chen 80fa392f6b Small clean up in validation. errs is used as import path alias in validation.go, but it is reused
as a variable for validateVolume.
2014-09-09 16:08:21 -07:00
Brendan Burns 4ba4762827 Insert the current state of a replica controller. 2014-09-09 15:23:34 -07:00
Tim Hockin 4ff76add57 Merge pull request #1147 from dchen1107/restart
Introduce the simplest RestartPolicy and handling.
2014-09-09 14:44:42 -07:00
Dawn Chen 15cab4d053 Introduce the simplest RestartPolicy and handling. 2014-09-08 22:41:38 -07:00
Daniel Smith 41754f5bd4 Merge pull request #1192 from smarterclayton/standardize_etcd_errors
Return standard API errors from etcd registry by operation
2014-09-08 15:57:08 -07: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
Dawn Chen 7ace5a3e83 Passing pod UUID to Kubelet. 2014-09-08 14:24:09 -07:00
Daniel Smith 1c2b65788d Rename Codec and ResourceVersioner to add Default in front, to allow for types of those names 2014-09-07 22:19:24 -07:00
Daniel Smith 828b70abb9 api and api/v1beta1 pass tests again 2014-09-07 22:19:24 -07:00
Daniel Smith 77edb91032 Add Object type to runtime, make runtime test pass. 2014-09-07 22:19:24 -07:00
Daniel Smith 2ba6503511 Add continuation to conversion routines 2014-09-07 22:19:24 -07:00
brendandburns 8e10ee5169 Merge pull request #1197 from lavalamp/fixApi
Rename Object to EmbeddedObject
2014-09-05 21:39:37 -07:00
Daniel Smith 7790961011 Rename Object to EmbeddedObject 2014-09-05 14:43:35 -07:00
Francisco Souza 6d0f84c700 api/v1beta1: use go-dockerclient instead of docker-api-structs
This involves updating go-dockerclient and removing the patched code.

Related to #692 and fsouza/go-dockerclient#146.
2014-09-05 17:31:13 -03:00
Clayton Coleman 34c40e4e48 Errors should be part of api/errors, not apiserver
Renames constructor methods to be errors.New<name> which changed a few
places.
2014-09-03 17:16:00 -04:00
Clayton Coleman 6dd4831de8 Move validation errors into their own file 2014-09-03 17:14:03 -04:00
Clayton Coleman 01e668187c Services and Endpoints weren't properly sync'ing
They need incremental changes and a resync on start.
2014-09-03 16:04:55 -04:00
Brendan Burns dd9ecf5b79 Add types for lifecycle events. 2014-09-02 15:14:13 -07:00
Daniel Smith a63966e73c Combine pkg/apitools and pkg/api/common and call the result pkg/runtime 2014-09-02 11:15:44 -07:00
Daniel Smith 7615c00a9a Make validation work when not in the api package. 2014-09-02 10:42:06 -07:00
Daniel Smith eb5ca80946 Split helper test, move fuzzing to api package as serialization_test.go 2014-09-02 10:40:52 -07:00
Daniel Smith 6121e61f99 Split api into api, api/common, api/validation & apitools 2014-09-02 10:40:52 -07:00
Tim Hockin 5bed06f614 Merge pull request #1129 from VojtechVitek/godoc
Godoc improvements
2014-09-02 09:45:05 -07:00
Clayton Coleman 64c7348a19 Expand api ResourceVersioner test 2014-09-02 09:52:37 -04:00
Vojtech Vitek (V-Teq) 42c656501c Add several missing pkg Godoc files
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:11 +02: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 aa9b9b9fa8 Invert api and api/v1beta1 dependencies
This is some cleanup that has been needed for a while.
There's still one more step that could usefully be done, which is to
split up our api package into the part that provides the helper
functions and the part that provides the internal types. That can come
later.

The v1beta1 package is now a good example of what an api plugin should
do to version its types.
2014-08-29 12:15:30 -07:00
Daniel Smith a2b03ea93b Fix incorrect tag in MinionList 2014-08-28 20:06:17 -07:00
Clayton Coleman cc1ab0a3db Incorrect validation error for container image 2014-08-28 09:58:16 -04:00
Daniel Smith 2a62d72140 Cleanup: remove deprecated fields the proper way 2014-08-26 17:28:36 -07:00
Clayton Coleman 0a841a49fd Naming of Reason constants is inconsistent
Changed ReasonType to StatusReason (to match the field) and
changed CauseReason to CauseType and renamed StatusCause.Reason to
Type.
2014-08-26 13:39:21 -04:00
Clayton Coleman 52923a1348 Return validation errors from storage create/update 2014-08-26 13:30:55 -04:00
Clayton Coleman 84db1da42b Convert field errors into a selector for the object
Satisfies the "Field" condition for a Cause.  Also addresses
parts of #914.
2014-08-26 13:30:55 -04:00
Clayton Coleman d326ba2976 Add a Causes array to status details for validation errors
Uses the same constant values as api/errors for each nested
reason.
2014-08-26 13:30:55 -04:00
Clayton Coleman 60126bfe64 Make the validation types match the pending ReasonCauses 2014-08-26 13:30:55 -04:00
Satnam Singh 3f0f119e42 Very minor change to use camelCase for ReasonType as suggested in issue #914. 2014-08-25 16:57:13 -07:00
Satnam Singh 4105f7ef61 Code review changes to adjust pacakge name for storage_test.go 2014-08-25 10:38:11 -07:00
Satnam Singh 7fcaf80f67 Make validation check for legal serive port numbers. 2014-08-22 14:44:21 -07:00
Brendan Burns 5839378adc Add a validation that replicaSelector matches PodTemplate.Labels 2014-08-21 22:18:55 -07:00
Dawn Chen 5a2365b323 Fix #926
Make HostPort a real option without being set to ContainerPort if absent.
2014-08-19 15:44:50 -07:00
Brendan Burns 05ab1e49fb Address some follow up comments. 2014-08-18 12:49:52 -07:00
Tim Hockin e472752ff9 Merge pull request #875 from brendandburns/exec
Add a in container exec based health check.
2014-08-18 12:19:22 -07:00
Brendan Burns 0caae9c1d4 Add a in container exec based health check. 2014-08-18 12:00:11 -07:00
Tim Hockin e0d9002717 All validations return ErrorList now 2014-08-16 13:48:48 -07:00
Tim Hockin a69979d22b Change ErrorList.Append() to append() 2014-08-16 13:34:06 -07:00
Tim Hockin b9e65c2438 Use new api/errors, get rid of api.* error code 2014-08-15 00:14:38 -07:00
Tim Hockin bcd588ec15 Break api error handling into a new pkg 2014-08-15 00:14:38 -07: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
Nan Monnand Deng 41b0e5f34c move go-dockerclient-copiedstructs to third_party/docker-api-structs 2014-08-13 14:49:03 -04:00
Daniel Smith 1a5a22c539 Fix files missing gofmt 2014-08-12 17:48:00 -07:00
Daniel Smith c372b74bc8 Merge pull request #847 from thockin/health
Use IntOrString for health checks
2014-08-11 16:28:24 -07:00
Daniel Smith 6460a8cbf8 Correct confusing comment. 2014-08-11 15:58:59 -07:00
brendandburns 3222f61bca Merge pull request #557 from lavalamp/podLocation
Prepare for external scheduler
2014-08-11 15:27:24 -07:00
Daniel Smith b7752a86d4 Add debugging info printing to etcd fake
And make tests pass again.
2014-08-11 13:09:24 -07:00
Tim Hockin c67c1edfb4 Use IntOrString for TCP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in TCP health checks.  Improve tests.
2014-08-10 23:44:42 -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 7d605467dc New scheduler API
This commit adds a Binding object. The idea is that schedulers can write
these to cause pods to be asssigned to hosts. I'll provide an implementation
along with a rudimentary scheduler plugin.

This continues k8s' tradition of phrasing all APIs as RESTful handlers.
2014-08-10 19:05:03 -07:00
Daniel Smith 5cdce0e35a Prepare for external scheduler
1. Change names of Pod statuses (Waiting, Running, Terminated).
2. Store assigned host in etcd.
3. Change pod key to /registry/pods/<podid>. Container location remains
   the same (/registry/hosts/<machine>/kublet).
2014-08-10 15:05:36 -07:00
Daniel Smith 079c9043bd Switch to new external fuzz package 2014-08-08 15:54:09 -07:00
Clayton Coleman 67dbd15929 Address remaining comments from #756
Rename Encoding to Codec, Versioning to ResourceVersioner.  Add
GoDoc.  Add Delete(key, recursive) to EtcdHelper
2014-08-06 11:25:35 -04:00
Daniel Smith 860050b507 Merge pull request #745 from smarterclayton/add_structured_reason
Evolve the api.Status object with Reason/Details
2014-08-05 13:28:19 -07:00
Clayton Coleman 4f88b778a6 Evolve the api.Status object with Reason/Details
Contains breaking API change on api.Status#Details (type change)

Turn Details from string -> StatusDetails - a general
bucket for keyed error behavior.  Define an open enumeration
ReasonType exposed as Reason on the status object to provide
machine readable subcategorization beyond HTTP Status Code. Define
a human readable field Message which is common convention (previously
this was joined into Details).

Precedence order: HTTP Status Code, Reason, Details. apiserver would
impose restraints on the ReasonTypes defined by the main apiobject,
and ensure their use is consistent.

There are four long term scenarios this change supports:

1. Allow a client access to a machine readable field that can be
   easily switched on for improving or translating the generic
   server Message.

2. Return a 404 when a composite operation on multiple resources
   fails with enough data so that a client can distinguish which
   item does not exist.  E.g. resource Parent and resource Child,
   POST /parents/1/children to create a new Child, but /parents/1
   is deleted.  POST returns 404, ReasonTypeNotFound, and
   Details.ID = "1", Details.Kind = "parent"

3. Allow a client to receive validation data that is keyed by
   attribute for building user facing UIs around field submission.
   Validation is usually expressed as map[string][]string, but
   that type is less appropriate for many other uses.

4. Allow specific API errors to return more granular failure status
   for specific operations.  An example might be a minion proxy,
   where the operation that failed may be both proxying OR the
   minion itself.  In this case a reason may be defined "proxy_failed"
   corresponding to 502, where the Details field may be extended
   to contain a nested error object.

At this time only ID and Kind are exposed
2014-08-05 16:17:53 -04:00
Daniel Smith e75854a1f9 Merge pull request #759 from brendandburns/valid
Add c-identifier validation to service ids.
2014-08-05 12:32:02 -07:00
Brendan Burns 20a8f03d62 Add dns-952-identifier validation to service ids. 2014-08-05 11:40:48 -07:00
Daniel Smith 041d56f3d0 finish testing client/cache 2014-08-04 14:50:01 -07:00
Daniel Smith 03fe91cc4a Add ID to JSONBaseInterface 2014-08-04 14:50:01 -07:00
derekwaynecarr e5fd877052 Validate on replicas being non-negative 2014-08-04 15:39:45 -04:00
brendandburns 27426db827 Merge pull request #756 from smarterclayton/expose_encoding_versioning_interfaces
Expose an Encoding/Versioning interface for use with etcd
2014-08-04 10:10:54 -07:00
brendandburns e52c62565b Merge pull request #692 from lavalamp/dockerObjWrap
Copy docker client structs into v1beta1
2014-08-04 09:10:57 -07:00
Clayton Coleman 4448be2d95 Expose an Encoding/Versioning interface for use with etcd
etcd_tools.go is not dependent on the specific implementation
(which is provided by pkg/api).  All EtcdHelpers are created
with an encoding object which handles Encode/Decode/DecodeInto.
Additional tests added to verify simple atomic flows.

Begins to break up api singleton pattern.
2014-08-03 21:35:33 -04:00
erictune 5b589cf115 Merge pull request #735 from brendandburns/tcp-health
Add TCP socket based health checking.
2014-08-01 16:35:12 -07: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 1cc7fce523 Add documentation and tests to conversion. 2014-08-01 14:26:36 -07:00
Daniel Smith 5c0f5e85e2 Make api use converter package. 2014-08-01 14:26:35 -07:00
Brendan Burns 490bb28bf9 Add TCP socket based health checking. 2014-08-01 14:13:56 -07:00
Clayton Coleman 7ce23e43e7 More verbose error on missing field 2014-07-31 14:38:38 -04: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 ce586c1448 Test both directions of the conversion. 2014-07-30 15:04:01 -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
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
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
brendandburns 71b14b464a Merge pull request #623 from smarterclayton/validate_replication_controllers
Add validation to ReplicationControllers
2014-07-28 14:46:47 -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
Dan McPherson c4f4f69b93 Fixing Typos 2014-07-28 15:56:20 +02:00
Clayton Coleman d32024870a Extend validation for ReplicationController
Provide type safe checks for empty sets of selectors.
2014-07-25 12:15:17 -04:00
Jeromy Carriere 9cad657b4c Fix internalize for ReplicationControllerList. items were created
in a new var hiding the function-scoped var.
2014-07-25 10:44:45 -04:00
Brendan Burns bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Clayton Coleman 09294b90ce Refactor Kubelet config sources for clarity
Create a new "Pod" concept which can identify pods from
many config sources.
2014-07-21 21:18:36 -04:00
Daniel Smith 69c483f620 Add APIObject for generic inclusion of API objects.
Includes test and json/yaml getters and setters.
2014-07-18 22:35:08 -07:00
Clayton Coleman d1de579070 Merge pull request #493 from lavalamp/scheduler
Add websocket dep & watch api support
2014-07-18 22:18:03 -04:00
Daniel Smith eda30d4f20 Add watch mechanism to apiserver
Implemented via HTTP and websocket. A test is present but this isn't
yet wired into anything.

Eventual purpose of this is to allow a scheduler to watch for new pods.
Or allow replication controller to watch for new items it controlls.
Generally, it'll be good to turn everything possible into a push instead
of a poll.
2014-07-18 16:47:17 -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
Danny Jones bb2843498d API modified to use source; now supports EmptyDirectory
API is now modified to use a Source struct to handle multiple volumes.

Two volume types are supported now, HostDirectory and EmptyDirectory.
2014-07-17 15:25:50 -07:00
Danny Jones f84ff740f0 Adds initial volumes package; Supports host-dirs
Adds the framework for external volume mounts.

Currently supports bare host directory mounts.

Modifies the API to support host directory mounts from Volumes
instead of VolumeMounts.
2014-07-17 10:08:45 -07:00
Yuki Sonoda (Yugui) 07b8be4d4c Merge branch 'master' into fix/golint2
Conflicts:
	pkg/api/types.go
	pkg/health/health_check.go
	pkg/kubelet/kubelet.go
	pkg/kubelet/kubelet_server.go
	pkg/kubelet/kubelet_server_test.go
	pkg/kubelet/kubelet_test.go
2014-07-16 21:33:21 +09:00
Nan Deng 8c573ee727 Update to latest cAdvisor and use data structures directly from cAdvisor 2014-07-15 11:53:00 -07:00
Yuki Yugui Sonoda af38bf1ef7 Fixes golint errors in pkg/api 2014-07-15 22:56:09 +09:00
Brendan Burns 3cc5ff15cf Update services to use the internal IP and port, now that its available. 2014-07-14 20:24:58 -07:00
Brendan Burns 0e798bcc3c Add link env vars. 2014-07-14 16:37:17 -07:00
Tim Hockin 779cb84625 Merge pull request #397 from brendandburns/service
Add initial validation of Service objects
2014-07-11 14:43:47 -07:00
Brendan Burns c9babe619e Updated to use the makeInvalidError helper function. 2014-07-11 14:24:55 -07:00
Brendan Burns e9edfc754e Add initial validation of Service objects 2014-07-11 14:24:54 -07:00
Tim Hockin f532038281 Merge pull request #345 from smarterclayton/fix_ids
Ensure pod and manifest have a UUID in apiserver
2014-07-11 11:29:00 -07:00
Brendan Burns 6312ffebcf Address some comments from thockin@ 2014-07-11 10:14:45 -07:00
Clayton Coleman 5896ac14da Ensure pod and manifest always have a UUID
* Fixes implication #2 in docs/identifiers.md
* Replication controller lets the apiserver set the pod ID
2014-07-10 18:03:48 -04:00
Tim Hockin 06ac51e6e5 Merge pull request #389 from brendandburns/podip
Add PodIP to the info returned for a pod.
2014-07-10 11:18:05 -07:00
Yuki Sonoda (Yugui) 6914681ed0 Fixes golint errors in pkg/api 2014-07-10 20:46:35 +09:00
Brendan Burns 7b11cbd622 Add PodIP to the info returned for a pod. 2014-07-09 22:13:07 -07:00
Tim Hockin b0b9606aea Merge pull request #365 from brendandburns/health
add http health checks.
2014-07-09 16:14:30 -07:00