Commit Graph

91 Commits (996200b71ecb42fa4eb949662b88f86f08e87395)

Author SHA1 Message Date
deads2k db0b0bd0f5 move metav1 conversions to metav1 2017-02-14 11:47:23 -05:00
Yu-Ju Hong 999f8dff8e Remove the temporary fix for pre-1.0 mirror pods 2017-02-02 10:37:19 -08:00
Michail Kargakis 1d3748d7e5 registry: invalidate updates to non-convertible selectors 2017-01-21 23:42:55 +01:00
Clayton Coleman 36acd90aba
Move APIs and core code to use metav1.ObjectMeta 2017-01-17 16:17:18 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Clayton Coleman f07c6486ba
Rename metav1.Event to metav1.WatchEvent to avoid swagger collision
The kind on this object was always WatchEvent
2017-01-06 23:45:04 -05:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Klaus Ma cd6792ae08 Add default imagePullPolicy for initContainers. 2016-12-22 09:29:43 +08:00
Clayton Coleman 3ff5cb6ec7
Move resource.Quantity rounding to defaulter
This reverts commit feb56cc486.
2016-10-26 12:21:27 -04:00
Wojciech Tyczynski feb56cc486 Revert "Move resource.Quantity rounding to defaulter"
This reverts commit 5b18b4e515.
2016-10-26 10:21:54 +02:00
Clayton Coleman 5b18b4e515
Move resource.Quantity rounding to defaulter 2016-10-25 19:28:41 -04:00
Clayton Coleman 65042efb0f
Add conversion instructions 2016-10-25 19:28:40 -04:00
Clayton Coleman 3ee591d7ab
Invoke init container defaulting in conversion
Because annotations...

Remove old references to DefaultingInterface in manual conversions.
2016-10-18 21:07:35 -04:00
Clayton Coleman 5062406b77
Hand generated conversion should check nil 2016-10-18 21:07:32 -04:00
Michail Kargakis 1df4ee3a9d Custom conversion reactions to minReadySeconds/availableReplicas 2016-09-28 11:06:40 +02:00
Dawn Chen 4c4623e5be Fix backward compatibility issue caused by promoting initcontainers from alpha to beta. 2016-09-19 16:33:25 -07:00
Kubernetes Submit Queue b569a8daa9 Merge pull request #31053 from justinsb/dont_close_over_range_loops
Automatic merge from submit-queue

Avoid closing over range variables
2016-08-22 17:40:25 -07:00
Kubernetes Submit Queue e9bd805888 Merge pull request #31026 from erictune/betainit
Automatic merge from submit-queue

Move init-container feature from alpha to beta.

```release-note
Moved init-container feature from alpha to beta.

In 1.3, an init container is specified with this annotation key
on the pod or pod template: `pods.alpha.kubernetes.io/init-containers`.

In 1.4, either that key or this key: pods.beta.kubernetes.io/init-containers`,
can be used.

When you GET an object, you will see both annotation keys with the same values.

You can safely roll back from 1.4 to 1.3, and things with init-containers
will still work (pods, deployments, etc).

If you are running 1.3, only use the alpha annotation, or it may be lost when
rolling forward.

The status has moved from annotation key
`pods.beta.kubernetes.io/init-container-statuses` to
`pods.beta.kubernetes.io/init-container-statuses`.
Any code that inspects this annotation should be changed to use the new key.

State of Initialization will continue to be reported in both pods.alpha.kubernetes.io/initialized
and in `podStatus.conditions.{status: "True", type: Initialized}`
```

Mini-design for this change:

Goals:
1. A user can create an object with the beta annotation
  on 1.4, and it works.  The fact that the annotation has beta
  in it communicates to the user that the feature is beta,
  and so the user should have confidence in using it.  Preferably,
  when the user gets the annotation back, he see the beta
  annotation.
1) If someone had an existing alpha object in their apiserver,
  such as a RS with a pod template with an init-containers
  annotation on it, it should continue to work (init containers
  run) when stack upgraded to 1.4.
2) If someone is using a chart or blog post that has alpha
  annotation on it and they create it on a 1.4 cluster, it should
  work.
3) If someone had something with an init container in 1.4
  and they roll back stack to 1.3, it should not silently stop
  working (init containers don't run anymore).

To meet all these, we mirror an absent beta label from the alpha
key and vice versa.  If they are out of sync, we use the alpha
one. We do this in conversion since there was already logic there.

In 1.3 code, all annotations are preserved across a round trip
(v1 -> api -> v1), and the alpha annotation turns into the internal
field that kubelet uses.

In 1.4 code, the alpha annotation is always preserved across
a round trip, and a beta annotation is always set equal to
the alpha one, after a round trip.

Currently, the kubelet always sees the object after a round trip
when it GETs it.  But, we don't want to rely on that behavior,
since it will break when fastpath is implemented.

So, we rely on this:
all objects either are created with an alpha annotation (1.3 or 1.4
code) or are created with a beta annotation under 1.4.  In the later
case, they are round tripped at creation time, and so get both
annotations.  So all subsequent GETs see both labels.
2016-08-21 05:04:11 -07:00
Clayton Coleman e1ebde9f92
Add spec.nodeName and spec.serviceAccountName to downward env var
The serviceAccountName is occasionally useful for clients running on
Kube that need to know who they are when talking to other components.

The nodeName is useful for PetSet or DaemonSet pods that need to make
calls back to the API to fetch info about their node.

Both fields are immutable, and cannot easily be retrieved in another
way.
2016-08-20 15:50:36 -04:00
Justin Santa Barbara 3aa4f50aba Avoid closing over range variables
The consequence is only a misleading error message, but it is easy to
avoid.
2016-08-20 01:19:53 -04:00
Eric Tune 6e5a7f9441 Move init-container feature from alpha to beta.
```relnote
Moved init-container feature from alpha to beta.

In 1.3, an init container is specified with this annotation key
on the pod or pod template: `pods.alpha.kubernetes.io/init-containers`.

In 1.4, either that key or this key: pods.beta.kubernetes.io/init-containers`,
can be used.

When you GET an object, you will see both annotation keys with the same values.

You can safely roll back from 1.4 to 1.3, and things with init-containers
will still work (pods, deployments, etc).

If you are running 1.3, only use the alpha annotation, or it may be lost when
rolling forward.

The status has moved from annotation key
`pods.beta.kubernetes.io/init-container-statuses` to
`pods.beta.kubernetes.io/init-container-statuses`.
Any code that inspects this annotation should be changed to use the new key.

State of Initialization will continue to be reported in both pods.alpha.kubernetes.io/initialized
and in `podStatus.conditions.{status: "True", type: Initialized}`
```

Mini-design for this change:

Goals:
1. A user can create an object with the beta annotation
  on 1.4, and it works.  The fact that the annotation has beta
  in it communicates to the user that the feature is beta,
  and so the user should have confidence in using it.  Preferably,
  when the user gets the annotation back, he see the beta
  annotation.
1) If someone had an existing alpha object in their apiserver,
  such as a RS with a pod template with an init-containers
  annotation on it, it should continue to work (init containers
  run) when stack upgraded to 1.4.
2) If someone is using a chart or blog post that has alpha
  annotation on it and they create it on a 1.4 cluster, it should
  work.
