Commit 56897b3c authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #17353 from smarterclayton/remove_ambiguous_int

Auto commit by PR queue bot
parents 284b2e41 e9e02bdd
...@@ -13544,17 +13544,17 @@ ...@@ -13544,17 +13544,17 @@
}, },
"initialDelaySeconds": { "initialDelaySeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "Number of seconds after the container has started before liveness probes are initiated. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes" "description": "Number of seconds after the container has started before liveness probes are initiated. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes"
}, },
"timeoutSeconds": { "timeoutSeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes" "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes"
}, },
"periodSeconds": { "periodSeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1." "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1."
}, },
"successThreshold": { "successThreshold": {
......
...@@ -3784,17 +3784,17 @@ ...@@ -3784,17 +3784,17 @@
}, },
"initialDelaySeconds": { "initialDelaySeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "Number of seconds after the container has started before liveness probes are initiated. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes" "description": "Number of seconds after the container has started before liveness probes are initiated. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes"
}, },
"timeoutSeconds": { "timeoutSeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes" "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes"
}, },
"periodSeconds": { "periodSeconds": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int32",
"description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1." "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1."
}, },
"successThreshold": { "successThreshold": {
......
...@@ -427,7 +427,7 @@ func findPort(pod *api.Pod, svcPort *api.ServicePort) (int, int, error) { ...@@ -427,7 +427,7 @@ func findPort(pod *api.Pod, svcPort *api.ServicePort) (int, int, error) {
// it actually maps to a host-port assigned to the pod. upstream // it actually maps to a host-port assigned to the pod. upstream
// doesn't check this and happily returns the container port spec'd // doesn't check this and happily returns the container port spec'd
// in the service, but that doesn't align w/ mesos port mgmt. // in the service, but that doesn't align w/ mesos port mgmt.
p := portName.IntVal p := portName.IntValue()
for _, container := range pod.Spec.Containers { for _, container := range pod.Spec.Containers {
for _, port := range container.Ports { for _, port := range container.Ports {
if port.ContainerPort == p && port.Protocol == svcPort.Protocol { if port.ContainerPort == p && port.Protocol == svcPort.Protocol {
......
...@@ -3302,21 +3302,21 @@ Populated by the system when a graceful deletion is requested. Read-only. More i ...@@ -3302,21 +3302,21 @@ Populated by the system when a graceful deletion is requested. Read-only. More i
<td class="tableblock halign-left valign-top"><p class="tableblock">initialDelaySeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">initialDelaySeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after the container has started before liveness probes are initiated. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after the container has started before liveness probes are initiated. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">timeoutSeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">timeoutSeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">periodSeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">periodSeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
......
...@@ -3068,21 +3068,21 @@ The resulting set of endpoints can be viewed as:<br> ...@@ -3068,21 +3068,21 @@ The resulting set of endpoints can be viewed as:<br>
<td class="tableblock halign-left valign-top"><p class="tableblock">initialDelaySeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">initialDelaySeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after the container has started before liveness probes are initiated. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after the container has started before liveness probes are initiated. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">timeoutSeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">timeoutSeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes">http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">periodSeconds</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">periodSeconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
......
...@@ -224,7 +224,7 @@ func NewServerTimeout(kind, operation string, retryAfterSeconds int) error { ...@@ -224,7 +224,7 @@ func NewServerTimeout(kind, operation string, retryAfterSeconds int) error {
Details: &unversioned.StatusDetails{ Details: &unversioned.StatusDetails{
Kind: kind, Kind: kind,
Name: operation, Name: operation,
RetryAfterSeconds: retryAfterSeconds, RetryAfterSeconds: int32(retryAfterSeconds),
}, },
Message: fmt.Sprintf("The %s operation against %s could not be completed at this time, please try again.", operation, kind), Message: fmt.Sprintf("The %s operation against %s could not be completed at this time, please try again.", operation, kind),
}} }}
...@@ -252,7 +252,7 @@ func NewTimeoutError(message string, retryAfterSeconds int) error { ...@@ -252,7 +252,7 @@ func NewTimeoutError(message string, retryAfterSeconds int) error {
Reason: unversioned.StatusReasonTimeout, Reason: unversioned.StatusReasonTimeout,
Message: fmt.Sprintf("Timeout: %s", message), Message: fmt.Sprintf("Timeout: %s", message),
Details: &unversioned.StatusDetails{ Details: &unversioned.StatusDetails{
RetryAfterSeconds: retryAfterSeconds, RetryAfterSeconds: int32(retryAfterSeconds),
}, },
}} }}
} }
...@@ -318,14 +318,14 @@ func NewGenericServerResponse(code int, verb, kind, name, serverMessage string, ...@@ -318,14 +318,14 @@ func NewGenericServerResponse(code int, verb, kind, name, serverMessage string,
} }
return &StatusError{unversioned.Status{ return &StatusError{unversioned.Status{
Status: unversioned.StatusFailure, Status: unversioned.StatusFailure,
Code: code, Code: int32(code),
Reason: reason, Reason: reason,
Details: &unversioned.StatusDetails{ Details: &unversioned.StatusDetails{
Kind: kind, Kind: kind,
Name: name, Name: name,
Causes: causes, Causes: causes,
RetryAfterSeconds: retryAfterSeconds, RetryAfterSeconds: int32(retryAfterSeconds),
}, },
Message: message, Message: message,
}} }}
...@@ -410,7 +410,7 @@ func SuggestsClientDelay(err error) (int, bool) { ...@@ -410,7 +410,7 @@ func SuggestsClientDelay(err error) (int, bool) {
if t.Status().Details != nil { if t.Status().Details != nil {
switch t.Status().Reason { switch t.Status().Reason {
case unversioned.StatusReasonServerTimeout, unversioned.StatusReasonTimeout: case unversioned.StatusReasonServerTimeout, unversioned.StatusReasonTimeout:
return t.Status().Details.RetryAfterSeconds, true return int(t.Status().Details.RetryAfterSeconds), true
} }
} }
} }
......
...@@ -111,7 +111,12 @@ func TestSpecificKind(t *testing.T) { ...@@ -111,7 +111,12 @@ func TestSpecificKind(t *testing.T) {
defer api.Scheme.Log(nil) defer api.Scheme.Log(nil)
kind := "Pod" kind := "Pod"
doRoundTripTest(kind, t) for i := 0; i < *fuzzIters; i++ {
doRoundTripTest(kind, t)
if t.Failed() {
break
}
}
} }
func TestList(t *testing.T) { func TestList(t *testing.T) {
...@@ -142,6 +147,9 @@ func TestRoundTripTypes(t *testing.T) { ...@@ -142,6 +147,9 @@ func TestRoundTripTypes(t *testing.T) {
// Try a few times, since runTest uses random values. // Try a few times, since runTest uses random values.
for i := 0; i < *fuzzIters; i++ { for i := 0; i < *fuzzIters; i++ {
doRoundTripTest(kind, t) doRoundTripTest(kind, t)
if t.Failed() {
break
}
} }
} }
} }
......
...@@ -45,6 +45,17 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -45,6 +45,17 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
f.RandSource(src) f.RandSource(src)
} }
f.Funcs( f.Funcs(
func(j *int, c fuzz.Continue) {
*j = int(c.Int31())
},
func(j **int, c fuzz.Continue) {
if c.RandBool() {
i := int(c.Int31())
*j = &i
} else {
*j = nil
}
},
func(j *runtime.PluginBase, c fuzz.Continue) { func(j *runtime.PluginBase, c fuzz.Continue) {
// Do nothing; this struct has only a Kind field and it must stay blank in memory. // Do nothing; this struct has only a Kind field and it must stay blank in memory.
}, },
...@@ -140,8 +151,8 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -140,8 +151,8 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
}, },
func(j *extensions.JobSpec, c fuzz.Continue) { func(j *extensions.JobSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again c.FuzzNoCustom(j) // fuzz self without calling this function again
completions := c.Rand.Int() completions := int(c.Rand.Int31())
parallelism := c.Rand.Int() parallelism := int(c.Rand.Int31())
j.Completions = &completions j.Completions = &completions
j.Parallelism = &parallelism j.Parallelism = &parallelism
}, },
...@@ -227,24 +238,23 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -227,24 +238,23 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
policies := []api.RestartPolicy{api.RestartPolicyAlways, api.RestartPolicyNever, api.RestartPolicyOnFailure} policies := []api.RestartPolicy{api.RestartPolicyAlways, api.RestartPolicyNever, api.RestartPolicyOnFailure}
*rp = policies[c.Rand.Intn(len(policies))] *rp = policies[c.Rand.Intn(len(policies))]
}, },
// Only api.DownwardAPIVolumeFile needs to have a specific func since FieldRef has to be
// defaulted to a version otherwise roundtrip will fail
// For the remaining volume plugins the default fuzzer is enough.
func(m *api.DownwardAPIVolumeFile, c fuzz.Continue) {
m.Path = c.RandString()
versions := []string{"v1"}
m.FieldRef.APIVersion = versions[c.Rand.Intn(len(versions))]
m.FieldRef.FieldPath = c.RandString()
},
func(vs *api.VolumeSource, c fuzz.Continue) { func(vs *api.VolumeSource, c fuzz.Continue) {
// Exactly one of the fields must be set. // Exactly one of the fields must be set.
v := reflect.ValueOf(vs).Elem() v := reflect.ValueOf(vs).Elem()
i := int(c.RandUint64() % uint64(v.NumField())) i := int(c.RandUint64() % uint64(v.NumField()))
v = v.Field(i).Addr() t := v.Field(i).Addr()
// Use a new fuzzer which cannot populate nil to ensure one field will be set. for v.Field(i).IsNil() {
f := fuzz.New().NilChance(0).NumElements(1, 1) c.Fuzz(t.Interface())
f.Funcs( }
// Only api.DownwardAPIVolumeFile needs to have a specific func since FieldRef has to be
// defaulted to a version otherwise roundtrip will fail
// For the remaining volume plugins the default fuzzer is enough.
func(m *api.DownwardAPIVolumeFile, c fuzz.Continue) {
m.Path = c.RandString()
versions := []string{"v1"}
m.FieldRef.APIVersion = versions[c.Rand.Intn(len(versions))]
m.FieldRef.FieldPath = c.RandString()
},
).Fuzz(v.Interface())
}, },
func(d *api.DNSPolicy, c fuzz.Continue) { func(d *api.DNSPolicy, c fuzz.Continue) {
policies := []api.DNSPolicy{api.DNSClusterFirst, api.DNSDefault} policies := []api.DNSPolicy{api.DNSClusterFirst, api.DNSDefault}
...@@ -363,9 +373,9 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -363,9 +373,9 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
}, },
func(s *extensions.HorizontalPodAutoscalerSpec, c fuzz.Continue) { func(s *extensions.HorizontalPodAutoscalerSpec, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again c.FuzzNoCustom(s) // fuzz self without calling this function again
minReplicas := c.Rand.Int() minReplicas := int(c.Rand.Int31())
s.MinReplicas = &minReplicas s.MinReplicas = &minReplicas
s.CPUUtilization = &extensions.CPUTargetUtilization{TargetPercentage: int(c.RandUint64())} s.CPUUtilization = &extensions.CPUTargetUtilization{TargetPercentage: int(int32(c.RandUint64()))}
}, },
) )
return f return f
......
...@@ -14302,19 +14302,19 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { ...@@ -14302,19 +14302,19 @@ func (x *Probe) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.InitialDelaySeconds = 0 x.InitialDelaySeconds = 0
} else { } else {
x.InitialDelaySeconds = int64(r.DecodeInt(64)) x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
case "timeoutSeconds": case "timeoutSeconds":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.TimeoutSeconds = 0 x.TimeoutSeconds = 0
} else { } else {
x.TimeoutSeconds = int64(r.DecodeInt(64)) x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
case "periodSeconds": case "periodSeconds":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.PeriodSeconds = 0 x.PeriodSeconds = 0
} else { } else {
x.PeriodSeconds = int64(r.DecodeInt(64)) x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
case "successThreshold": case "successThreshold":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
...@@ -14428,7 +14428,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -14428,7 +14428,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.InitialDelaySeconds = 0 x.InitialDelaySeconds = 0
} else { } else {
x.InitialDelaySeconds = int64(r.DecodeInt(64)) x.InitialDelaySeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
yyj1028++ yyj1028++
if yyhl1028 { if yyhl1028 {
...@@ -14444,7 +14444,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -14444,7 +14444,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.TimeoutSeconds = 0 x.TimeoutSeconds = 0
} else { } else {
x.TimeoutSeconds = int64(r.DecodeInt(64)) x.TimeoutSeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
yyj1028++ yyj1028++
if yyhl1028 { if yyhl1028 {
...@@ -14460,7 +14460,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -14460,7 +14460,7 @@ func (x *Probe) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.PeriodSeconds = 0 x.PeriodSeconds = 0
} else { } else {
x.PeriodSeconds = int64(r.DecodeInt(64)) x.PeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234))
} }
yyj1028++ yyj1028++
if yyhl1028 { if yyhl1028 {
...@@ -719,11 +719,11 @@ type Probe struct { ...@@ -719,11 +719,11 @@ type Probe struct {
// The action taken to determine the health of a container // The action taken to determine the health of a container
Handler `json:",inline"` Handler `json:",inline"`
// Length of time before health checking is activated. In seconds. // Length of time before health checking is activated. In seconds.
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"` InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"`
// Length of time before health checking times out. In seconds. // Length of time before health checking times out. In seconds.
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe. // How often (in seconds) to perform the probe.
PeriodSeconds int64 `json:"periodSeconds,omitempty"` PeriodSeconds int `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed. // Minimum consecutive successes for the probe to be considered successful after having failed.
// Must be 1 for liveness. // Must be 1 for liveness.
SuccessThreshold int `json:"successThreshold,omitempty"` SuccessThreshold int `json:"successThreshold,omitempty"`
......
...@@ -99,7 +99,7 @@ type Status struct { ...@@ -99,7 +99,7 @@ type Status struct {
// the reason type. // the reason type.
Details *StatusDetails `json:"details,omitempty"` Details *StatusDetails `json:"details,omitempty"`
// Suggested HTTP return code for this status, 0 if not set. // Suggested HTTP return code for this status, 0 if not set.
Code int `json:"code,omitempty"` Code int32 `json:"code,omitempty"`
} }
// StatusDetails is a set of additional properties that MAY be set by the // StatusDetails is a set of additional properties that MAY be set by the
...@@ -120,7 +120,7 @@ type StatusDetails struct { ...@@ -120,7 +120,7 @@ type StatusDetails struct {
// failure. Not all StatusReasons may provide detailed causes. // failure. Not all StatusReasons may provide detailed causes.
Causes []StatusCause `json:"causes,omitempty"` Causes []StatusCause `json:"causes,omitempty"`
// If specified, the time in seconds before the operation should be retried. // If specified, the time in seconds before the operation should be retried.
RetryAfterSeconds int `json:"retryAfterSeconds,omitempty"` RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty"`
} }
// Values of Status.Status // Values of Status.Status
...@@ -204,7 +204,7 @@ const ( ...@@ -204,7 +204,7 @@ const (
// Details (optional): // Details (optional):
// "kind" string - the kind attribute of the resource being acted on. // "kind" string - the kind attribute of the resource being acted on.
// "id" string - the operation that is being attempted. // "id" string - the operation that is being attempted.
// "retryAfterSeconds" int - the number of seconds before the operation should be retried // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried
// Status code 500 // Status code 500
StatusReasonServerTimeout StatusReason = "ServerTimeout" StatusReasonServerTimeout StatusReason = "ServerTimeout"
...@@ -214,7 +214,7 @@ const ( ...@@ -214,7 +214,7 @@ const (
// The request might succeed with an increased value of timeout param. The client *should* // The request might succeed with an increased value of timeout param. The client *should*
// wait at least the number of seconds specified by the retryAfterSeconds field. // wait at least the number of seconds specified by the retryAfterSeconds field.
// Details (optional): // Details (optional):
// "retryAfterSeconds" int - the number of seconds before the operation should be retried // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried
// Status code 504 // Status code 504
StatusReasonTimeout StatusReason = "Timeout" StatusReasonTimeout StatusReason = "Timeout"
......
...@@ -180,8 +180,8 @@ func convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *a ...@@ -180,8 +180,8 @@ func convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *a
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.ReplicationControllerSpec))(in) defaulting.(func(*api.ReplicationControllerSpec))(in)
} }
out.Replicas = new(int) out.Replicas = new(int32)
*out.Replicas = in.Replicas *out.Replicas = int32(in.Replicas)
if in.Selector != nil { if in.Selector != nil {
out.Selector = make(map[string]string) out.Selector = make(map[string]string)
for key, val := range in.Selector { for key, val := range in.Selector {
...@@ -213,7 +213,7 @@ func convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *R ...@@ -213,7 +213,7 @@ func convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *R
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ReplicationControllerSpec))(in) defaulting.(func(*ReplicationControllerSpec))(in)
} }
out.Replicas = *in.Replicas out.Replicas = int(*in.Replicas)
if in.Selector != nil { if in.Selector != nil {
out.Selector = make(map[string]string) out.Selector = make(map[string]string)
for key, val := range in.Selector { for key, val := range in.Selector {
......
...@@ -33,7 +33,7 @@ func autoconvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStore ...@@ -33,7 +33,7 @@ func autoconvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStore
} }
out.VolumeID = in.VolumeID out.VolumeID = in.VolumeID
out.FSType = in.FSType out.FSType = in.FSType
out.Partition = in.Partition out.Partition = int32(in.Partition)
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
} }
...@@ -307,8 +307,8 @@ func autoconvert_api_ContainerPort_To_v1_ContainerPort(in *api.ContainerPort, ou ...@@ -307,8 +307,8 @@ func autoconvert_api_ContainerPort_To_v1_ContainerPort(in *api.ContainerPort, ou
defaulting.(func(*api.ContainerPort))(in) defaulting.(func(*api.ContainerPort))(in)
} }
out.Name = in.Name out.Name = in.Name
out.HostPort = in.HostPort out.HostPort = int32(in.HostPort)
out.ContainerPort = in.ContainerPort out.ContainerPort = int32(in.ContainerPort)
out.Protocol = Protocol(in.Protocol) out.Protocol = Protocol(in.Protocol)
out.HostIP = in.HostIP out.HostIP = in.HostIP
return nil return nil
...@@ -371,8 +371,8 @@ func autoconvert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(in ...@@ -371,8 +371,8 @@ func autoconvert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(in
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.ContainerStateTerminated))(in) defaulting.(func(*api.ContainerStateTerminated))(in)
} }
out.ExitCode = in.ExitCode out.ExitCode = int32(in.ExitCode)
out.Signal = in.Signal out.Signal = int32(in.Signal)
out.Reason = in.Reason out.Reason = in.Reason
out.Message = in.Message out.Message = in.Message
if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil { if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
...@@ -414,7 +414,7 @@ func autoconvert_api_ContainerStatus_To_v1_ContainerStatus(in *api.ContainerStat ...@@ -414,7 +414,7 @@ func autoconvert_api_ContainerStatus_To_v1_ContainerStatus(in *api.ContainerStat
return err return err
} }
out.Ready = in.Ready out.Ready = in.Ready
out.RestartCount = in.RestartCount out.RestartCount = int32(in.RestartCount)
out.Image = in.Image out.Image = in.Image
out.ImageID = in.ImageID out.ImageID = in.ImageID
out.ContainerID = in.ContainerID out.ContainerID = in.ContainerID
...@@ -429,7 +429,7 @@ func autoconvert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in *api.DaemonEndpoint, ...@@ -429,7 +429,7 @@ func autoconvert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in *api.DaemonEndpoint,
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.DaemonEndpoint))(in) defaulting.(func(*api.DaemonEndpoint))(in)
} }
out.Port = in.Port out.Port = int32(in.Port)
return nil return nil
} }
...@@ -530,7 +530,7 @@ func autoconvert_api_EndpointPort_To_v1_EndpointPort(in *api.EndpointPort, out * ...@@ -530,7 +530,7 @@ func autoconvert_api_EndpointPort_To_v1_EndpointPort(in *api.EndpointPort, out *
defaulting.(func(*api.EndpointPort))(in) defaulting.(func(*api.EndpointPort))(in)
} }
out.Name = in.Name out.Name = in.Name
out.Port = in.Port out.Port = int32(in.Port)
out.Protocol = Protocol(in.Protocol) out.Protocol = Protocol(in.Protocol)
return nil return nil
} }
...@@ -698,7 +698,7 @@ func autoconvert_api_Event_To_v1_Event(in *api.Event, out *Event, s conversion.S ...@@ -698,7 +698,7 @@ func autoconvert_api_Event_To_v1_Event(in *api.Event, out *Event, s conversion.S
if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil { if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil {
return err return err
} }
out.Count = in.Count out.Count = int32(in.Count)
out.Type = in.Type out.Type = in.Type
return nil return nil
} }
...@@ -779,8 +779,8 @@ func autoconvert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource, ...@@ -779,8 +779,8 @@ func autoconvert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource,
out.TargetWWNs = nil out.TargetWWNs = nil
} }
if in.Lun != nil { if in.Lun != nil {
out.Lun = new(int) out.Lun = new(int32)
*out.Lun = *in.Lun *out.Lun = int32(*in.Lun)
} else { } else {
out.Lun = nil out.Lun = nil
} }
...@@ -811,7 +811,7 @@ func autoconvert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolume ...@@ -811,7 +811,7 @@ func autoconvert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolume
} }
out.PDName = in.PDName out.PDName = in.PDName
out.FSType = in.FSType out.FSType = in.FSType
out.Partition = in.Partition out.Partition = int32(in.Partition)
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
} }
...@@ -917,7 +917,7 @@ func autoconvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolu ...@@ -917,7 +917,7 @@ func autoconvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolu
} }
out.TargetPortal = in.TargetPortal out.TargetPortal = in.TargetPortal
out.IQN = in.IQN out.IQN = in.IQN
out.Lun = in.Lun out.Lun = int32(in.Lun)
out.FSType = in.FSType out.FSType = in.FSType
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
...@@ -2215,11 +2215,11 @@ func autoconvert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.S ...@@ -2215,11 +2215,11 @@ func autoconvert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.S
if err := convert_api_Handler_To_v1_Handler(&in.Handler, &out.Handler, s); err != nil { if err := convert_api_Handler_To_v1_Handler(&in.Handler, &out.Handler, s); err != nil {
return err return err
} }
out.InitialDelaySeconds = in.InitialDelaySeconds out.InitialDelaySeconds = int32(in.InitialDelaySeconds)
out.TimeoutSeconds = in.TimeoutSeconds out.TimeoutSeconds = int32(in.TimeoutSeconds)
out.PeriodSeconds = in.PeriodSeconds out.PeriodSeconds = int32(in.PeriodSeconds)
out.SuccessThreshold = in.SuccessThreshold out.SuccessThreshold = int32(in.SuccessThreshold)
out.FailureThreshold = in.FailureThreshold out.FailureThreshold = int32(in.FailureThreshold)
return nil return nil
} }
...@@ -2361,7 +2361,7 @@ func autoconvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStat ...@@ -2361,7 +2361,7 @@ func autoconvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStat
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.ReplicationControllerStatus))(in) defaulting.(func(*api.ReplicationControllerStatus))(in)
} }
out.Replicas = in.Replicas out.Replicas = int32(in.Replicas)
out.ObservedGeneration = in.ObservedGeneration out.ObservedGeneration = in.ObservedGeneration
return nil return nil
} }
...@@ -2779,11 +2779,11 @@ func autoconvert_api_ServicePort_To_v1_ServicePort(in *api.ServicePort, out *Ser ...@@ -2779,11 +2779,11 @@ func autoconvert_api_ServicePort_To_v1_ServicePort(in *api.ServicePort, out *Ser
} }
out.Name = in.Name out.Name = in.Name
out.Protocol = Protocol(in.Protocol) out.Protocol = Protocol(in.Protocol)
out.Port = in.Port out.Port = int32(in.Port)
if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil { if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil {
return err return err
} }
out.NodePort = in.NodePort out.NodePort = int32(in.NodePort)
return nil return nil
} }
...@@ -3058,7 +3058,7 @@ func autoconvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStore ...@@ -3058,7 +3058,7 @@ func autoconvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStore
} }
out.VolumeID = in.VolumeID out.VolumeID = in.VolumeID
out.FSType = in.FSType out.FSType = in.FSType
out.Partition = in.Partition out.Partition = int(in.Partition)
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
} }
...@@ -3332,8 +3332,8 @@ func autoconvert_v1_ContainerPort_To_api_ContainerPort(in *ContainerPort, out *a ...@@ -3332,8 +3332,8 @@ func autoconvert_v1_ContainerPort_To_api_ContainerPort(in *ContainerPort, out *a
defaulting.(func(*ContainerPort))(in) defaulting.(func(*ContainerPort))(in)
} }
out.Name = in.Name out.Name = in.Name
out.HostPort = in.HostPort out.HostPort = int(in.HostPort)
out.ContainerPort = in.ContainerPort out.ContainerPort = int(in.ContainerPort)
out.Protocol = api.Protocol(in.Protocol) out.Protocol = api.Protocol(in.Protocol)
out.HostIP = in.HostIP out.HostIP = in.HostIP
return nil return nil
...@@ -3396,8 +3396,8 @@ func autoconvert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(in ...@@ -3396,8 +3396,8 @@ func autoconvert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(in
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ContainerStateTerminated))(in) defaulting.(func(*ContainerStateTerminated))(in)
} }
out.ExitCode = in.ExitCode out.ExitCode = int(in.ExitCode)
out.Signal = in.Signal out.Signal = int(in.Signal)
out.Reason = in.Reason out.Reason = in.Reason
out.Message = in.Message out.Message = in.Message
if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil { if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
...@@ -3439,7 +3439,7 @@ func autoconvert_v1_ContainerStatus_To_api_ContainerStatus(in *ContainerStatus, ...@@ -3439,7 +3439,7 @@ func autoconvert_v1_ContainerStatus_To_api_ContainerStatus(in *ContainerStatus,
return err return err
} }
out.Ready = in.Ready out.Ready = in.Ready
out.RestartCount = in.RestartCount out.RestartCount = int(in.RestartCount)
out.Image = in.Image out.Image = in.Image
out.ImageID = in.ImageID out.ImageID = in.ImageID
out.ContainerID = in.ContainerID out.ContainerID = in.ContainerID
...@@ -3454,7 +3454,7 @@ func autoconvert_v1_DaemonEndpoint_To_api_DaemonEndpoint(in *DaemonEndpoint, out ...@@ -3454,7 +3454,7 @@ func autoconvert_v1_DaemonEndpoint_To_api_DaemonEndpoint(in *DaemonEndpoint, out
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*DaemonEndpoint))(in) defaulting.(func(*DaemonEndpoint))(in)
} }
out.Port = in.Port out.Port = int(in.Port)
return nil return nil
} }
...@@ -3555,7 +3555,7 @@ func autoconvert_v1_EndpointPort_To_api_EndpointPort(in *EndpointPort, out *api. ...@@ -3555,7 +3555,7 @@ func autoconvert_v1_EndpointPort_To_api_EndpointPort(in *EndpointPort, out *api.
defaulting.(func(*EndpointPort))(in) defaulting.(func(*EndpointPort))(in)
} }
out.Name = in.Name out.Name = in.Name
out.Port = in.Port out.Port = int(in.Port)
out.Protocol = api.Protocol(in.Protocol) out.Protocol = api.Protocol(in.Protocol)
return nil return nil
} }
...@@ -3723,7 +3723,7 @@ func autoconvert_v1_Event_To_api_Event(in *Event, out *api.Event, s conversion.S ...@@ -3723,7 +3723,7 @@ func autoconvert_v1_Event_To_api_Event(in *Event, out *api.Event, s conversion.S
if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil { if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil {
return err return err
} }
out.Count = in.Count out.Count = int(in.Count)
out.Type = in.Type out.Type = in.Type
return nil return nil
} }
...@@ -3805,7 +3805,7 @@ func autoconvert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out ...@@ -3805,7 +3805,7 @@ func autoconvert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out
} }
if in.Lun != nil { if in.Lun != nil {
out.Lun = new(int) out.Lun = new(int)
*out.Lun = *in.Lun *out.Lun = int(*in.Lun)
} else { } else {
out.Lun = nil out.Lun = nil
} }
...@@ -3836,7 +3836,7 @@ func autoconvert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolume ...@@ -3836,7 +3836,7 @@ func autoconvert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolume
} }
out.PDName = in.PDName out.PDName = in.PDName
out.FSType = in.FSType out.FSType = in.FSType
out.Partition = in.Partition out.Partition = int(in.Partition)
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
} }
...@@ -3942,7 +3942,7 @@ func autoconvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in *ISCSIVolumeSo ...@@ -3942,7 +3942,7 @@ func autoconvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in *ISCSIVolumeSo
} }
out.TargetPortal = in.TargetPortal out.TargetPortal = in.TargetPortal
out.IQN = in.IQN out.IQN = in.IQN
out.Lun = in.Lun out.Lun = int(in.Lun)
out.FSType = in.FSType out.FSType = in.FSType
out.ReadOnly = in.ReadOnly out.ReadOnly = in.ReadOnly
return nil return nil
...@@ -5272,11 +5272,11 @@ func autoconvert_v1_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.S ...@@ -5272,11 +5272,11 @@ func autoconvert_v1_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.S
if err := convert_v1_Handler_To_api_Handler(&in.Handler, &out.Handler, s); err != nil { if err := convert_v1_Handler_To_api_Handler(&in.Handler, &out.Handler, s); err != nil {
return err return err
} }
out.InitialDelaySeconds = in.InitialDelaySeconds out.InitialDelaySeconds = int(in.InitialDelaySeconds)
out.TimeoutSeconds = in.TimeoutSeconds out.TimeoutSeconds = int(in.TimeoutSeconds)
out.PeriodSeconds = in.PeriodSeconds out.PeriodSeconds = int(in.PeriodSeconds)
out.SuccessThreshold = in.SuccessThreshold out.SuccessThreshold = int(in.SuccessThreshold)
out.FailureThreshold = in.FailureThreshold out.FailureThreshold = int(in.FailureThreshold)
return nil return nil
} }
...@@ -5416,7 +5416,7 @@ func autoconvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStat ...@@ -5416,7 +5416,7 @@ func autoconvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStat
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ReplicationControllerStatus))(in) defaulting.(func(*ReplicationControllerStatus))(in)
} }
out.Replicas = in.Replicas out.Replicas = int(in.Replicas)
out.ObservedGeneration = in.ObservedGeneration out.ObservedGeneration = in.ObservedGeneration
return nil return nil
} }
...@@ -5834,11 +5834,11 @@ func autoconvert_v1_ServicePort_To_api_ServicePort(in *ServicePort, out *api.Ser ...@@ -5834,11 +5834,11 @@ func autoconvert_v1_ServicePort_To_api_ServicePort(in *ServicePort, out *api.Ser
} }
out.Name = in.Name out.Name = in.Name
out.Protocol = api.Protocol(in.Protocol) out.Protocol = api.Protocol(in.Protocol)
out.Port = in.Port out.Port = int(in.Port)
if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil { if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil {
return err return err
} }
out.NodePort = in.NodePort out.NodePort = int(in.NodePort)
return nil return nil
} }
......
...@@ -597,7 +597,7 @@ func deepCopy_v1_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conve ...@@ -597,7 +597,7 @@ func deepCopy_v1_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conve
out.TargetWWNs = nil out.TargetWWNs = nil
} }
if in.Lun != nil { if in.Lun != nil {
out.Lun = new(int) out.Lun = new(int32)
*out.Lun = *in.Lun *out.Lun = *in.Lun
} else { } else {
out.Lun = nil out.Lun = nil
...@@ -1803,7 +1803,7 @@ func deepCopy_v1_ReplicationControllerList(in ReplicationControllerList, out *Re ...@@ -1803,7 +1803,7 @@ func deepCopy_v1_ReplicationControllerList(in ReplicationControllerList, out *Re
func deepCopy_v1_ReplicationControllerSpec(in ReplicationControllerSpec, out *ReplicationControllerSpec, c *conversion.Cloner) error { func deepCopy_v1_ReplicationControllerSpec(in ReplicationControllerSpec, out *ReplicationControllerSpec, c *conversion.Cloner) error {
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = new(int) out.Replicas = new(int32)
*out.Replicas = *in.Replicas *out.Replicas = *in.Replicas
} else { } else {
out.Replicas = nil out.Replicas = nil
......
...@@ -41,7 +41,7 @@ func addDefaultingFuncs() { ...@@ -41,7 +41,7 @@ func addDefaultingFuncs() {
} }
} }
if obj.Spec.Replicas == nil { if obj.Spec.Replicas == nil {
obj.Spec.Replicas = new(int) obj.Spec.Replicas = new(int32)
*obj.Spec.Replicas = 1 *obj.Spec.Replicas = 1
} }
}, },
...@@ -85,7 +85,7 @@ func addDefaultingFuncs() { ...@@ -85,7 +85,7 @@ func addDefaultingFuncs() {
sp.Protocol = ProtocolTCP sp.Protocol = ProtocolTCP
} }
if sp.TargetPort == intstr.FromInt(0) || sp.TargetPort == intstr.FromString("") { if sp.TargetPort == intstr.FromInt(0) || sp.TargetPort == intstr.FromString("") {
sp.TargetPort = intstr.FromInt(sp.Port) sp.TargetPort = intstr.FromInt(int(sp.Port))
} }
} }
}, },
......
...@@ -156,8 +156,8 @@ func TestSetDefaultReplicationController(t *testing.T) { ...@@ -156,8 +156,8 @@ func TestSetDefaultReplicationController(t *testing.T) {
} }
} }
func newInt(val int) *int { func newInt(val int32) *int32 {
p := new(int) p := new(int32)
*p = val *p = val
return p return p
} }
...@@ -165,7 +165,7 @@ func newInt(val int) *int { ...@@ -165,7 +165,7 @@ func newInt(val int) *int {
func TestSetDefaultReplicationControllerReplicas(t *testing.T) { func TestSetDefaultReplicationControllerReplicas(t *testing.T) {
tests := []struct { tests := []struct {
rc versioned.ReplicationController rc versioned.ReplicationController
expectReplicas int expectReplicas int32
}{ }{
{ {
rc: versioned.ReplicationController{ rc: versioned.ReplicationController{
...@@ -345,13 +345,13 @@ func TestSetDefaultServicePort(t *testing.T) { ...@@ -345,13 +345,13 @@ func TestSetDefaultServicePort(t *testing.T) {
if out.Spec.Ports[0].Protocol != versioned.ProtocolTCP { if out.Spec.Ports[0].Protocol != versioned.ProtocolTCP {
t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[0].Protocol) t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[0].Protocol)
} }
if out.Spec.Ports[0].TargetPort != intstr.FromInt(in.Spec.Ports[0].Port) { if out.Spec.Ports[0].TargetPort != intstr.FromInt(int(in.Spec.Ports[0].Port)) {
t.Errorf("Expected port %v, got %v", in.Spec.Ports[0].Port, out.Spec.Ports[0].TargetPort) t.Errorf("Expected port %v, got %v", in.Spec.Ports[0].Port, out.Spec.Ports[0].TargetPort)
} }
if out.Spec.Ports[1].Protocol != versioned.ProtocolTCP { if out.Spec.Ports[1].Protocol != versioned.ProtocolTCP {
t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[1].Protocol) t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[1].Protocol)
} }
if out.Spec.Ports[1].TargetPort != intstr.FromInt(in.Spec.Ports[1].Port) { if out.Spec.Ports[1].TargetPort != intstr.FromInt(int(in.Spec.Ports[1].Port)) {
t.Errorf("Expected port %v, got %v", in.Spec.Ports[1].Port, out.Spec.Ports[1].TargetPort) t.Errorf("Expected port %v, got %v", in.Spec.Ports[1].Port, out.Spec.Ports[1].TargetPort)
} }
} }
...@@ -367,7 +367,7 @@ func TestSetDefaultNamespace(t *testing.T) { ...@@ -367,7 +367,7 @@ func TestSetDefaultNamespace(t *testing.T) {
} }
func TestSetDefaultPodSpecHostNetwork(t *testing.T) { func TestSetDefaultPodSpecHostNetwork(t *testing.T) {
portNum := 8080 portNum := int32(8080)
s := versioned.PodSpec{} s := versioned.PodSpec{}
s.HostNetwork = true s.HostNetwork = true
s.Containers = []versioned.Container{ s.Containers = []versioned.Container{
......
...@@ -635,7 +635,7 @@ type GCEPersistentDiskVolumeSource struct { ...@@ -635,7 +635,7 @@ type GCEPersistentDiskVolumeSource struct {
// Examples: For volume /dev/sda1, you specify the partition as "1". // Examples: For volume /dev/sda1, you specify the partition as "1".
// Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
// More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk
Partition int `json:"partition,omitempty"` Partition int32 `json:"partition,omitempty"`
// ReadOnly here will force the ReadOnly setting in VolumeMounts. // ReadOnly here will force the ReadOnly setting in VolumeMounts.
// Defaults to false. // Defaults to false.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk
...@@ -661,7 +661,7 @@ type AWSElasticBlockStoreVolumeSource struct { ...@@ -661,7 +661,7 @@ type AWSElasticBlockStoreVolumeSource struct {
// If omitted, the default is to mount by volume name. // If omitted, the default is to mount by volume name.
// Examples: For volume /dev/sda1, you specify the partition as "1". // Examples: For volume /dev/sda1, you specify the partition as "1".
// Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
Partition int `json:"partition,omitempty"` Partition int32 `json:"partition,omitempty"`
// Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true".
// If omitted, the default is "false". // If omitted, the default is "false".
// More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore
...@@ -709,7 +709,7 @@ type ISCSIVolumeSource struct { ...@@ -709,7 +709,7 @@ type ISCSIVolumeSource struct {
// Target iSCSI Qualified Name. // Target iSCSI Qualified Name.
IQN string `json:"iqn"` IQN string `json:"iqn"`
// iSCSI target lun number. // iSCSI target lun number.
Lun int `json:"lun"` Lun int32 `json:"lun"`
// Filesystem type of the volume that you want to mount. // Filesystem type of the volume that you want to mount.
// Tip: Ensure that the filesystem type is supported by the host operating system. // Tip: Ensure that the filesystem type is supported by the host operating system.
// Examples: "ext4", "xfs", "ntfs". // Examples: "ext4", "xfs", "ntfs".
...@@ -726,7 +726,7 @@ type FCVolumeSource struct { ...@@ -726,7 +726,7 @@ type FCVolumeSource struct {
// Required: FC target world wide names (WWNs) // Required: FC target world wide names (WWNs)
TargetWWNs []string `json:"targetWWNs"` TargetWWNs []string `json:"targetWWNs"`
// Required: FC target lun number // Required: FC target lun number
Lun *int `json:"lun"` Lun *int32 `json:"lun"`
// Required: Filesystem type to mount. // Required: Filesystem type to mount.
// Must be a filesystem type supported by the host operating system. // Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs" // Ex. "ext4", "xfs", "ntfs"
...@@ -747,10 +747,10 @@ type ContainerPort struct { ...@@ -747,10 +747,10 @@ type ContainerPort struct {
// If specified, this must be a valid port number, 0 < x < 65536. // If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort. // If HostNetwork is specified, this must match ContainerPort.
// Most containers do not need this. // Most containers do not need this.
HostPort int `json:"hostPort,omitempty"` HostPort int32 `json:"hostPort,omitempty"`
// Number of port to expose on the pod's IP address. // Number of port to expose on the pod's IP address.
// This must be a valid port number, 0 < x < 65536. // This must be a valid port number, 0 < x < 65536.
ContainerPort int `json:"containerPort"` ContainerPort int32 `json:"containerPort"`
// Protocol for port. Must be UDP or TCP. // Protocol for port. Must be UDP or TCP.
// Defaults to "TCP". // Defaults to "TCP".
Protocol Protocol `json:"protocol,omitempty"` Protocol Protocol `json:"protocol,omitempty"`
...@@ -853,20 +853,20 @@ type Probe struct { ...@@ -853,20 +853,20 @@ type Probe struct {
Handler `json:",inline"` Handler `json:",inline"`
// Number of seconds after the container has started before liveness probes are initiated. // Number of seconds after the container has started before liveness probes are initiated.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"` InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// Number of seconds after which the probe times out. // Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1. // Defaults to 1 second. Minimum value is 1.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe. // How often (in seconds) to perform the probe.
// Default to 10 seconds. Minimum value is 1. // Default to 10 seconds. Minimum value is 1.
PeriodSeconds int64 `json:"periodSeconds,omitempty"` PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed. // Minimum consecutive successes for the probe to be considered successful after having failed.
// Defaults to 1. Must be 1 for liveness. Minimum value is 1. // Defaults to 1. Must be 1 for liveness. Minimum value is 1.
SuccessThreshold int `json:"successThreshold,omitempty"` SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded. // Minimum consecutive failures for the probe to be considered failed after having succeeded.
// Defaults to 3. Minimum value is 1. // Defaults to 3. Minimum value is 1.
FailureThreshold int `json:"failureThreshold,omitempty"` FailureThreshold int32 `json:"failureThreshold,omitempty"`
} }
// PullPolicy describes a policy for if/when to pull a container image // PullPolicy describes a policy for if/when to pull a container image
...@@ -1064,9 +1064,9 @@ type ContainerStateRunning struct { ...@@ -1064,9 +1064,9 @@ type ContainerStateRunning struct {
// ContainerStateTerminated is a terminated state of a container. // ContainerStateTerminated is a terminated state of a container.
type ContainerStateTerminated struct { type ContainerStateTerminated struct {
// Exit status from the last termination of the container // Exit status from the last termination of the container
ExitCode int `json:"exitCode"` ExitCode int32 `json:"exitCode"`
// Signal from the last termination of the container // Signal from the last termination of the container
Signal int `json:"signal,omitempty"` Signal int32 `json:"signal,omitempty"`
// (brief) reason from the last termination of the container // (brief) reason from the last termination of the container
Reason string `json:"reason,omitempty"` Reason string `json:"reason,omitempty"`
// Message regarding the last termination of the container // Message regarding the last termination of the container
...@@ -1106,7 +1106,7 @@ type ContainerStatus struct { ...@@ -1106,7 +1106,7 @@ type ContainerStatus struct {
// the number of dead containers that have not yet been removed. // the number of dead containers that have not yet been removed.
// Note that this is calculated from dead containers. But those containers are subject to // Note that this is calculated from dead containers. But those containers are subject to
// garbage collection. This value will get capped at 5 by GC. // garbage collection. This value will get capped at 5 by GC.
RestartCount int `json:"restartCount"` RestartCount int32 `json:"restartCount"`
// The image the container is running. // The image the container is running.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md // More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md
// TODO(dchen1107): Which image the container is running with? // TODO(dchen1107): Which image the container is running with?
...@@ -1423,7 +1423,7 @@ type ReplicationControllerSpec struct { ...@@ -1423,7 +1423,7 @@ type ReplicationControllerSpec struct {
// This is a pointer to distinguish between explicit zero and unspecified. // This is a pointer to distinguish between explicit zero and unspecified.
// Defaults to 1. // Defaults to 1.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller
Replicas *int `json:"replicas,omitempty"` Replicas *int32 `json:"replicas,omitempty"`
// Selector is a label query over pods that should match the Replicas count. // Selector is a label query over pods that should match the Replicas count.
// If Selector is empty, it is defaulted to the labels present on the Pod template. // If Selector is empty, it is defaulted to the labels present on the Pod template.
...@@ -1448,7 +1448,7 @@ type ReplicationControllerSpec struct { ...@@ -1448,7 +1448,7 @@ type ReplicationControllerSpec struct {
type ReplicationControllerStatus struct { type ReplicationControllerStatus struct {
// Replicas is the most recently oberved number of replicas. // Replicas is the most recently oberved number of replicas.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller
Replicas int `json:"replicas"` Replicas int32 `json:"replicas"`
// ObservedGeneration reflects the generation of the most recently observed replication controller. // ObservedGeneration reflects the generation of the most recently observed replication controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"` ObservedGeneration int64 `json:"observedGeneration,omitempty"`
...@@ -1612,7 +1612,7 @@ type ServicePort struct { ...@@ -1612,7 +1612,7 @@ type ServicePort struct {
Protocol Protocol `json:"protocol,omitempty"` Protocol Protocol `json:"protocol,omitempty"`
// The port that will be exposed by this service. // The port that will be exposed by this service.
Port int `json:"port"` Port int32 `json:"port"`
// Number or name of the port to access on the pods targeted by the service. // Number or name of the port to access on the pods targeted by the service.
// Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
...@@ -1628,7 +1628,7 @@ type ServicePort struct { ...@@ -1628,7 +1628,7 @@ type ServicePort struct {
// if unused or else creation of the service will fail. // if unused or else creation of the service will fail.
// Default is to auto-allocate a port if the ServiceType of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#type--nodeport // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#type--nodeport
NodePort int `json:"nodePort,omitempty"` NodePort int32 `json:"nodePort,omitempty"`
} }
// Service is a named abstraction of software service (for example, mysql) consisting of local port // Service is a named abstraction of software service (for example, mysql) consisting of local port
...@@ -1771,7 +1771,7 @@ type EndpointPort struct { ...@@ -1771,7 +1771,7 @@ type EndpointPort struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// The port number of the endpoint. // The port number of the endpoint.
Port int `json:"port"` Port int32 `json:"port"`
// The IP protocol for this port. // The IP protocol for this port.
// Must be UDP or TCP. // Must be UDP or TCP.
...@@ -1807,7 +1807,7 @@ type NodeSpec struct { ...@@ -1807,7 +1807,7 @@ type NodeSpec struct {
// DaemonEndpoint contains information about a single Daemon endpoint. // DaemonEndpoint contains information about a single Daemon endpoint.
type DaemonEndpoint struct { type DaemonEndpoint struct {
// Port number of the given endpoint. // Port number of the given endpoint.
Port int `json:port` Port int32 `json:port`
} }
// NodeDaemonEndpoints lists ports opened by daemons running on the Node. // NodeDaemonEndpoints lists ports opened by daemons running on the Node.
...@@ -2258,7 +2258,7 @@ type Event struct { ...@@ -2258,7 +2258,7 @@ type Event struct {
LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty"` LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty"`
// The number of times this event has occurred. // The number of times this event has occurred.
Count int `json:"count,omitempty"` Count int32 `json:"count,omitempty"`
// Type of this event (Normal, Warning), new types could be added in the future // Type of this event (Normal, Warning), new types could be added in the future
Type string `json:"type,omitempty"` Type string `json:"type,omitempty"`
......
...@@ -880,8 +880,9 @@ func validateProbe(probe *api.Probe) validation.ErrorList { ...@@ -880,8 +880,9 @@ func validateProbe(probe *api.Probe) validation.ErrorList {
return allErrs return allErrs
} }
allErrs = append(allErrs, validateHandler(&probe.Handler)...) allErrs = append(allErrs, validateHandler(&probe.Handler)...)
allErrs = append(allErrs, ValidatePositiveField(probe.InitialDelaySeconds, "initialDelaySeconds")...)
allErrs = append(allErrs, ValidatePositiveField(probe.TimeoutSeconds, "timeoutSeconds")...) allErrs = append(allErrs, ValidatePositiveField(int64(probe.InitialDelaySeconds), "initialDelaySeconds")...)
allErrs = append(allErrs, ValidatePositiveField(int64(probe.TimeoutSeconds), "timeoutSeconds")...)
allErrs = append(allErrs, ValidatePositiveField(int64(probe.PeriodSeconds), "periodSeconds")...) allErrs = append(allErrs, ValidatePositiveField(int64(probe.PeriodSeconds), "periodSeconds")...)
allErrs = append(allErrs, ValidatePositiveField(int64(probe.SuccessThreshold), "successThreshold")...) allErrs = append(allErrs, ValidatePositiveField(int64(probe.SuccessThreshold), "successThreshold")...)
allErrs = append(allErrs, ValidatePositiveField(int64(probe.FailureThreshold), "failureThreshold")...) allErrs = append(allErrs, ValidatePositiveField(int64(probe.FailureThreshold), "failureThreshold")...)
...@@ -932,7 +933,7 @@ func validateHTTPGetAction(http *api.HTTPGetAction) validation.ErrorList { ...@@ -932,7 +933,7 @@ func validateHTTPGetAction(http *api.HTTPGetAction) validation.ErrorList {
if len(http.Path) == 0 { if len(http.Path) == 0 {
allErrors = append(allErrors, validation.NewRequiredError("path")) allErrors = append(allErrors, validation.NewRequiredError("path"))
} }
if http.Port.Type == intstr.Int && !validation.IsValidPortNum(http.Port.IntVal) { if http.Port.Type == intstr.Int && !validation.IsValidPortNum(http.Port.IntValue()) {
allErrors = append(allErrors, validation.NewInvalidError("port", http.Port, PortRangeErrorMsg)) allErrors = append(allErrors, validation.NewInvalidError("port", http.Port, PortRangeErrorMsg))
} else if http.Port.Type == intstr.String && !validation.IsValidPortName(http.Port.StrVal) { } else if http.Port.Type == intstr.String && !validation.IsValidPortName(http.Port.StrVal) {
allErrors = append(allErrors, validation.NewInvalidError("port", http.Port.StrVal, PortNameErrorMsg)) allErrors = append(allErrors, validation.NewInvalidError("port", http.Port.StrVal, PortNameErrorMsg))
...@@ -946,7 +947,7 @@ func validateHTTPGetAction(http *api.HTTPGetAction) validation.ErrorList { ...@@ -946,7 +947,7 @@ func validateHTTPGetAction(http *api.HTTPGetAction) validation.ErrorList {
func validateTCPSocketAction(tcp *api.TCPSocketAction) validation.ErrorList { func validateTCPSocketAction(tcp *api.TCPSocketAction) validation.ErrorList {
allErrors := validation.ErrorList{} allErrors := validation.ErrorList{}
if tcp.Port.Type == intstr.Int && !validation.IsValidPortNum(tcp.Port.IntVal) { if tcp.Port.Type == intstr.Int && !validation.IsValidPortNum(tcp.Port.IntValue()) {
allErrors = append(allErrors, validation.NewInvalidError("port", tcp.Port, PortRangeErrorMsg)) allErrors = append(allErrors, validation.NewInvalidError("port", tcp.Port, PortRangeErrorMsg))
} else if tcp.Port.Type == intstr.String && !validation.IsValidPortName(tcp.Port.StrVal) { } else if tcp.Port.Type == intstr.String && !validation.IsValidPortName(tcp.Port.StrVal) {
allErrors = append(allErrors, validation.NewInvalidError("port", tcp.Port.StrVal, PortNameErrorMsg)) allErrors = append(allErrors, validation.NewInvalidError("port", tcp.Port.StrVal, PortNameErrorMsg))
...@@ -1333,7 +1334,7 @@ func validateServicePort(sp *api.ServicePort, requireName bool, allNames *sets.S ...@@ -1333,7 +1334,7 @@ func validateServicePort(sp *api.ServicePort, requireName bool, allNames *sets.S
allErrs = append(allErrs, validation.NewNotSupportedError("protocol", sp.Protocol, supportedPortProtocols.List())) allErrs = append(allErrs, validation.NewNotSupportedError("protocol", sp.Protocol, supportedPortProtocols.List()))
} }
if sp.TargetPort.Type == intstr.Int && !validation.IsValidPortNum(sp.TargetPort.IntVal) { if sp.TargetPort.Type == intstr.Int && !validation.IsValidPortNum(sp.TargetPort.IntValue()) {
allErrs = append(allErrs, validation.NewInvalidError("targetPort", sp.TargetPort, PortRangeErrorMsg)) allErrs = append(allErrs, validation.NewInvalidError("targetPort", sp.TargetPort, PortRangeErrorMsg))
} }
if sp.TargetPort.Type == intstr.String && !validation.IsValidPortName(sp.TargetPort.StrVal) { if sp.TargetPort.Type == intstr.String && !validation.IsValidPortName(sp.TargetPort.StrVal) {
......
...@@ -36,24 +36,24 @@ func autoconvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyCon ...@@ -36,24 +36,24 @@ func autoconvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyCon
out.BindAddress = in.BindAddress out.BindAddress = in.BindAddress
out.CleanupIPTables = in.CleanupIPTables out.CleanupIPTables = in.CleanupIPTables
out.HealthzBindAddress = in.HealthzBindAddress out.HealthzBindAddress = in.HealthzBindAddress
out.HealthzPort = in.HealthzPort out.HealthzPort = int32(in.HealthzPort)
out.HostnameOverride = in.HostnameOverride out.HostnameOverride = in.HostnameOverride
out.IPTablesSyncePeriodSeconds = in.IPTablesSyncePeriodSeconds out.IPTablesSyncePeriodSeconds = int32(in.IPTablesSyncePeriodSeconds)
out.KubeAPIBurst = in.KubeAPIBurst out.KubeAPIBurst = int32(in.KubeAPIBurst)
out.KubeAPIQPS = in.KubeAPIQPS out.KubeAPIQPS = int32(in.KubeAPIQPS)
out.KubeconfigPath = in.KubeconfigPath out.KubeconfigPath = in.KubeconfigPath
out.MasqueradeAll = in.MasqueradeAll out.MasqueradeAll = in.MasqueradeAll
out.Master = in.Master out.Master = in.Master
if in.OOMScoreAdj != nil { if in.OOMScoreAdj != nil {
out.OOMScoreAdj = new(int) out.OOMScoreAdj = new(int32)
*out.OOMScoreAdj = *in.OOMScoreAdj *out.OOMScoreAdj = int32(*in.OOMScoreAdj)
} else { } else {
out.OOMScoreAdj = nil out.OOMScoreAdj = nil
} }
out.Mode = ProxyMode(in.Mode) out.Mode = ProxyMode(in.Mode)
out.PortRange = in.PortRange out.PortRange = in.PortRange
out.ResourceContainer = in.ResourceContainer out.ResourceContainer = in.ResourceContainer
out.UDPTimeoutMilliseconds = in.UDPTimeoutMilliseconds out.UDPTimeoutMilliseconds = int32(in.UDPTimeoutMilliseconds)
return nil return nil
} }
...@@ -71,24 +71,24 @@ func autoconvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon ...@@ -71,24 +71,24 @@ func autoconvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon
out.BindAddress = in.BindAddress out.BindAddress = in.BindAddress
out.CleanupIPTables = in.CleanupIPTables out.CleanupIPTables = in.CleanupIPTables
out.HealthzBindAddress = in.HealthzBindAddress out.HealthzBindAddress = in.HealthzBindAddress
out.HealthzPort = in.HealthzPort out.HealthzPort = int(in.HealthzPort)
out.HostnameOverride = in.HostnameOverride out.HostnameOverride = in.HostnameOverride
out.IPTablesSyncePeriodSeconds = in.IPTablesSyncePeriodSeconds out.IPTablesSyncePeriodSeconds = int(in.IPTablesSyncePeriodSeconds)
out.KubeAPIBurst = in.KubeAPIBurst out.KubeAPIBurst = int(in.KubeAPIBurst)
out.KubeAPIQPS = in.KubeAPIQPS out.KubeAPIQPS = int(in.KubeAPIQPS)
out.KubeconfigPath = in.KubeconfigPath out.KubeconfigPath = in.KubeconfigPath
out.MasqueradeAll = in.MasqueradeAll out.MasqueradeAll = in.MasqueradeAll
out.Master = in.Master out.Master = in.Master
if in.OOMScoreAdj != nil { if in.OOMScoreAdj != nil {
out.OOMScoreAdj = new(int) out.OOMScoreAdj = new(int)
*out.OOMScoreAdj = *in.OOMScoreAdj *out.OOMScoreAdj = int(*in.OOMScoreAdj)
} else { } else {
out.OOMScoreAdj = nil out.OOMScoreAdj = nil
} }
out.Mode = componentconfig.ProxyMode(in.Mode) out.Mode = componentconfig.ProxyMode(in.Mode)
out.PortRange = in.PortRange out.PortRange = in.PortRange
out.ResourceContainer = in.ResourceContainer out.ResourceContainer = in.ResourceContainer
out.UDPTimeoutMilliseconds = in.UDPTimeoutMilliseconds out.UDPTimeoutMilliseconds = int(in.UDPTimeoutMilliseconds)
return nil return nil
} }
......
...@@ -46,7 +46,7 @@ func deepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku ...@@ -46,7 +46,7 @@ func deepCopy_v1alpha1_KubeProxyConfiguration(in KubeProxyConfiguration, out *Ku
out.MasqueradeAll = in.MasqueradeAll out.MasqueradeAll = in.MasqueradeAll
out.Master = in.Master out.Master = in.Master
if in.OOMScoreAdj != nil { if in.OOMScoreAdj != nil {
out.OOMScoreAdj = new(int) out.OOMScoreAdj = new(int32)
*out.OOMScoreAdj = *in.OOMScoreAdj *out.OOMScoreAdj = *in.OOMScoreAdj
} else { } else {
out.OOMScoreAdj = nil out.OOMScoreAdj = nil
......
...@@ -34,7 +34,7 @@ func addDefaultingFuncs() { ...@@ -34,7 +34,7 @@ func addDefaultingFuncs() {
obj.HealthzBindAddress = "127.0.0.1" obj.HealthzBindAddress = "127.0.0.1"
} }
if obj.OOMScoreAdj == nil { if obj.OOMScoreAdj == nil {
temp := qos.KubeProxyOOMScoreAdj temp := int32(qos.KubeProxyOOMScoreAdj)
obj.OOMScoreAdj = &temp obj.OOMScoreAdj = &temp
} }
if obj.IPTablesSyncePeriodSeconds == 0 { if obj.IPTablesSyncePeriodSeconds == 0 {
......
...@@ -546,7 +546,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco ...@@ -546,7 +546,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.HealthzPort = 0 x.HealthzPort = 0
} else { } else {
x.HealthzPort = int(r.DecodeInt(codecSelferBitsize1234)) x.HealthzPort = int32(r.DecodeInt(32))
} }
case "hostnameOverride": case "hostnameOverride":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
...@@ -558,19 +558,19 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco ...@@ -558,19 +558,19 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.IPTablesSyncePeriodSeconds = 0 x.IPTablesSyncePeriodSeconds = 0
} else { } else {
x.IPTablesSyncePeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) x.IPTablesSyncePeriodSeconds = int32(r.DecodeInt(32))
} }
case "kubeAPIBurst": case "kubeAPIBurst":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.KubeAPIBurst = 0 x.KubeAPIBurst = 0
} else { } else {
x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) x.KubeAPIBurst = int32(r.DecodeInt(32))
} }
case "kubeAPIQPS": case "kubeAPIQPS":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.KubeAPIQPS = 0 x.KubeAPIQPS = 0
} else { } else {
x.KubeAPIQPS = int(r.DecodeInt(codecSelferBitsize1234)) x.KubeAPIQPS = int32(r.DecodeInt(32))
} }
case "kubeconfigPath": case "kubeconfigPath":
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
...@@ -597,13 +597,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco ...@@ -597,13 +597,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco
} }
} else { } else {
if x.OOMScoreAdj == nil { if x.OOMScoreAdj == nil {
x.OOMScoreAdj = new(int) x.OOMScoreAdj = new(int32)
} }
yym74 := z.DecBinary() yym74 := z.DecBinary()
_ = yym74 _ = yym74
if false { if false {
} else { } else {
*((*int)(x.OOMScoreAdj)) = int(r.DecodeInt(codecSelferBitsize1234)) *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32))
} }
} }
case "mode": case "mode":
...@@ -628,7 +628,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco ...@@ -628,7 +628,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Deco
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.UDPTimeoutMilliseconds = 0 x.UDPTimeoutMilliseconds = 0
} else { } else {
x.UDPTimeoutMilliseconds = int(r.DecodeInt(codecSelferBitsize1234)) x.UDPTimeoutMilliseconds = int32(r.DecodeInt(32))
} }
default: default:
z.DecStructFieldNotFound(-1, yys59) z.DecStructFieldNotFound(-1, yys59)
...@@ -738,7 +738,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -738,7 +738,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.HealthzPort = 0 x.HealthzPort = 0
} else { } else {
x.HealthzPort = int(r.DecodeInt(codecSelferBitsize1234)) x.HealthzPort = int32(r.DecodeInt(32))
} }
yyj79++ yyj79++
if yyhl79 { if yyhl79 {
...@@ -770,7 +770,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -770,7 +770,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.IPTablesSyncePeriodSeconds = 0 x.IPTablesSyncePeriodSeconds = 0
} else { } else {
x.IPTablesSyncePeriodSeconds = int(r.DecodeInt(codecSelferBitsize1234)) x.IPTablesSyncePeriodSeconds = int32(r.DecodeInt(32))
} }
yyj79++ yyj79++
if yyhl79 { if yyhl79 {
...@@ -786,7 +786,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -786,7 +786,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.KubeAPIBurst = 0 x.KubeAPIBurst = 0
} else { } else {
x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) x.KubeAPIBurst = int32(r.DecodeInt(32))
} }
yyj79++ yyj79++
if yyhl79 { if yyhl79 {
...@@ -802,7 +802,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -802,7 +802,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.KubeAPIQPS = 0 x.KubeAPIQPS = 0
} else { } else {
x.KubeAPIQPS = int(r.DecodeInt(codecSelferBitsize1234)) x.KubeAPIQPS = int32(r.DecodeInt(32))
} }
yyj79++ yyj79++
if yyhl79 { if yyhl79 {
...@@ -869,13 +869,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -869,13 +869,13 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
} }
} else { } else {
if x.OOMScoreAdj == nil { if x.OOMScoreAdj == nil {
x.OOMScoreAdj = new(int) x.OOMScoreAdj = new(int32)
} }
yym94 := z.DecBinary() yym94 := z.DecBinary()
_ = yym94 _ = yym94
if false { if false {
} else { } else {
*((*int)(x.OOMScoreAdj)) = int(r.DecodeInt(codecSelferBitsize1234)) *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32))
} }
} }
yyj79++ yyj79++
...@@ -940,7 +940,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De ...@@ -940,7 +940,7 @@ func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.De
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.UDPTimeoutMilliseconds = 0 x.UDPTimeoutMilliseconds = 0
} else { } else {
x.UDPTimeoutMilliseconds = int(r.DecodeInt(codecSelferBitsize1234)) x.UDPTimeoutMilliseconds = int32(r.DecodeInt(32))
} }
for { for {
yyj79++ yyj79++
......
...@@ -21,22 +21,22 @@ import "k8s.io/kubernetes/pkg/api/unversioned" ...@@ -21,22 +21,22 @@ import "k8s.io/kubernetes/pkg/api/unversioned"
type KubeProxyConfiguration struct { type KubeProxyConfiguration struct {
unversioned.TypeMeta unversioned.TypeMeta
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 for all interfaces) // bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 for all int32erfaces)
BindAddress string `json:"bindAddress"` BindAddress string `json:"bindAddress"`
// cleanupIPTables // cleanupIPTables
CleanupIPTables bool `json:"cleanupIPTables"` CleanupIPTables bool `json:"cleanupIPTables"`
// healthzBindAddress is the IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) // healthzBindAddress is the IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all int32erfaces)
HealthzBindAddress string `json:"healthzBindAddress"` HealthzBindAddress string `json:"healthzBindAddress"`
// healthzPort is the port to bind the health check server. Use 0 to disable. // healthzPort is the port to bind the health check server. Use 0 to disable.
HealthzPort int `json:"healthzPort"` HealthzPort int32 `json:"healthzPort"`
// hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname. // hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
HostnameOverride string `json:"hostnameOverride"` HostnameOverride string `json:"hostnameOverride"`
// iptablesSyncPeriodSeconds is the period that iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0. // iptablesSyncPeriodSeconds is the period that iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.
IPTablesSyncePeriodSeconds int `json:"iptablesSyncPeriodSeconds"` IPTablesSyncePeriodSeconds int32 `json:"iptablesSyncPeriodSeconds"`
// kubeAPIBurst is the burst to use while talking with kubernetes apiserver // kubeAPIBurst is the burst to use while talking with kubernetes apiserver
KubeAPIBurst int `json:"kubeAPIBurst"` KubeAPIBurst int32 `json:"kubeAPIBurst"`
// kubeAPIQPS is the max QPS to use while talking with kubernetes apiserver // kubeAPIQPS is the max QPS to use while talking with kubernetes apiserver
KubeAPIQPS int `json:"kubeAPIQPS"` KubeAPIQPS int32 `json:"kubeAPIQPS"`
// kubeconfigPath is the path to the kubeconfig file with authorization information (the master location is set by the master flag). // kubeconfigPath is the path to the kubeconfig file with authorization information (the master location is set by the master flag).
KubeconfigPath string `json:"kubeconfigPath"` KubeconfigPath string `json:"kubeconfigPath"`
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. // masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
...@@ -44,7 +44,7 @@ type KubeProxyConfiguration struct { ...@@ -44,7 +44,7 @@ type KubeProxyConfiguration struct {
// master is the address of the Kubernetes API server (overrides any value in kubeconfig) // master is the address of the Kubernetes API server (overrides any value in kubeconfig)
Master string `json:"master"` Master string `json:"master"`
// oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000] // oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]
OOMScoreAdj *int `json:"oomScoreAdj"` OOMScoreAdj *int32 `json:"oomScoreAdj"`
// mode specifies which proxy mode to use. // mode specifies which proxy mode to use.
Mode ProxyMode `json:"mode"` Mode ProxyMode `json:"mode"`
// portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen. // portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.
...@@ -52,7 +52,7 @@ type KubeProxyConfiguration struct { ...@@ -52,7 +52,7 @@ type KubeProxyConfiguration struct {
// resourceContainer is the bsolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy). // resourceContainer is the bsolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).
ResourceContainer string `json:"resourceContainer"` ResourceContainer string `json:"resourceContainer"`
// udpTimeoutMilliseconds is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode=userspace. // udpTimeoutMilliseconds is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). Must be greater than 0. Only applicable for proxyMode=userspace.
UDPTimeoutMilliseconds int `json:"udpTimeoutMilliseconds"` UDPTimeoutMilliseconds int32 `json:"udpTimeoutMilliseconds"`
} }
// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy. // Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.
......
...@@ -203,8 +203,8 @@ func convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions. ...@@ -203,8 +203,8 @@ func convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*extensions.DeploymentSpec))(in) defaulting.(func(*extensions.DeploymentSpec))(in)
} }
out.Replicas = new(int) out.Replicas = new(int32)
*out.Replicas = in.Replicas *out.Replicas = int32(in.Replicas)
if in.Selector != nil { if in.Selector != nil {
out.Selector = make(map[string]string) out.Selector = make(map[string]string)
for key, val := range in.Selector { for key, val := range in.Selector {
...@@ -229,7 +229,7 @@ func convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS ...@@ -229,7 +229,7 @@ func convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS
defaulting.(func(*DeploymentSpec))(in) defaulting.(func(*DeploymentSpec))(in)
} }
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = *in.Replicas out.Replicas = int(*in.Replicas)
} }
if in.Selector != nil { if in.Selector != nil {
out.Selector = make(map[string]string) out.Selector = make(map[string]string)
...@@ -299,7 +299,7 @@ func convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployme ...@@ -299,7 +299,7 @@ func convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployme
if err := s.Convert(&in.MaxSurge, out.MaxSurge, 0); err != nil { if err := s.Convert(&in.MaxSurge, out.MaxSurge, 0); err != nil {
return err return err
} }
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = int32(in.MinReadySeconds)
return nil return nil
} }
...@@ -313,7 +313,7 @@ func convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme ...@@ -313,7 +313,7 @@ func convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme
if err := s.Convert(in.MaxSurge, &out.MaxSurge, 0); err != nil { if err := s.Convert(in.MaxSurge, &out.MaxSurge, 0); err != nil {
return err return err
} }
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = int(in.MinReadySeconds)
return nil return nil
} }
......
...@@ -300,7 +300,7 @@ func deepCopy_v1_FCVolumeSource(in v1.FCVolumeSource, out *v1.FCVolumeSource, c ...@@ -300,7 +300,7 @@ func deepCopy_v1_FCVolumeSource(in v1.FCVolumeSource, out *v1.FCVolumeSource, c
out.TargetWWNs = nil out.TargetWWNs = nil
} }
if in.Lun != nil { if in.Lun != nil {
out.Lun = new(int) out.Lun = new(int32)
*out.Lun = *in.Lun *out.Lun = *in.Lun
} else { } else {
out.Lun = nil out.Lun = nil
...@@ -1046,7 +1046,7 @@ func deepCopy_v1beta1_DeploymentList(in DeploymentList, out *DeploymentList, c * ...@@ -1046,7 +1046,7 @@ func deepCopy_v1beta1_DeploymentList(in DeploymentList, out *DeploymentList, c *
func deepCopy_v1beta1_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c *conversion.Cloner) error { func deepCopy_v1beta1_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c *conversion.Cloner) error {
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = new(int) out.Replicas = new(int32)
*out.Replicas = *in.Replicas *out.Replicas = *in.Replicas
} else { } else {
out.Replicas = nil out.Replicas = nil
...@@ -1156,7 +1156,7 @@ func deepCopy_v1beta1_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec ...@@ -1156,7 +1156,7 @@ func deepCopy_v1beta1_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec
return err return err
} }
if in.MinReplicas != nil { if in.MinReplicas != nil {
out.MinReplicas = new(int) out.MinReplicas = new(int32)
*out.MinReplicas = *in.MinReplicas *out.MinReplicas = *in.MinReplicas
} else { } else {
out.MinReplicas = nil out.MinReplicas = nil
...@@ -1191,7 +1191,7 @@ func deepCopy_v1beta1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerSt ...@@ -1191,7 +1191,7 @@ func deepCopy_v1beta1_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerSt
out.CurrentReplicas = in.CurrentReplicas out.CurrentReplicas = in.CurrentReplicas
out.DesiredReplicas = in.DesiredReplicas out.DesiredReplicas = in.DesiredReplicas
if in.CurrentCPUUtilizationPercentage != nil { if in.CurrentCPUUtilizationPercentage != nil {
out.CurrentCPUUtilizationPercentage = new(int) out.CurrentCPUUtilizationPercentage = new(int32)
*out.CurrentCPUUtilizationPercentage = *in.CurrentCPUUtilizationPercentage *out.CurrentCPUUtilizationPercentage = *in.CurrentCPUUtilizationPercentage
} else { } else {
out.CurrentCPUUtilizationPercentage = nil out.CurrentCPUUtilizationPercentage = nil
...@@ -1344,13 +1344,13 @@ func deepCopy_v1beta1_JobList(in JobList, out *JobList, c *conversion.Cloner) er ...@@ -1344,13 +1344,13 @@ func deepCopy_v1beta1_JobList(in JobList, out *JobList, c *conversion.Cloner) er
func deepCopy_v1beta1_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) error { func deepCopy_v1beta1_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) error {
if in.Parallelism != nil { if in.Parallelism != nil {
out.Parallelism = new(int) out.Parallelism = new(int32)
*out.Parallelism = *in.Parallelism *out.Parallelism = *in.Parallelism
} else { } else {
out.Parallelism = nil out.Parallelism = nil
} }
if in.Completions != nil { if in.Completions != nil {
out.Completions = new(int) out.Completions = new(int32)
*out.Completions = *in.Completions *out.Completions = *in.Completions
} else { } else {
out.Completions = nil out.Completions = nil
......
...@@ -59,7 +59,7 @@ func addDefaultingFuncs() { ...@@ -59,7 +59,7 @@ func addDefaultingFuncs() {
} }
// Set DeploymentSpec.Replicas to 1 if it is not set. // Set DeploymentSpec.Replicas to 1 if it is not set.
if obj.Spec.Replicas == nil { if obj.Spec.Replicas == nil {
obj.Spec.Replicas = new(int) obj.Spec.Replicas = new(int32)
*obj.Spec.Replicas = 1 *obj.Spec.Replicas = 1
} }
strategy := &obj.Spec.Strategy strategy := &obj.Spec.Strategy
...@@ -102,7 +102,7 @@ func addDefaultingFuncs() { ...@@ -102,7 +102,7 @@ func addDefaultingFuncs() {
} }
} }
if obj.Spec.Completions == nil { if obj.Spec.Completions == nil {
completions := 1 completions := int32(1)
obj.Spec.Completions = &completions obj.Spec.Completions = &completions
} }
if obj.Spec.Parallelism == nil { if obj.Spec.Parallelism == nil {
...@@ -111,7 +111,7 @@ func addDefaultingFuncs() { ...@@ -111,7 +111,7 @@ func addDefaultingFuncs() {
}, },
func(obj *HorizontalPodAutoscaler) { func(obj *HorizontalPodAutoscaler) {
if obj.Spec.MinReplicas == nil { if obj.Spec.MinReplicas == nil {
minReplicas := 1 minReplicas := int32(1)
obj.Spec.MinReplicas = &minReplicas obj.Spec.MinReplicas = &minReplicas
} }
if obj.Spec.CPUUtilization == nil { if obj.Spec.CPUUtilization == nil {
......
...@@ -105,7 +105,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -105,7 +105,7 @@ func TestSetDefaultDeployment(t *testing.T) {
original: &Deployment{}, original: &Deployment{},
expected: &Deployment{ expected: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(1), Replicas: newInt32(1),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RollingUpdateDeploymentStrategyType, Type: RollingUpdateDeploymentStrategyType,
RollingUpdate: &RollingUpdateDeployment{ RollingUpdate: &RollingUpdateDeployment{
...@@ -121,7 +121,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -121,7 +121,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{ {
original: &Deployment{ original: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
RollingUpdate: &RollingUpdateDeployment{ RollingUpdate: &RollingUpdateDeployment{
MaxSurge: &differentIntOrString, MaxSurge: &differentIntOrString,
...@@ -131,7 +131,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -131,7 +131,7 @@ func TestSetDefaultDeployment(t *testing.T) {
}, },
expected: &Deployment{ expected: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RollingUpdateDeploymentStrategyType, Type: RollingUpdateDeploymentStrategyType,
RollingUpdate: &RollingUpdateDeployment{ RollingUpdate: &RollingUpdateDeployment{
...@@ -147,7 +147,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -147,7 +147,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{ {
original: &Deployment{ original: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RecreateDeploymentStrategyType, Type: RecreateDeploymentStrategyType,
}, },
...@@ -155,7 +155,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -155,7 +155,7 @@ func TestSetDefaultDeployment(t *testing.T) {
}, },
expected: &Deployment{ expected: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RecreateDeploymentStrategyType, Type: RecreateDeploymentStrategyType,
}, },
...@@ -167,7 +167,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -167,7 +167,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{ {
original: &Deployment{ original: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RecreateDeploymentStrategyType, Type: RecreateDeploymentStrategyType,
}, },
...@@ -176,7 +176,7 @@ func TestSetDefaultDeployment(t *testing.T) { ...@@ -176,7 +176,7 @@ func TestSetDefaultDeployment(t *testing.T) {
}, },
expected: &Deployment{ expected: &Deployment{
Spec: DeploymentSpec{ Spec: DeploymentSpec{
Replicas: newInt(5), Replicas: newInt32(5),
Strategy: DeploymentStrategy{ Strategy: DeploymentStrategy{
Type: RecreateDeploymentStrategyType, Type: RecreateDeploymentStrategyType,
}, },
...@@ -208,8 +208,8 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -208,8 +208,8 @@ func TestSetDefaultJob(t *testing.T) {
Selector: &PodSelector{ Selector: &PodSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
Completions: newInt(1), Completions: newInt32(1),
Parallelism: newInt(1), Parallelism: newInt32(1),
}, },
} }
tests := []*Job{ tests := []*Job{
...@@ -234,7 +234,7 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -234,7 +234,7 @@ func TestSetDefaultJob(t *testing.T) {
// selector from template labels, completions set explicitly, parallelism - default // selector from template labels, completions set explicitly, parallelism - default
{ {
Spec: JobSpec{ Spec: JobSpec{
Completions: newInt(1), Completions: newInt32(1),
Template: v1.PodTemplateSpec{ Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{ ObjectMeta: v1.ObjectMeta{
Labels: map[string]string{"job": "selector"}, Labels: map[string]string{"job": "selector"},
...@@ -245,7 +245,7 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -245,7 +245,7 @@ func TestSetDefaultJob(t *testing.T) {
// selector from template labels, completions - default, parallelism set explicitly // selector from template labels, completions - default, parallelism set explicitly
{ {
Spec: JobSpec{ Spec: JobSpec{
Parallelism: newInt(1), Parallelism: newInt32(1),
Template: v1.PodTemplateSpec{ Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{ ObjectMeta: v1.ObjectMeta{
Labels: map[string]string{"job": "selector"}, Labels: map[string]string{"job": "selector"},
...@@ -294,8 +294,8 @@ func roundTrip(t *testing.T, obj runtime.Object) runtime.Object { ...@@ -294,8 +294,8 @@ func roundTrip(t *testing.T, obj runtime.Object) runtime.Object {
return obj3 return obj3
} }
func newInt(val int) *int { func newInt32(val int32) *int32 {
p := new(int) p := new(int32)
*p = val *p = val
return p return p
} }
......
...@@ -25,13 +25,13 @@ import ( ...@@ -25,13 +25,13 @@ import (
// describes the attributes of a scale subresource // describes the attributes of a scale subresource
type ScaleSpec struct { type ScaleSpec struct {
// desired number of instances for the scaled object. // desired number of instances for the scaled object.
Replicas int `json:"replicas,omitempty"` Replicas int32 `json:"replicas,omitempty"`
} }
// represents the current status of a scale subresource. // represents the current status of a scale subresource.
type ScaleStatus struct { type ScaleStatus struct {
// actual number of observed instances of the scaled object. // actual number of observed instances of the scaled object.
Replicas int `json:"replicas"` Replicas int32 `json:"replicas"`
// label query over pods that should match the replicas count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors // label query over pods that should match the replicas count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors
Selector map[string]string `json:"selector,omitempty"` Selector map[string]string `json:"selector,omitempty"`
...@@ -70,7 +70,7 @@ type SubresourceReference struct { ...@@ -70,7 +70,7 @@ type SubresourceReference struct {
type CPUTargetUtilization struct { type CPUTargetUtilization struct {
// fraction of the requested CPU that should be utilized/used, // fraction of the requested CPU that should be utilized/used,
// e.g. 70 means that 70% of the requested CPU should be in use. // e.g. 70 means that 70% of the requested CPU should be in use.
TargetPercentage int `json:"targetPercentage"` TargetPercentage int32 `json:"targetPercentage"`
} }
// specification of a horizontal pod autoscaler. // specification of a horizontal pod autoscaler.
...@@ -79,9 +79,9 @@ type HorizontalPodAutoscalerSpec struct { ...@@ -79,9 +79,9 @@ type HorizontalPodAutoscalerSpec struct {
// and will set the desired number of pods by modifying its spec. // and will set the desired number of pods by modifying its spec.
ScaleRef SubresourceReference `json:"scaleRef"` ScaleRef SubresourceReference `json:"scaleRef"`
// lower limit for the number of pods that can be set by the autoscaler, default 1. // lower limit for the number of pods that can be set by the autoscaler, default 1.
MinReplicas *int `json:"minReplicas,omitempty"` MinReplicas *int32 `json:"minReplicas,omitempty"`
// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
MaxReplicas int `json:"maxReplicas"` MaxReplicas int32 `json:"maxReplicas"`
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods; // target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified it defaults to the target CPU utilization at 80% of the requested resources. // if not specified it defaults to the target CPU utilization at 80% of the requested resources.
CPUUtilization *CPUTargetUtilization `json:"cpuUtilization,omitempty"` CPUUtilization *CPUTargetUtilization `json:"cpuUtilization,omitempty"`
...@@ -97,14 +97,14 @@ type HorizontalPodAutoscalerStatus struct { ...@@ -97,14 +97,14 @@ type HorizontalPodAutoscalerStatus struct {
LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty"` LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty"`
// current number of replicas of pods managed by this autoscaler. // current number of replicas of pods managed by this autoscaler.
CurrentReplicas int `json:"currentReplicas"` CurrentReplicas int32 `json:"currentReplicas"`
// desired number of replicas of pods managed by this autoscaler. // desired number of replicas of pods managed by this autoscaler.
DesiredReplicas int `json:"desiredReplicas"` DesiredReplicas int32 `json:"desiredReplicas"`
// current average CPU utilization over all pods, represented as a percentage of requested CPU, // current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU. // e.g. 70 means that an average pod is using now 70% of its requested CPU.
CurrentCPUUtilizationPercentage *int `json:"currentCPUUtilizationPercentage,omitempty"` CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"`
} }
// configuration of a horizontal pod autoscaler. // configuration of a horizontal pod autoscaler.
...@@ -192,7 +192,7 @@ type Deployment struct { ...@@ -192,7 +192,7 @@ type Deployment struct {
type DeploymentSpec struct { type DeploymentSpec struct {
// Number of desired pods. This is a pointer to distinguish between explicit // Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1. // zero and not specified. Defaults to 1.
Replicas *int `json:"replicas,omitempty"` Replicas *int32 `json:"replicas,omitempty"`
// Label selector for pods. Existing ReplicationControllers whose pods are // Label selector for pods. Existing ReplicationControllers whose pods are
// selected by this will be the ones affected by this deployment. // selected by this will be the ones affected by this deployment.
...@@ -268,16 +268,16 @@ type RollingUpdateDeployment struct { ...@@ -268,16 +268,16 @@ type RollingUpdateDeployment struct {
// Minimum number of seconds for which a newly created pod should be ready // Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available. // without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready) // Defaults to 0 (pod will be considered available as soon as it is ready)
MinReadySeconds int `json:"minReadySeconds,omitempty"` MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
} }
// DeploymentStatus is the most recently observed status of the Deployment. // DeploymentStatus is the most recently observed status of the Deployment.
type DeploymentStatus struct { type DeploymentStatus struct {
// Total number of non-terminated pods targeted by this deployment (their labels match the selector). // Total number of non-terminated pods targeted by this deployment (their labels match the selector).
Replicas int `json:"replicas,omitempty"` Replicas int32 `json:"replicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec. // Total number of non-terminated pods targeted by this deployment that have the desired template spec.
UpdatedReplicas int `json:"updatedReplicas,omitempty"` UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
} }
// DeploymentList is a list of Deployments. // DeploymentList is a list of Deployments.
...@@ -311,17 +311,17 @@ type DaemonSetStatus struct { ...@@ -311,17 +311,17 @@ type DaemonSetStatus struct {
// CurrentNumberScheduled is the number of nodes that are running at least 1 // CurrentNumberScheduled is the number of nodes that are running at least 1
// daemon pod and are supposed to run the daemon pod. // daemon pod and are supposed to run the daemon pod.
// More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md // More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md
CurrentNumberScheduled int `json:"currentNumberScheduled"` CurrentNumberScheduled int32 `json:"currentNumberScheduled"`
// NumberMisscheduled is the number of nodes that are running the daemon pod, but are // NumberMisscheduled is the number of nodes that are running the daemon pod, but are
// not supposed to run the daemon pod. // not supposed to run the daemon pod.
// More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md // More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md
NumberMisscheduled int `json:"numberMisscheduled"` NumberMisscheduled int32 `json:"numberMisscheduled"`
// DesiredNumberScheduled is the total number of nodes that should be running the daemon // DesiredNumberScheduled is the total number of nodes that should be running the daemon
// pod (including nodes correctly running the daemon pod). // pod (including nodes correctly running the daemon pod).
// More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md // More info: http://releases.k8s.io/HEAD/docs/admin/daemon.md
DesiredNumberScheduled int `json:"desiredNumberScheduled"` DesiredNumberScheduled int32 `json:"desiredNumberScheduled"`
} }
// DaemonSet represents the configuration of a daemon set. // DaemonSet represents the configuration of a daemon set.
...@@ -400,12 +400,12 @@ type JobSpec struct { ...@@ -400,12 +400,12 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), // be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism. // i.e. when the work left to do is less than max parallelism.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md // More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md
Parallelism *int `json:"parallelism,omitempty"` Parallelism *int32 `json:"parallelism,omitempty"`
// Completions specifies the desired number of successfully finished pods the // Completions specifies the desired number of successfully finished pods the
// job should be run with. Defaults to 1. // job should be run with. Defaults to 1.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md // More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md
Completions *int `json:"completions,omitempty"` Completions *int32 `json:"completions,omitempty"`
// Selector is a label query over pods that should match the pod count. // Selector is a label query over pods that should match the pod count.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors
...@@ -435,13 +435,13 @@ type JobStatus struct { ...@@ -435,13 +435,13 @@ type JobStatus struct {
CompletionTime *unversioned.Time `json:"completionTime,omitempty"` CompletionTime *unversioned.Time `json:"completionTime,omitempty"`
// Active is the number of actively running pods. // Active is the number of actively running pods.
Active int `json:"active,omitempty"` Active int32 `json:"active,omitempty"`
// Succeeded is the number of pods which reached Phase Succeeded. // Succeeded is the number of pods which reached Phase Succeeded.
Succeeded int `json:"succeeded,omitempty"` Succeeded int32 `json:"succeeded,omitempty"`
// Failed is the number of pods which reached Phase Failed. // Failed is the number of pods which reached Phase Failed.
Failed int `json:"failed,omitempty"` Failed int32 `json:"failed,omitempty"`
} }
type JobConditionType string type JobConditionType string
...@@ -621,10 +621,10 @@ type NodeUtilization struct { ...@@ -621,10 +621,10 @@ type NodeUtilization struct {
// Configuration of the Cluster Autoscaler // Configuration of the Cluster Autoscaler
type ClusterAutoscalerSpec struct { type ClusterAutoscalerSpec struct {
// Minimum number of nodes that the cluster should have. // Minimum number of nodes that the cluster should have.
MinNodes int `json:"minNodes"` MinNodes int32 `json:"minNodes"`
// Maximum number of nodes that the cluster should have. // Maximum number of nodes that the cluster should have.
MaxNodes int `json:"maxNodes"` MaxNodes int32 `json:"maxNodes"`
// Target average utilization of the cluster nodes. New nodes will be added if one of the // Target average utilization of the cluster nodes. New nodes will be added if one of the
// targets is exceeded. Cluster size will be decreased if the current utilization is too low // targets is exceeded. Cluster size will be decreased if the current utilization is too low
......
...@@ -249,7 +249,7 @@ func getIntOrPercentValue(intOrStringValue intstr.IntOrString) int { ...@@ -249,7 +249,7 @@ func getIntOrPercentValue(intOrStringValue intstr.IntOrString) int {
if isPercent { if isPercent {
return value return value
} }
return intOrStringValue.IntVal return intOrStringValue.IntValue()
} }
func IsNotMoreThan100Percent(intOrStringValue intstr.IntOrString, fieldName string) validation.ErrorList { func IsNotMoreThan100Percent(intOrStringValue intstr.IntOrString, fieldName string) validation.ErrorList {
...@@ -525,7 +525,7 @@ func validateIngressBackend(backend *extensions.IngressBackend) validation.Error ...@@ -525,7 +525,7 @@ func validateIngressBackend(backend *extensions.IngressBackend) validation.Error
if !validation.IsValidPortName(backend.ServicePort.StrVal) { if !validation.IsValidPortName(backend.ServicePort.StrVal) {
allErrs = append(allErrs, validation.NewInvalidError("servicePort", backend.ServicePort.StrVal, apivalidation.PortNameErrorMsg)) allErrs = append(allErrs, validation.NewInvalidError("servicePort", backend.ServicePort.StrVal, apivalidation.PortNameErrorMsg))
} }
} else if !validation.IsValidPortNum(backend.ServicePort.IntVal) { } else if !validation.IsValidPortNum(backend.ServicePort.IntValue()) {
allErrs = append(allErrs, validation.NewInvalidError("servicePort", backend.ServicePort, apivalidation.PortRangeErrorMsg)) allErrs = append(allErrs, validation.NewInvalidError("servicePort", backend.ServicePort, apivalidation.PortRangeErrorMsg))
} }
return allErrs return allErrs
......
...@@ -420,8 +420,9 @@ func prettyJSON(codec runtime.Codec, object runtime.Object, w http.ResponseWrite ...@@ -420,8 +420,9 @@ func prettyJSON(codec runtime.Codec, object runtime.Object, w http.ResponseWrite
// errorJSON renders an error to the response. Returns the HTTP status code of the error. // errorJSON renders an error to the response. Returns the HTTP status code of the error.
func errorJSON(err error, codec runtime.Codec, w http.ResponseWriter) int { func errorJSON(err error, codec runtime.Codec, w http.ResponseWriter) int {
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, codec, status, w, true) code := int(status.Code)
return status.Code writeJSON(code, codec, status, w, true)
return code
} }
// errorJSONFatal renders an error to the response, and if codec fails will render plaintext. // errorJSONFatal renders an error to the response, and if codec fails will render plaintext.
...@@ -429,16 +430,17 @@ func errorJSON(err error, codec runtime.Codec, w http.ResponseWriter) int { ...@@ -429,16 +430,17 @@ func errorJSON(err error, codec runtime.Codec, w http.ResponseWriter) int {
func errorJSONFatal(err error, codec runtime.Codec, w http.ResponseWriter) int { func errorJSONFatal(err error, codec runtime.Codec, w http.ResponseWriter) int {
util.HandleError(fmt.Errorf("apiserver was unable to write a JSON response: %v", err)) util.HandleError(fmt.Errorf("apiserver was unable to write a JSON response: %v", err))
status := errToAPIStatus(err) status := errToAPIStatus(err)
code := int(status.Code)
output, err := codec.Encode(status) output, err := codec.Encode(status)
if err != nil { if err != nil {
w.WriteHeader(status.Code) w.WriteHeader(code)
fmt.Fprintf(w, "%s: %s", status.Reason, status.Message) fmt.Fprintf(w, "%s: %s", status.Reason, status.Message)
return status.Code return code
} }
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status.Code) w.WriteHeader(code)
w.Write(output) w.Write(output)
return status.Code return code
} }
// writeRawJSON writes a non-API object in JSON. // writeRawJSON writes a non-API object in JSON.
......
...@@ -62,7 +62,7 @@ func errToAPIStatus(err error) *unversioned.Status { ...@@ -62,7 +62,7 @@ func errToAPIStatus(err error) *unversioned.Status {
util.HandleError(fmt.Errorf("apiserver received an error that is not an unversioned.Status: %v", err)) util.HandleError(fmt.Errorf("apiserver received an error that is not an unversioned.Status: %v", err))
return &unversioned.Status{ return &unversioned.Status{
Status: unversioned.StatusFailure, Status: unversioned.StatusFailure,
Code: status, Code: int32(status),
Reason: unversioned.StatusReasonUnknown, Reason: unversioned.StatusReasonUnknown,
Message: err.Error(), Message: err.Error(),
} }
......
...@@ -109,8 +109,9 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { ...@@ -109,8 +109,9 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if err != nil { if err != nil {
httplog.LogOf(req, w).Addf("Error getting ResourceLocation: %v", err) httplog.LogOf(req, w).Addf("Error getting ResourceLocation: %v", err)
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, r.codec, status, w, true) code := int(status.Code)
httpCode = status.Code writeJSON(code, r.codec, status, w, true)
httpCode = code
return return
} }
if location == nil { if location == nil {
...@@ -144,9 +145,10 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { ...@@ -144,9 +145,10 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
newReq, err := http.NewRequest(req.Method, location.String(), req.Body) newReq, err := http.NewRequest(req.Method, location.String(), req.Body)
if err != nil { if err != nil {
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, r.codec, status, w, true) code := int(status.Code)
writeJSON(code, r.codec, status, w, true)
notFound(w, req) notFound(w, req)
httpCode = status.Code httpCode = code
return return
} }
httpCode = http.StatusOK httpCode = http.StatusOK
...@@ -211,7 +213,8 @@ func (r *ProxyHandler) tryUpgrade(w http.ResponseWriter, req, newReq *http.Reque ...@@ -211,7 +213,8 @@ func (r *ProxyHandler) tryUpgrade(w http.ResponseWriter, req, newReq *http.Reque
backendConn, err := proxyutil.DialURL(location, transport) backendConn, err := proxyutil.DialURL(location, transport)
if err != nil { if err != nil {
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, r.codec, status, w, true) code := int(status.Code)
writeJSON(code, r.codec, status, w, true)
return true return true
} }
defer backendConn.Close() defer backendConn.Close()
...@@ -222,14 +225,16 @@ func (r *ProxyHandler) tryUpgrade(w http.ResponseWriter, req, newReq *http.Reque ...@@ -222,14 +225,16 @@ func (r *ProxyHandler) tryUpgrade(w http.ResponseWriter, req, newReq *http.Reque
requestHijackedConn, _, err := w.(http.Hijacker).Hijack() requestHijackedConn, _, err := w.(http.Hijacker).Hijack()
if err != nil { if err != nil {
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, r.codec, status, w, true) code := int(status.Code)
writeJSON(code, r.codec, status, w, true)
return true return true
} }
defer requestHijackedConn.Close() defer requestHijackedConn.Close()
if err = newReq.Write(backendConn); err != nil { if err = newReq.Write(backendConn); err != nil {
status := errToAPIStatus(err) status := errToAPIStatus(err)
writeJSON(status.Code, r.codec, status, w, true) code := int(status.Code)
writeJSON(code, r.codec, status, w, true)
return true return true
} }
......
...@@ -347,7 +347,7 @@ func TestTransformResponse(t *testing.T) { ...@@ -347,7 +347,7 @@ func TestTransformResponse(t *testing.T) {
t.Errorf("%d: response should have been transformable into APIStatus: %v", i, err) t.Errorf("%d: response should have been transformable into APIStatus: %v", i, err)
continue continue
} }
if status.Status().Code != test.Response.StatusCode { if int(status.Status().Code) != test.Response.StatusCode {
t.Errorf("%d: status code did not match response: %#v", i, status.Status()) t.Errorf("%d: status code did not match response: %#v", i, status.Status())
} }
} }
......
...@@ -419,7 +419,7 @@ func findPort(pod *api.Pod, svcPort *api.ServicePort) (int, error) { ...@@ -419,7 +419,7 @@ func findPort(pod *api.Pod, svcPort *api.ServicePort) (int, error) {
} }
} }
case intstr.Int: case intstr.Int:
return portName.IntVal, nil return portName.IntValue(), nil
} }
return 0, fmt.Errorf("no suitable port for manifest: %s", pod.UID) return 0, fmt.Errorf("no suitable port for manifest: %s", pod.UID)
......
...@@ -489,7 +489,7 @@ func extractMaxValue(field intstr.IntOrString, name string, value int) (int, err ...@@ -489,7 +489,7 @@ func extractMaxValue(field intstr.IntOrString, name string, value int) (int, err
if field.IntVal < 0 { if field.IntVal < 0 {
return 0, fmt.Errorf("%s must be >= 0", name) return 0, fmt.Errorf("%s must be >= 0", name)
} }
return field.IntVal, nil return field.IntValue(), nil
case intstr.String: case intstr.String:
s := strings.Replace(field.StrVal, "%", "", -1) s := strings.Replace(field.StrVal, "%", "", -1)
v, err := strconv.Atoi(s) v, err := strconv.Atoi(s)
......
...@@ -33,7 +33,7 @@ func encodeOrDie(obj runtime.Object) []byte { ...@@ -33,7 +33,7 @@ func encodeOrDie(obj runtime.Object) []byte {
} }
func TestSortingPrinter(t *testing.T) { func TestSortingPrinter(t *testing.T) {
intPtr := func(val int) *int { return &val } intPtr := func(val int32) *int32 { return &val }
a := &api.Pod{ a := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
......
...@@ -68,19 +68,17 @@ func (hr *HandlerRunner) Run(containerID kubecontainer.ContainerID, pod *api.Pod ...@@ -68,19 +68,17 @@ func (hr *HandlerRunner) Run(containerID kubecontainer.ContainerID, pod *api.Pod
// port is found, an error is returned. // port is found, an error is returned.
func resolvePort(portReference intstr.IntOrString, container *api.Container) (int, error) { func resolvePort(portReference intstr.IntOrString, container *api.Container) (int, error) {
if portReference.Type == intstr.Int { if portReference.Type == intstr.Int {
return portReference.IntVal, nil return portReference.IntValue(), nil
} else { }
portName := portReference.StrVal portName := portReference.StrVal
port, err := strconv.Atoi(portName) port, err := strconv.Atoi(portName)
if err == nil { if err == nil {
return port, nil return port, nil
} }
for _, portSpec := range container.Ports { for _, portSpec := range container.Ports {
if portSpec.Name == portName { if portSpec.Name == portName {
return portSpec.ContainerPort, nil return portSpec.ContainerPort, nil
}
} }
} }
return -1, fmt.Errorf("couldn't find port: %v in %v", portReference, container) return -1, fmt.Errorf("couldn't find port: %v in %v", portReference, container)
} }
......
...@@ -163,7 +163,7 @@ func extractPort(param intstr.IntOrString, container api.Container) (int, error) ...@@ -163,7 +163,7 @@ func extractPort(param intstr.IntOrString, container api.Container) (int, error)
var err error var err error
switch param.Type { switch param.Type {
case intstr.Int: case intstr.Int:
port = param.IntVal port = param.IntValue()
case intstr.String: case intstr.String:
if port, err = findPortByName(container, param.StrVal); err != nil { if port, err = findPortByName(container, param.StrVal); err != nil {
// Last ditch effort - maybe it was an int stored as string? // Last ditch effort - maybe it was an int stored as string?
......
...@@ -163,7 +163,7 @@ func (w *worker) doProbe() (keepGoing bool) { ...@@ -163,7 +163,7 @@ func (w *worker) doProbe() (keepGoing bool) {
w.pod.Spec.RestartPolicy != api.RestartPolicyNever w.pod.Spec.RestartPolicy != api.RestartPolicyNever
} }
if int64(time.Since(c.State.Running.StartedAt.Time).Seconds()) < w.spec.InitialDelaySeconds { if int(time.Since(c.State.Running.StartedAt.Time).Seconds()) < w.spec.InitialDelaySeconds {
return true return true
} }
......
...@@ -111,6 +111,22 @@ func (g *conversionGenerator) GenerateConversionsForType(gv unversioned.GroupVer ...@@ -111,6 +111,22 @@ func (g *conversionGenerator) GenerateConversionsForType(gv unversioned.GroupVer
return nil return nil
} }
// primitiveConversion returns true if the two types can be converted via a cast.
func primitiveConversion(inType, outType reflect.Type) (string, bool) {
switch inType.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
reflect.Float32, reflect.Float64:
switch outType.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
reflect.Float32, reflect.Float64:
return outType.Name(), true
}
}
return "", false
}
func (g *conversionGenerator) generateConversionsBetween(inType, outType reflect.Type) error { func (g *conversionGenerator) generateConversionsBetween(inType, outType reflect.Type) error {
existingConversion := g.scheme.Converter().HasConversionFunc(inType, outType) && g.scheme.Converter().HasConversionFunc(outType, inType) existingConversion := g.scheme.Converter().HasConversionFunc(inType, outType) && g.scheme.Converter().HasConversionFunc(outType, inType)
...@@ -126,6 +142,10 @@ func (g *conversionGenerator) generateConversionsBetween(inType, outType reflect ...@@ -126,6 +142,10 @@ func (g *conversionGenerator) generateConversionsBetween(inType, outType reflect
return nil return nil
} }
if _, ok := primitiveConversion(inType, outType); ok {
return nil
}
if inType.Kind() != outType.Kind() { if inType.Kind() != outType.Kind() {
if existingConversion { if existingConversion {
return nil return nil
......
...@@ -24,13 +24,14 @@ import ( ...@@ -24,13 +24,14 @@ import (
"github.com/google/gofuzz" "github.com/google/gofuzz"
) )
// IntOrString is a type that can hold an int or a string. When used in // IntOrString is a type that can hold an int32 or a string. When used in
// JSON or YAML marshalling and unmarshalling, it produces or consumes the // JSON or YAML marshalling and unmarshalling, it produces or consumes the
// inner type. This allows you to have, for example, a JSON field that can // inner type. This allows you to have, for example, a JSON field that can
// accept a name or number. // accept a name or number.
// TODO: Rename to Int32OrString
type IntOrString struct { type IntOrString struct {
Type Type Type Type
IntVal int IntVal int32
StrVal string StrVal string
} }
...@@ -42,9 +43,12 @@ const ( ...@@ -42,9 +43,12 @@ const (
String // The IntOrString holds a string. String // The IntOrString holds a string.
) )
// FromInt creates an IntOrString object with an int value. // FromInt creates an IntOrString object with an int32 value. It is
// your responsibility not to call this method with a value greater
// than int32.
// TODO: convert to (val int32)
func FromInt(val int) IntOrString { func FromInt(val int) IntOrString {
return IntOrString{Type: Int, IntVal: val} return IntOrString{Type: Int, IntVal: int32(val)}
} }
// FromString creates an IntOrString object with a string value. // FromString creates an IntOrString object with a string value.
...@@ -67,7 +71,17 @@ func (intstr *IntOrString) String() string { ...@@ -67,7 +71,17 @@ func (intstr *IntOrString) String() string {
if intstr.Type == String { if intstr.Type == String {
return intstr.StrVal return intstr.StrVal
} }
return strconv.Itoa(intstr.IntVal) return strconv.Itoa(intstr.IntValue())
}
// IntValue returns the IntVal if type Int, or if
// it is a String, will attempt a conversion to int.
func (intstr *IntOrString) IntValue() int {
if intstr.Type == String {
i, _ := strconv.Atoi(intstr.StrVal)
return i
}
return int(intstr.IntVal)
} }
// MarshalJSON implements the json.Marshaller interface. // MarshalJSON implements the json.Marshaller interface.
......
...@@ -136,14 +136,14 @@ func Until(f func(), period time.Duration, stopCh <-chan struct{}) { ...@@ -136,14 +136,14 @@ func Until(f func(), period time.Duration, stopCh <-chan struct{}) {
func GetIntOrPercentValue(intOrStr *intstr.IntOrString) (int, bool, error) { func GetIntOrPercentValue(intOrStr *intstr.IntOrString) (int, bool, error) {
switch intOrStr.Type { switch intOrStr.Type {
case intstr.Int: case intstr.Int:
return intOrStr.IntVal, false, nil return intOrStr.IntValue(), false, nil
case intstr.String: case intstr.String:
s := strings.Replace(intOrStr.StrVal, "%", "", -1) s := strings.Replace(intOrStr.StrVal, "%", "", -1)
v, err := strconv.Atoi(s) v, err := strconv.Atoi(s)
if err != nil { if err != nil {
return 0, false, fmt.Errorf("invalid value %q: %v", intOrStr.StrVal, err) return 0, false, fmt.Errorf("invalid value %q: %v", intOrStr.StrVal, err)
} }
return v, true, nil return int(v), true, nil
} }
return 0, false, fmt.Errorf("invalid value: neither int nor percentage") return 0, false, fmt.Errorf("invalid value: neither int nor percentage")
} }
......
...@@ -616,7 +616,7 @@ var _ = Describe("Kubectl client", func() { ...@@ -616,7 +616,7 @@ var _ = Describe("Kubectl client", func() {
if port.Port != servicePort { if port.Port != servicePort {
Failf("Wrong service port: %d", port.Port) Failf("Wrong service port: %d", port.Port)
} }
if port.TargetPort.IntVal != redisPort { if port.TargetPort.IntValue() != redisPort {
Failf("Wrong target port: %d") Failf("Wrong target port: %d")
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment