vendor updates

This commit is contained in:
Serguei Bezverkhi
2018-03-06 17:33:18 -05:00
parent 4b3ebc171b
commit e9033989a0
5854 changed files with 248382 additions and 119809 deletions

View File

@ -9,8 +9,7 @@ load(
go_test(
name = "go_default_test",
srcs = ["helpers_test.go"],
importpath = "k8s.io/kubernetes/pkg/apis/extensions",
library = ":go_default_library",
embed = [":go_default_library"],
)
go_library(

View File

@ -19,7 +19,6 @@ reviewers:
- ncdc
- tallclair
- mwielgus
- timothysc
- soltysh
- piosz
- dims

View File

@ -37,13 +37,13 @@ go_library(
go_test(
name = "go_default_xtest",
srcs = ["defaults_test.go"],
importpath = "k8s.io/kubernetes/pkg/apis/extensions/v1beta1_test",
deps = [
":go_default_library",
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/core/install:go_default_library",
"//pkg/apis/extensions/install:go_default_library",
"//pkg/util/pointer:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/extensions/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",

View File

@ -33,6 +33,7 @@ import (
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
. "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
)
func TestSetDefaultDaemonSetSpec(t *testing.T) {
@ -81,7 +82,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
UpdateStrategy: extensionsv1beta1.DaemonSetUpdateStrategy{
Type: extensionsv1beta1.OnDeleteDaemonSetStrategyType,
},
RevisionHistoryLimit: newInt32(10),
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
},
},
},
@ -94,7 +95,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
},
Spec: extensionsv1beta1.DaemonSetSpec{
Template: defaultTemplate,
RevisionHistoryLimit: newInt32(1),
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
},
},
expected: &extensionsv1beta1.DaemonSet{
@ -111,7 +112,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
UpdateStrategy: extensionsv1beta1.DaemonSetUpdateStrategy{
Type: extensionsv1beta1.OnDeleteDaemonSetStrategyType,
},
RevisionHistoryLimit: newInt32(1),
RevisionHistoryLimit: utilpointer.Int32Ptr(1),
},
},
},
@ -123,7 +124,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
UpdateStrategy: extensionsv1beta1.DaemonSetUpdateStrategy{
Type: extensionsv1beta1.OnDeleteDaemonSetStrategyType,
},
RevisionHistoryLimit: newInt32(10),
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
},
},
},
@ -137,7 +138,7 @@ func TestSetDefaultDaemonSetSpec(t *testing.T) {
UpdateStrategy: extensionsv1beta1.DaemonSetUpdateStrategy{
Type: extensionsv1beta1.OnDeleteDaemonSetStrategyType,
},
RevisionHistoryLimit: newInt32(10),
RevisionHistoryLimit: utilpointer.Int32Ptr(10),
},
},
},
@ -179,7 +180,7 @@ func TestSetDefaultDeployment(t *testing.T) {
original: &extensionsv1beta1.Deployment{},
expected: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(1),
Replicas: utilpointer.Int32Ptr(1),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RollingUpdateDeploymentStrategyType,
RollingUpdate: &extensionsv1beta1.RollingUpdateDeployment{
@ -194,7 +195,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{
original: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
RollingUpdate: &extensionsv1beta1.RollingUpdateDeployment{
MaxSurge: &differentIntOrString,
@ -204,7 +205,7 @@ func TestSetDefaultDeployment(t *testing.T) {
},
expected: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RollingUpdateDeploymentStrategyType,
RollingUpdate: &extensionsv1beta1.RollingUpdateDeployment{
@ -219,7 +220,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{
original: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(3),
Replicas: utilpointer.Int32Ptr(3),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RollingUpdateDeploymentStrategyType,
RollingUpdate: nil,
@ -228,7 +229,7 @@ func TestSetDefaultDeployment(t *testing.T) {
},
expected: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(3),
Replicas: utilpointer.Int32Ptr(3),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RollingUpdateDeploymentStrategyType,
RollingUpdate: &extensionsv1beta1.RollingUpdateDeployment{
@ -243,7 +244,7 @@ func TestSetDefaultDeployment(t *testing.T) {
{
original: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RecreateDeploymentStrategyType,
},
@ -251,7 +252,7 @@ func TestSetDefaultDeployment(t *testing.T) {
},
expected: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RecreateDeploymentStrategyType,
},
@ -262,21 +263,21 @@ func TestSetDefaultDeployment(t *testing.T) {
{
original: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RecreateDeploymentStrategyType,
},
ProgressDeadlineSeconds: newInt32(30),
ProgressDeadlineSeconds: utilpointer.Int32Ptr(30),
},
},
expected: &extensionsv1beta1.Deployment{
Spec: extensionsv1beta1.DeploymentSpec{
Replicas: newInt32(5),
Replicas: utilpointer.Int32Ptr(5),
Strategy: extensionsv1beta1.DeploymentStrategy{
Type: extensionsv1beta1.RecreateDeploymentStrategyType,
},
Template: defaultTemplate,
ProgressDeadlineSeconds: newInt32(30),
ProgressDeadlineSeconds: utilpointer.Int32Ptr(30),
},
},
},
@ -432,7 +433,7 @@ func TestSetDefaultReplicaSetReplicas(t *testing.T) {
{
rs: extensionsv1beta1.ReplicaSet{
Spec: extensionsv1beta1.ReplicaSetSpec{
Replicas: newInt32(0),
Replicas: utilpointer.Int32Ptr(0),
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
@ -447,7 +448,7 @@ func TestSetDefaultReplicaSetReplicas(t *testing.T) {
{
rs: extensionsv1beta1.ReplicaSet{
Spec: extensionsv1beta1.ReplicaSetSpec{
Replicas: newInt32(3),
Replicas: utilpointer.Int32Ptr(3),
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
@ -490,7 +491,7 @@ func TestDefaultRequestIsNotSetForReplicaSet(t *testing.T) {
}
rs := &extensionsv1beta1.ReplicaSet{
Spec: extensionsv1beta1.ReplicaSetSpec{
Replicas: newInt32(3),
Replicas: utilpointer.Int32Ptr(3),
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
@ -742,9 +743,3 @@ func roundTrip(t *testing.T, obj runtime.Object) runtime.Object {
}
return obj3
}
func newInt32(val int32) *int32 {
p := new(int32)
*p = val
return p
}

View File

@ -16,11 +16,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by conversion-gen. Do not edit it manually!
// Code generated by conversion-gen. DO NOT EDIT.
package v1beta1
import (
unsafe "unsafe"
v1 "k8s.io/api/core/v1"
v1beta1 "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -30,7 +32,6 @@ import (
core "k8s.io/kubernetes/pkg/apis/core"
core_v1 "k8s.io/kubernetes/pkg/apis/core/v1"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
unsafe "unsafe"
)
func init() {

View File

@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by defaulter-gen. Do not edit it manually!
// Code generated by defaulter-gen. DO NOT EDIT.
package v1beta1

View File

@ -31,8 +31,7 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["validation_test.go"],
importpath = "k8s.io/kubernetes/pkg/apis/extensions/validation",
library = ":go_default_library",
embed = [":go_default_library"],
deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",

View File

@ -96,7 +96,7 @@ func validateDaemonSetStatus(status *extensions.DaemonSetStatus, fldPath *field.
func ValidateDaemonSetStatusUpdate(ds, oldDS *extensions.DaemonSet) field.ErrorList {
allErrs := apivalidation.ValidateObjectMetaUpdate(&ds.ObjectMeta, &oldDS.ObjectMeta, field.NewPath("metadata"))
allErrs = append(allErrs, validateDaemonSetStatus(&ds.Status, field.NewPath("status"))...)
if isDecremented(ds.Status.CollisionCount, oldDS.Status.CollisionCount) {
if apivalidation.IsDecremented(ds.Status.CollisionCount, oldDS.Status.CollisionCount) {
value := int32(0)
if ds.Status.CollisionCount != nil {
value = *ds.Status.CollisionCount
@ -341,7 +341,7 @@ func ValidateDeploymentStatusUpdate(update, old *extensions.Deployment) field.Er
allErrs := apivalidation.ValidateObjectMetaUpdate(&update.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))
fldPath := field.NewPath("status")
allErrs = append(allErrs, ValidateDeploymentStatus(&update.Status, fldPath)...)
if isDecremented(update.Status.CollisionCount, old.Status.CollisionCount) {
if apivalidation.IsDecremented(update.Status.CollisionCount, old.Status.CollisionCount) {
value := int32(0)
if update.Status.CollisionCount != nil {
value = *update.Status.CollisionCount
@ -351,17 +351,6 @@ func ValidateDeploymentStatusUpdate(update, old *extensions.Deployment) field.Er
return allErrs
}
// TODO: Move in "k8s.io/kubernetes/pkg/apis/core/validation"
func isDecremented(update, old *int32) bool {
if update == nil && old != nil {
return true
}
if update == nil || old == nil {
return false
}
return *update < *old
}
func ValidateDeployment(obj *extensions.Deployment) field.ErrorList {
allErrs := apivalidation.ValidateObjectMeta(&obj.ObjectMeta, true, ValidateDeploymentName, field.NewPath("metadata"))
allErrs = append(allErrs, ValidateDeploymentSpec(&obj.Spec, field.NewPath("spec"))...)

View File

@ -1232,11 +1232,6 @@ func TestValidateDeployment(t *testing.T) {
}
}
func int64p(i int) *int64 {
i64 := int64(i)
return &i64
}
func TestValidateDeploymentStatus(t *testing.T) {
collisionCount := int32(-3)
tests := []struct {
@ -1473,8 +1468,6 @@ func TestValidateDeploymentRollback(t *testing.T) {
}
}
type ingressRules map[string]string
func TestValidateIngress(t *testing.T) {
defaultBackend := extensions.IngressBackend{
ServiceName: "default-backend",

View File

@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
// Code generated by deepcopy-gen. DO NOT EDIT.
package extensions
@ -162,9 +162,8 @@ func (in *DaemonSet) DeepCopy() *DaemonSet {
func (in *DaemonSet) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -213,9 +212,8 @@ func (in *DaemonSetList) DeepCopy() *DaemonSetList {
func (in *DaemonSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -335,9 +333,8 @@ func (in *Deployment) DeepCopy() *Deployment {
func (in *Deployment) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -387,9 +384,8 @@ func (in *DeploymentList) DeepCopy() *DeploymentList {
func (in *DeploymentList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -421,9 +417,8 @@ func (in *DeploymentRollback) DeepCopy() *DeploymentRollback {
func (in *DeploymentRollback) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -652,9 +647,8 @@ func (in *Ingress) DeepCopy() *Ingress {
func (in *Ingress) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -703,9 +697,8 @@ func (in *IngressList) DeepCopy() *IngressList {
func (in *IngressList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -850,9 +843,8 @@ func (in *PodSecurityPolicy) DeepCopy() *PodSecurityPolicy {
func (in *PodSecurityPolicy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -884,9 +876,8 @@ func (in *PodSecurityPolicyList) DeepCopy() *PodSecurityPolicyList {
func (in *PodSecurityPolicyList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -977,9 +968,8 @@ func (in *ReplicaSet) DeepCopy() *ReplicaSet {
func (in *ReplicaSet) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -1028,9 +1018,8 @@ func (in *ReplicaSetList) DeepCopy() *ReplicaSetList {
func (in *ReplicaSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@ -1103,9 +1092,8 @@ func (in *ReplicationControllerDummy) DeepCopy() *ReplicationControllerDummy {
func (in *ReplicationControllerDummy) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.