mirror of https://github.com/k3s-io/k3s
Merge pull request #13957 from ghodss/rename-deployment-structs
Auto commit by PR queue botpull/6/head
commit
e83bf49f86
|
@ -69,7 +69,9 @@ type DeploymentSpec struct {
|
||||||
Replicas *int
|
Replicas *int
|
||||||
|
|
||||||
// Label selector for pods. Existing ReplicationControllers whose pods are
|
// Label selector for pods. Existing ReplicationControllers whose pods are
|
||||||
// selected by this will be scaled down.
|
// selected by this will be scaled down. New ReplicationControllers will be
|
||||||
|
// created with this selector, with a unique label as defined by UniqueLabelKey.
|
||||||
|
// If Selector is empty, it is defaulted to the labels present on the Pod template.
|
||||||
Selector map[string]string
|
Selector map[string]string
|
||||||
|
|
||||||
// Describes the pods that will be created.
|
// Describes the pods that will be created.
|
||||||
|
@ -90,27 +92,27 @@ type DeploymentSpec struct {
|
||||||
|
|
||||||
type DeploymentStrategy struct {
|
type DeploymentStrategy struct {
|
||||||
// Type of deployment. Can be "Recreate" or "RollingUpdate".
|
// Type of deployment. Can be "Recreate" or "RollingUpdate".
|
||||||
Type DeploymentType
|
Type DeploymentStrategyType
|
||||||
|
|
||||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||||
// to be.
|
// to be.
|
||||||
// Rolling update config params. Present only if DeploymentType =
|
// Rolling update config params. Present only if DeploymentStrategyType =
|
||||||
// RollingUpdate.
|
// RollingUpdate.
|
||||||
RollingUpdate *RollingUpdateDeploymentSpec
|
RollingUpdate *RollingUpdateDeploymentStrategy
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeploymentType string
|
type DeploymentStrategyType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Kill all existing pods before creating new ones.
|
// Kill all existing pods before creating new ones.
|
||||||
DeploymentRecreate DeploymentType = "Recreate"
|
RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"
|
||||||
|
|
||||||
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
||||||
DeploymentRollingUpdate DeploymentType = "RollingUpdate"
|
RollingUpdateDeploymentStrategyType DeploymentStrategyType = "RollingUpdate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Spec to control the desired behavior of rolling update.
|
// Spec to control the desired behavior of rolling update.
|
||||||
type RollingUpdateDeploymentSpec struct {
|
type RollingUpdateDeploymentStrategy struct {
|
||||||
// The maximum number of pods that can be unavailable during the update.
|
// The maximum number of pods that can be unavailable during the update.
|
||||||
// Value can be an absolute number (ex: 5) or a percentage of total pods at the start of update (ex: 10%).
|
// Value can be an absolute number (ex: 5) or a percentage of total pods at the start of update (ex: 10%).
|
||||||
// Absolute number is calculated from percentage by rounding up.
|
// Absolute number is calculated from percentage by rounding up.
|
||||||
|
@ -246,7 +248,7 @@ To begin with, we will support 2 types of deployment:
|
||||||
This results in a slower deployment, but there is no downtime. At all times
|
This results in a slower deployment, but there is no downtime. At all times
|
||||||
during the deployment, there are a few pods available (old or new). The number
|
during the deployment, there are a few pods available (old or new). The number
|
||||||
of available pods and when is a pod considered "available" can be configured
|
of available pods and when is a pod considered "available" can be configured
|
||||||
using RollingUpdateDeploymentSpec.
|
using RollingUpdateDeploymentStrategy.
|
||||||
|
|
||||||
In future, we want to support more deployment types.
|
In future, we want to support more deployment types.
|
||||||
|
|
||||||
|
@ -254,7 +256,7 @@ In future, we want to support more deployment types.
|
||||||
|
|
||||||
Apart from the above, we want to add support for the following:
|
Apart from the above, we want to add support for the following:
|
||||||
* Running the deployment process in a pod: In future, we can run the deployment process in a pod. Then users can define their own custom deployments and we can run it using the image name.
|
* Running the deployment process in a pod: In future, we can run the deployment process in a pod. Then users can define their own custom deployments and we can run it using the image name.
|
||||||
* More DeploymentTypes: https://github.com/openshift/origin/blob/master/examples/deployment/README.md#deployment-types lists most commonly used ones.
|
* More DeploymentStrategyTypes: https://github.com/openshift/origin/blob/master/examples/deployment/README.md#deployment-types lists most commonly used ones.
|
||||||
* Triggers: Deployment will have a trigger field to identify what triggered the deployment. Options are: Manual/UserTriggered, Autoscaler, NewImage.
|
* Triggers: Deployment will have a trigger field to identify what triggered the deployment. Options are: Manual/UserTriggered, Autoscaler, NewImage.
|
||||||
* Automatic rollback on error: We want to support automatic rollback on error or timeout.
|
* Automatic rollback on error: We want to support automatic rollback on error or timeout.
|
||||||
|
|
||||||
|
|
|
@ -124,9 +124,9 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
|
||||||
func(j *experimental.DeploymentStrategy, c fuzz.Continue) {
|
func(j *experimental.DeploymentStrategy, c fuzz.Continue) {
|
||||||
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
||||||
// Ensure that strategyType is one of valid values.
|
// Ensure that strategyType is one of valid values.
|
||||||
strategyTypes := []experimental.DeploymentType{experimental.DeploymentRecreate, experimental.DeploymentRollingUpdate}
|
strategyTypes := []experimental.DeploymentStrategyType{experimental.RecreateDeploymentStrategyType, experimental.RollingUpdateDeploymentStrategyType}
|
||||||
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
|
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
|
||||||
if j.Type != experimental.DeploymentRollingUpdate {
|
if j.Type != experimental.RollingUpdateDeploymentStrategyType {
|
||||||
j.RollingUpdate = nil
|
j.RollingUpdate = nil
|
||||||
} else {
|
} else {
|
||||||
rollingUpdate := experimental.RollingUpdateDeployment{}
|
rollingUpdate := experimental.RollingUpdateDeployment{}
|
||||||
|
|
|
@ -224,9 +224,9 @@ type DeploymentSpec struct {
|
||||||
|
|
||||||
type DeploymentStrategy struct {
|
type DeploymentStrategy struct {
|
||||||
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||||
Type DeploymentType `json:"type,omitempty"`
|
Type DeploymentStrategyType `json:"type,omitempty"`
|
||||||
|
|
||||||
// Rolling update config params. Present only if DeploymentType =
|
// Rolling update config params. Present only if DeploymentStrategyType =
|
||||||
// RollingUpdate.
|
// RollingUpdate.
|
||||||
//---
|
//---
|
||||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||||
|
@ -234,14 +234,14 @@ type DeploymentStrategy struct {
|
||||||
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
|
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeploymentType string
|
type DeploymentStrategyType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Kill all existing pods before creating new ones.
|
// Kill all existing pods before creating new ones.
|
||||||
DeploymentRecreate DeploymentType = "Recreate"
|
RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"
|
||||||
|
|
||||||
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
||||||
DeploymentRollingUpdate DeploymentType = "RollingUpdate"
|
RollingUpdateDeploymentStrategyType DeploymentStrategyType = "RollingUpdate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Spec to control the desired behavior of rolling update.
|
// Spec to control the desired behavior of rolling update.
|
||||||
|
|
|
@ -246,7 +246,7 @@ func convert_experimental_DeploymentStrategy_To_v1_DeploymentStrategy(in *experi
|
||||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||||
defaulting.(func(*experimental.DeploymentStrategy))(in)
|
defaulting.(func(*experimental.DeploymentStrategy))(in)
|
||||||
}
|
}
|
||||||
out.Type = DeploymentType(in.Type)
|
out.Type = DeploymentStrategyType(in.Type)
|
||||||
if in.RollingUpdate != nil {
|
if in.RollingUpdate != nil {
|
||||||
out.RollingUpdate = new(RollingUpdateDeployment)
|
out.RollingUpdate = new(RollingUpdateDeployment)
|
||||||
if err := convert_experimental_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
if err := convert_experimental_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||||
|
@ -262,7 +262,7 @@ func convert_v1_DeploymentStrategy_To_experimental_DeploymentStrategy(in *Deploy
|
||||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||||
defaulting.(func(*DeploymentStrategy))(in)
|
defaulting.(func(*DeploymentStrategy))(in)
|
||||||
}
|
}
|
||||||
out.Type = experimental.DeploymentType(in.Type)
|
out.Type = experimental.DeploymentStrategyType(in.Type)
|
||||||
if in.RollingUpdate != nil {
|
if in.RollingUpdate != nil {
|
||||||
out.RollingUpdate = new(experimental.RollingUpdateDeployment)
|
out.RollingUpdate = new(experimental.RollingUpdateDeployment)
|
||||||
if err := convert_v1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
if err := convert_v1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||||
|
|
|
@ -50,11 +50,11 @@ func addDefaultingFuncs() {
|
||||||
*obj.Spec.Replicas = 1
|
*obj.Spec.Replicas = 1
|
||||||
}
|
}
|
||||||
strategy := &obj.Spec.Strategy
|
strategy := &obj.Spec.Strategy
|
||||||
// Set default DeploymentType as RollingUpdate.
|
// Set default DeploymentStrategyType as RollingUpdate.
|
||||||
if strategy.Type == "" {
|
if strategy.Type == "" {
|
||||||
strategy.Type = DeploymentRollingUpdate
|
strategy.Type = RollingUpdateDeploymentStrategyType
|
||||||
}
|
}
|
||||||
if strategy.Type == DeploymentRollingUpdate {
|
if strategy.Type == RollingUpdateDeploymentStrategyType {
|
||||||
if strategy.RollingUpdate == nil {
|
if strategy.RollingUpdate == nil {
|
||||||
rollingUpdate := RollingUpdateDeployment{}
|
rollingUpdate := RollingUpdateDeployment{}
|
||||||
strategy.RollingUpdate = &rollingUpdate
|
strategy.RollingUpdate = &rollingUpdate
|
||||||
|
|
|
@ -98,7 +98,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(1),
|
Replicas: newInt(1),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRollingUpdate,
|
Type: RollingUpdateDeploymentStrategyType,
|
||||||
RollingUpdate: &RollingUpdateDeployment{
|
RollingUpdate: &RollingUpdateDeployment{
|
||||||
MaxSurge: &defaultIntOrString,
|
MaxSurge: &defaultIntOrString,
|
||||||
MaxUnavailable: &defaultIntOrString,
|
MaxUnavailable: &defaultIntOrString,
|
||||||
|
@ -123,7 +123,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(5),
|
Replicas: newInt(5),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRollingUpdate,
|
Type: RollingUpdateDeploymentStrategyType,
|
||||||
RollingUpdate: &RollingUpdateDeployment{
|
RollingUpdate: &RollingUpdateDeployment{
|
||||||
MaxSurge: &differentIntOrString,
|
MaxSurge: &differentIntOrString,
|
||||||
MaxUnavailable: &defaultIntOrString,
|
MaxUnavailable: &defaultIntOrString,
|
||||||
|
@ -138,7 +138,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(5),
|
Replicas: newInt(5),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRecreate,
|
Type: RecreateDeploymentStrategyType,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -146,7 +146,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(5),
|
Replicas: newInt(5),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRecreate,
|
Type: RecreateDeploymentStrategyType,
|
||||||
},
|
},
|
||||||
UniqueLabelKey: newString(deploymentLabelKey),
|
UniqueLabelKey: newString(deploymentLabelKey),
|
||||||
},
|
},
|
||||||
|
@ -157,7 +157,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(5),
|
Replicas: newInt(5),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRecreate,
|
Type: RecreateDeploymentStrategyType,
|
||||||
},
|
},
|
||||||
UniqueLabelKey: newString("customDeploymentKey"),
|
UniqueLabelKey: newString("customDeploymentKey"),
|
||||||
},
|
},
|
||||||
|
@ -166,7 +166,7 @@ func TestSetDefaultDeployment(t *testing.T) {
|
||||||
Spec: DeploymentSpec{
|
Spec: DeploymentSpec{
|
||||||
Replicas: newInt(5),
|
Replicas: newInt(5),
|
||||||
Strategy: DeploymentStrategy{
|
Strategy: DeploymentStrategy{
|
||||||
Type: DeploymentRecreate,
|
Type: RecreateDeploymentStrategyType,
|
||||||
},
|
},
|
||||||
UniqueLabelKey: newString("customDeploymentKey"),
|
UniqueLabelKey: newString("customDeploymentKey"),
|
||||||
},
|
},
|
||||||
|
|
|
@ -220,9 +220,9 @@ type DeploymentSpec struct {
|
||||||
// DeploymentStrategy describes how to replace existing pods with new ones.
|
// DeploymentStrategy describes how to replace existing pods with new ones.
|
||||||
type DeploymentStrategy struct {
|
type DeploymentStrategy struct {
|
||||||
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||||
Type DeploymentType `json:"type,omitempty"`
|
Type DeploymentStrategyType `json:"type,omitempty"`
|
||||||
|
|
||||||
// Rolling update config params. Present only if DeploymentType =
|
// Rolling update config params. Present only if DeploymentStrategyType =
|
||||||
// RollingUpdate.
|
// RollingUpdate.
|
||||||
//---
|
//---
|
||||||
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
// TODO: Update this to follow our convention for oneOf, whatever we decide it
|
||||||
|
@ -230,14 +230,14 @@ type DeploymentStrategy struct {
|
||||||
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
|
RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeploymentType string
|
type DeploymentStrategyType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Kill all existing pods before creating new ones.
|
// Kill all existing pods before creating new ones.
|
||||||
DeploymentRecreate DeploymentType = "Recreate"
|
RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"
|
||||||
|
|
||||||
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
// Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
|
||||||
DeploymentRollingUpdate DeploymentType = "RollingUpdate"
|
RollingUpdateDeploymentStrategyType DeploymentStrategyType = "RollingUpdate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Spec to control the desired behavior of rolling update.
|
// Spec to control the desired behavior of rolling update.
|
||||||
|
|
|
@ -126,7 +126,7 @@ func (DeploymentStatus) SwaggerDoc() map[string]string {
|
||||||
var map_DeploymentStrategy = map[string]string{
|
var map_DeploymentStrategy = map[string]string{
|
||||||
"": "DeploymentStrategy describes how to replace existing pods with new ones.",
|
"": "DeploymentStrategy describes how to replace existing pods with new ones.",
|
||||||
"type": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.",
|
"type": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.",
|
||||||
"rollingUpdate": "Rolling update config params. Present only if DeploymentType = RollingUpdate.",
|
"rollingUpdate": "Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (DeploymentStrategy) SwaggerDoc() map[string]string {
|
func (DeploymentStrategy) SwaggerDoc() map[string]string {
|
||||||
|
|
|
@ -227,9 +227,9 @@ func ValidateDeploymentStrategy(strategy *experimental.DeploymentStrategy, field
|
||||||
return allErrs
|
return allErrs
|
||||||
}
|
}
|
||||||
switch strategy.Type {
|
switch strategy.Type {
|
||||||
case experimental.DeploymentRecreate:
|
case experimental.RecreateDeploymentStrategyType:
|
||||||
allErrs = append(allErrs, errs.NewFieldForbidden("rollingUpdate", "rollingUpdate should be nil when strategy type is "+experimental.DeploymentRecreate))
|
allErrs = append(allErrs, errs.NewFieldForbidden("rollingUpdate", "rollingUpdate should be nil when strategy type is "+experimental.RecreateDeploymentStrategyType))
|
||||||
case experimental.DeploymentRollingUpdate:
|
case experimental.RollingUpdateDeploymentStrategyType:
|
||||||
allErrs = append(allErrs, ValidateRollingUpdateDeployment(strategy.RollingUpdate, "rollingUpdate")...)
|
allErrs = append(allErrs, ValidateRollingUpdateDeployment(strategy.RollingUpdate, "rollingUpdate")...)
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
|
|
|
@ -613,7 +613,7 @@ func TestValidateDeployment(t *testing.T) {
|
||||||
// rollingUpdate should be nil for recreate.
|
// rollingUpdate should be nil for recreate.
|
||||||
invalidRecreateDeployment := validDeployment()
|
invalidRecreateDeployment := validDeployment()
|
||||||
invalidRecreateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
invalidRecreateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||||
Type: experimental.DeploymentRecreate,
|
Type: experimental.RecreateDeploymentStrategyType,
|
||||||
RollingUpdate: &experimental.RollingUpdateDeployment{},
|
RollingUpdate: &experimental.RollingUpdateDeployment{},
|
||||||
}
|
}
|
||||||
errorCases["rollingUpdate should be nil when strategy type is Recreate"] = invalidRecreateDeployment
|
errorCases["rollingUpdate should be nil when strategy type is Recreate"] = invalidRecreateDeployment
|
||||||
|
@ -621,7 +621,7 @@ func TestValidateDeployment(t *testing.T) {
|
||||||
// MaxSurge should be in the form of 20%.
|
// MaxSurge should be in the form of 20%.
|
||||||
invalidMaxSurgeDeployment := validDeployment()
|
invalidMaxSurgeDeployment := validDeployment()
|
||||||
invalidMaxSurgeDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
invalidMaxSurgeDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||||
Type: experimental.DeploymentRollingUpdate,
|
Type: experimental.RollingUpdateDeploymentStrategyType,
|
||||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||||
MaxSurge: util.NewIntOrStringFromString("20Percent"),
|
MaxSurge: util.NewIntOrStringFromString("20Percent"),
|
||||||
},
|
},
|
||||||
|
@ -631,7 +631,7 @@ func TestValidateDeployment(t *testing.T) {
|
||||||
// MaxSurge and MaxUnavailable cannot both be zero.
|
// MaxSurge and MaxUnavailable cannot both be zero.
|
||||||
invalidRollingUpdateDeployment := validDeployment()
|
invalidRollingUpdateDeployment := validDeployment()
|
||||||
invalidRollingUpdateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
invalidRollingUpdateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||||
Type: experimental.DeploymentRollingUpdate,
|
Type: experimental.RollingUpdateDeploymentStrategyType,
|
||||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||||
MaxSurge: util.NewIntOrStringFromString("0%"),
|
MaxSurge: util.NewIntOrStringFromString("0%"),
|
||||||
MaxUnavailable: util.NewIntOrStringFromInt(0),
|
MaxUnavailable: util.NewIntOrStringFromInt(0),
|
||||||
|
@ -642,7 +642,7 @@ func TestValidateDeployment(t *testing.T) {
|
||||||
// MaxUnavailable should not be more than 100%.
|
// MaxUnavailable should not be more than 100%.
|
||||||
invalidMaxUnavailableDeployment := validDeployment()
|
invalidMaxUnavailableDeployment := validDeployment()
|
||||||
invalidMaxUnavailableDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
invalidMaxUnavailableDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||||
Type: experimental.DeploymentRollingUpdate,
|
Type: experimental.RollingUpdateDeploymentStrategyType,
|
||||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||||
MaxUnavailable: util.NewIntOrStringFromString("110%"),
|
MaxUnavailable: util.NewIntOrStringFromString("110%"),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue