mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Deprecate Deployment rollbackTo field and remove rollback endpoint
1. Deprecate `.spec.rollbackTo` field in extensions/v1beta1 and apps/v1beta1 Deployments 2. Remove the same field from apps/v1beta2 Deployment, and remove its rollback subresource and endpoint
This commit is contained in:
parent
96064570d2
commit
e7930520e4
@ -216,6 +216,7 @@ type DeploymentSpec struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Paused bool
|
Paused bool
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
||||||
// +optional
|
// +optional
|
||||||
RollbackTo *RollbackConfig
|
RollbackTo *RollbackConfig
|
||||||
@ -232,6 +233,7 @@ type DeploymentSpec struct {
|
|||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// DeploymentRollback stores the information required to rollback a deployment.
|
// DeploymentRollback stores the information required to rollback a deployment.
|
||||||
type DeploymentRollback struct {
|
type DeploymentRollback struct {
|
||||||
metav1.TypeMeta
|
metav1.TypeMeta
|
||||||
@ -244,6 +246,7 @@ type DeploymentRollback struct {
|
|||||||
RollbackTo RollbackConfig
|
RollbackTo RollbackConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
type RollbackConfig struct {
|
type RollbackConfig struct {
|
||||||
// The revision to rollback to. If set to 0, rollback to the last revision.
|
// The revision to rollback to. If set to 0, rollback to the last revision.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -83,7 +83,6 @@ func (p RESTStorageProvider) v1beta2Storage(apiResourceConfigSource serverstorag
|
|||||||
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
|
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
|
||||||
storage["deployments"] = deploymentStorage.Deployment
|
storage["deployments"] = deploymentStorage.Deployment
|
||||||
storage["deployments/status"] = deploymentStorage.Status
|
storage["deployments/status"] = deploymentStorage.Status
|
||||||
storage["deployments/rollback"] = deploymentStorage.Rollback
|
|
||||||
storage["deployments/scale"] = deploymentStorage.Scale
|
storage["deployments/scale"] = deploymentStorage.Scale
|
||||||
}
|
}
|
||||||
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
|
if apiResourceConfigSource.ResourceEnabled(version.WithResource("statefulsets")) {
|
||||||
|
@ -305,6 +305,7 @@ type DeploymentSpec struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
||||||
// +optional
|
// +optional
|
||||||
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
|
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
|
||||||
@ -321,6 +322,7 @@ type DeploymentSpec struct {
|
|||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// DeploymentRollback stores the information required to rollback a deployment.
|
// DeploymentRollback stores the information required to rollback a deployment.
|
||||||
type DeploymentRollback struct {
|
type DeploymentRollback struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
@ -333,6 +335,7 @@ type DeploymentRollback struct {
|
|||||||
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
|
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
type RollbackConfig struct {
|
type RollbackConfig struct {
|
||||||
// The revision to rollback to. If set to 0, rollback to the last revision.
|
// The revision to rollback to. If set to 0, rollback to the last revision.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -46,7 +46,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
&Deployment{},
|
&Deployment{},
|
||||||
&DeploymentList{},
|
&DeploymentList{},
|
||||||
&DeploymentRollback{},
|
|
||||||
&Scale{},
|
&Scale{},
|
||||||
&StatefulSet{},
|
&StatefulSet{},
|
||||||
&StatefulSetList{},
|
&StatefulSetList{},
|
||||||
|
@ -315,10 +315,6 @@ type DeploymentSpec struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
||||||
|
|
||||||
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
|
||||||
// +optional
|
|
||||||
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
|
|
||||||
|
|
||||||
// The maximum time in seconds for a deployment to make progress before it
|
// The maximum time in seconds for a deployment to make progress before it
|
||||||
// is considered to be failed. The deployment controller will continue to
|
// is considered to be failed. The deployment controller will continue to
|
||||||
// process failed deployments and a condition with a ProgressDeadlineExceeded
|
// process failed deployments and a condition with a ProgressDeadlineExceeded
|
||||||
@ -329,28 +325,6 @@ type DeploymentSpec struct {
|
|||||||
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"`
|
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
||||||
|
|
||||||
// WIP: This is not ready to be used and we plan to make breaking changes to it.
|
|
||||||
// DeploymentRollback stores the information required to rollback a deployment.
|
|
||||||
type DeploymentRollback struct {
|
|
||||||
metav1.TypeMeta `json:",inline"`
|
|
||||||
// Required: This must match the Name of a deployment.
|
|
||||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
|
||||||
// The annotations to be updated to a deployment
|
|
||||||
// +optional
|
|
||||||
UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty" protobuf:"bytes,2,rep,name=updatedAnnotations"`
|
|
||||||
// The config of this deployment rollback.
|
|
||||||
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// WIP: This is not ready to be used and we plan to make breaking changes to it.
|
|
||||||
type RollbackConfig struct {
|
|
||||||
// The revision to rollback to. If set to 0, rollback to the last revision.
|
|
||||||
// +optional
|
|
||||||
Revision int64 `json:"revision,omitempty" protobuf:"varint,1,opt,name=revision"`
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
|
// DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
|
||||||
// to existing RCs (and label key that is added to its pods) to prevent the existing RCs
|
// to existing RCs (and label key that is added to its pods) to prevent the existing RCs
|
||||||
|
@ -211,6 +211,7 @@ type DeploymentSpec struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
// The config this deployment is rolling back to. Will be cleared after rollback is done.
|
||||||
// +optional
|
// +optional
|
||||||
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
|
RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
|
||||||
@ -227,6 +228,7 @@ type DeploymentSpec struct {
|
|||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
// DeploymentRollback stores the information required to rollback a deployment.
|
// DeploymentRollback stores the information required to rollback a deployment.
|
||||||
type DeploymentRollback struct {
|
type DeploymentRollback struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
@ -239,6 +241,7 @@ type DeploymentRollback struct {
|
|||||||
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
|
RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEPRECATED.
|
||||||
type RollbackConfig struct {
|
type RollbackConfig struct {
|
||||||
// The revision to rollback to. If set to 0, rollback to the last revision.
|
// The revision to rollback to. If set to 0, rollback to the last revision.
|
||||||
// +optional
|
// +optional
|
||||||
|
@ -385,8 +385,7 @@ var ephemeralWhiteList = createEphemeralWhiteList(
|
|||||||
// --
|
// --
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/apis/apps/v1beta2
|
// k8s.io/kubernetes/pkg/apis/apps/v1beta2
|
||||||
gvr("apps", "v1beta2", "scales"), // not stored in etcd, part of kapiv1.ReplicationController
|
gvr("apps", "v1beta2", "scales"), // not stored in etcd, part of kapiv1.ReplicationController
|
||||||
gvr("apps", "v1beta2", "deploymentrollbacks"), // used to rollback deployment, not stored in etcd
|
|
||||||
// --
|
// --
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/apis/batch/v2alpha1
|
// k8s.io/kubernetes/pkg/apis/batch/v2alpha1
|
||||||
|
Loading…
Reference in New Issue
Block a user