Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #68864: POSTing rollback returns metav1.Status #68909

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/swagger-spec/apps_v1beta1.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/swagger-spec/extensions_v1beta1.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/api-reference/apps/v1beta1/operations.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/api-reference/extensions/v1beta1/operations.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pkg/registry/apps/deployment/storage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ go_library(
"//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage:go_default_library",
"//pkg/registry/apps/deployment:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
Expand Down
3 changes: 1 addition & 2 deletions pkg/registry/apps/deployment/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"net/http"

externalappsv1beta1 "k8s.io/api/apps/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -149,7 +148,7 @@ func (r *RollbackREST) ProducesMIMETypes(verb string) []string {
// ProducesObject returns an object the specified HTTP verb respond with. It will overwrite storage object if
// it is not nil. Only the type of the return object matters, the value will be ignored.
func (r *RollbackREST) ProducesObject(verb string) interface{} {
return externalappsv1beta1.DeploymentStatus{}
return metav1.Status{}
}

var _ = rest.StorageMetadata(&RollbackREST{})
Expand Down
13 changes: 1 addition & 12 deletions pkg/registry/extensions/rest/storage_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
return apiGroupInfo, true
}

type RollbackREST struct {
*deploymentstore.RollbackREST
}

// override RollbackREST.ProducesObject
func (r *RollbackREST) ProducesObject(verb string) interface{} {
return extensionsapiv1beta1.DeploymentStatus{}
}

var _ = rest.StorageMetadata(&RollbackREST{})

func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) map[string]rest.Storage {
storage := map[string]rest.Storage{}

Expand All @@ -76,7 +65,7 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
deploymentStorage := deploymentstore.NewStorage(restOptionsGetter)
storage["deployments"] = deploymentStorage.Deployment.WithCategories(nil)
storage["deployments/status"] = deploymentStorage.Status
storage["deployments/rollback"] = &RollbackREST{deploymentStorage.Rollback}
storage["deployments/rollback"] = deploymentStorage.Rollback
storage["deployments/scale"] = deploymentStorage.Scale
// ingresses
ingressStorage, ingressStatusStorage := ingressstore.NewREST(restOptionsGetter)
Expand Down