3) If someone had something with an init container in 1.4
  and they roll back stack to 1.3, it should not silently stop
  working (init containers don't run anymore).

To meet all these, we mirror an absent beta label from the alpha
key and vice versa.  If they are out of sync, we use the alpha
one. We do this in conversion since there was already logic there.

In 1.3 code, all annotations are preserved across a round trip
(v1 -> api -> v1), and the alpha annotation turns into the internal
field that kubelet uses.

In 1.4 code, the alpha annotation is always preserved across
a round trip, and a beta annotation is always set equal to
the alpha one, after a round trip.

Currently, the kubelet always sees the object after a round trip
when it GETs it.  But, we don't want to rely on that behavior,
since it will break when fastpath is implemented.

So, we rely on this:
all objects either are created with an alpha annotation (1.3 or 1.4
code) or are created with a beta annotation under 1.4.  In the later
case, they are round tripped at creation time, and so get both
annotations.  So all subsequent GETs see both labels.
2016-08-19 14:00:18 -07:00
nikhiljindal 1d76884336 Adding events to federation apiserver 2016-08-12 10:48:19 -07:00
Daniel Smith f1fd638962 fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
Michail Kargakis f85067b27d api: custom conversions for rc/rs 2016-07-15 14:52:27 +02:00
Tim Hockin 355794c303 Log errors or fail if conversion fail to generate
This fixes PodSpec to generate cleanly.  No other types only half-generate (so
now we Fatalf), though several fail to generate at all (only Errorf for now).
2016-07-07 22:09:08 -07:00
Jordan Liggitt 993ab1d886 Allow specifying secret data using strings 2016-06-30 16:03:47 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Wojciech Tyczynski d002cb1d63 Fix apiservers crashes 2016-05-31 17:26:35 +02:00
Clayton Coleman 0854fd651c
Update direct conversions to inline fields 2016-05-28 08:52:08 -04:00
Filip Grzadkowski c4e239b314 Merge pull request #25918 from smarterclayton/init_annotation_mutation
Conversions were mutating the internal object
2016-05-20 10:25:36 +02:00
Clayton Coleman 997d55d796
Conversions were mutating the internal object
Internal objects can be shared, it is not allowed to mutate an internal
object in conversion.
2016-05-19 18:01:35 -04:00
Clayton Coleman 5e4308f91d
Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00
Clayton Coleman 6685715c4c
API for adding init containers 2016-05-17 00:29:49 -04:00
saadali b83af3d481 Change "speter.net/go/exp/math/dec/inf" dependency
to "https://gopkg.in/inf.v0"
2016-05-11 17:01:28 -07:00
Clayton Coleman db5a851d0c
Inline default methods by hand in custom conversions 2016-05-07 11:55:31 -04:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
Abhishek Shah 8a3ed48808 Added Hostname and Subdomain field to Pod.Spec 2016-04-28 10:56:56 -07:00
laushinka 7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
derekwaynecarr 76f2cc6a11 Add field selector for pod.spec.restartPolicy 2016-02-16 16:51:42 -05:00
Paul Morie 9030f16071 Move ConfigMap to main API 2016-01-28 17:07:05 -05:00
Michal Minar 3188e123a9 Add missing field label conversions
Added missing field labels conversion functions for kinds:
- ConfigMap
- DaemonSet
- Deployment
- Endpoints
- Event
- Ingress
- Job
- PersistentVolume
- PersistentVolumeClaim
- ResourceQuota
- Secret
- Service

Completed conversion functions of few other kinds:
- Namespace
- ServiceAccount

Added tests suite for the above.

Signed-off-by: Michal Minar <miminar@redhat.com>
2016-01-14 10:00:45 +01:00
Tim St. Clair e50059de07 Enforce minimum resource granularity
Enforce minimum resource granularity of milli-{core, bytes} for Storage,
Memory, and CPU resource types. For Storage and Memory, milli-bytes are
allowed for backwards compatability, but the behavior is
undefinied (depends on docker implementation).
2016-01-07 14:55:19 -08:00
Clayton Coleman 4d672c37b8 Updated conversions to be public 2015-12-29 10:40:38 -05:00
Chao Xu ad484c79f7 pass runtime.Scheme as parameter to AddToScheme 2015-12-23 23:21:35 -08:00
derekwaynecarr 54f5bb393b Fix missing field selector conversions in v1 2015-12-04 15:43:05 -05:00
mqliang 9ff765978a add filedselector for Event 2015-12-01 23:02:48 +08:00
Clayton Coleman 1d592e4c28 Unversioned types should not use ambiguous go-int
All external types that are not int64 are now marked as int32,
including
IntOrString. Prober is now int32 (43 years should be enough of an initial
probe time for anyone).

Did not change the metadata fields for now.
2015-11-26 11:45:25 -05:00
Yu-Ju Hong e5c82d2292 Add custom pod conversion functions from pre-v1.1 mirror pods
The functions would default values added after v1.0, so that kubelet wouldn't
fail at comparing the mirror pods against their associated static pods.

This code would need to be maintained if we ever change the default value in
Pod until we drop support for v1.0 nodes.
2015-10-27 10:50:30 -07:00
Paul Morie 3cd12f5e05 FSGroup implementation 2015-10-22 16:40:59 -04:00
Paul Morie 393e2bc019 Inline some SecurityContext fields into PodSecurityContext 2015-10-21 19:01:17 -04:00