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

deploy: remove deprecated generatedeploymentconfig api #15585

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions api/swagger-spec/oapi-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8291,59 +8291,6 @@
}
]
},
{
"path": "/oapi/v1/namespaces/{namespace}/generatedeploymentconfigs/{name}",
"description": "OpenShift REST API, version v1",
"operations": [
{
"type": "v1.DeploymentConfig",
"method": "GET",
"summary": "read the specified DeploymentConfig",
"nickname": "readNamespacedDeploymentConfig",
"parameters": [
{
"type": "string",
"paramType": "query",
"name": "pretty",
"description": "If 'true', then the output is pretty printed.",
"required": false,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
"name": "namespace",
"description": "object name and auth scope, such as for teams and projects",
"required": true,
"allowMultiple": false
},
{
"type": "string",
"paramType": "path",
"name": "name",
"description": "name of the DeploymentConfig",
"required": true,
"allowMultiple": false
}
],
"responseMessages": [
{
"code": 200,
"message": "OK",
"responseModel": "v1.DeploymentConfig"
}
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"consumes": [
"*/*"
]
}
]
},
{
"path": "/oapi/v1/groups",
"description": "OpenShift REST API, version v1",
Expand Down
59 changes: 0 additions & 59 deletions api/swagger-spec/openshift-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -77580,65 +77580,6 @@
}
]
},
"/oapi/v1/namespaces/{namespace}/generatedeploymentconfigs/{name}": {
"get": {
"description": "read the specified DeploymentConfig",
"consumes": [
"*/*"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"operationId": "generateNamespacedDeploymentConfig",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/com.github.openshift.origin.pkg.deploy.apis.apps.v1.DeploymentConfig"
}
},
"401": {
"description": "Unauthorized"
}
},
"x-kubernetes-action": "get",
"x-kubernetes-group-version-kind": {
"group": "",
"version": "latest",
"kind": "DeploymentConfig"
}
},
"parameters": [
{
"uniqueItems": true,
"type": "string",
"description": "name of the DeploymentConfig",
"name": "name",
"in": "path",
"required": true
},
{
"uniqueItems": true,
"type": "string",
"description": "object name and auth scope, such as for teams and projects",
"name": "namespace",
"in": "path",
"required": true
},
{
"uniqueItems": true,
"type": "string",
"description": "If 'true', then the output is pretty printed.",
"name": "pretty",
"in": "query"
}
]
},
"/oapi/v1/namespaces/{namespace}/imagestreamimages/{name}": {
"get": {
"description": "read the specified ImageStreamImage",
Expand Down
2 changes: 1 addition & 1 deletion pkg/authorization/apis/authorization/deprecated_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var (
groupsToResources = map[string][]string{
buildGroupName: {"builds", "buildconfigs", "buildlogs", "buildconfigs/instantiate", "buildconfigs/instantiatebinary", "builds/log", "builds/clone", "buildconfigs/webhooks"},
imageGroupName: {"imagestreams", "imagestreammappings", "imagestreamtags", "imagestreamimages", "imagestreamimports"},
deploymentGroupName: {"deploymentconfigs", "generatedeploymentconfigs", "deploymentconfigrollbacks", "deploymentconfigs/log", "deploymentconfigs/scale"},
deploymentGroupName: {"deploymentconfigs", "deploymentconfigrollbacks", "deploymentconfigs/log", "deploymentconfigs/scale"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to deprecate deploymentconfigrollbacks too in favor of deploymentconfigs/rollback but it's a separate issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 i saw it in master config but want to track that as separate thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this tracked anywhere?

sdnGroupName: {"clusternetworks", "hostsubnets", "netnamespaces"},
templateGroupName: {"templates", "templateconfigs", "processedtemplates"},
userGroupName: {"identities", "users", "useridentitymappings", "groups"},
Expand Down
8 changes: 0 additions & 8 deletions pkg/client/deploymentconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type DeploymentConfigInterface interface {
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *deployapi.DeploymentConfig, err error)
Delete(name string) error
Watch(opts metav1.ListOptions) (watch.Interface, error)
Generate(name string) (*deployapi.DeploymentConfig, error)
Rollback(config *deployapi.DeploymentConfigRollback) (*deployapi.DeploymentConfig, error)
RollbackDeprecated(config *deployapi.DeploymentConfigRollback) (*deployapi.DeploymentConfig, error)
GetScale(name string) (*extensionsv1beta1.Scale, error)
Expand Down Expand Up @@ -105,13 +104,6 @@ func (c *deploymentConfigs) Watch(opts metav1.ListOptions) (watch.Interface, err
Watch()
}

// Generate generates a new deploymentConfig for the given name.
func (c *deploymentConfigs) Generate(name string) (result *deployapi.DeploymentConfig, err error) {
result = &deployapi.DeploymentConfig{}
err = c.r.Get().Namespace(c.ns).Resource("generateDeploymentConfigs").Name(name).Do().Into(result)
return
}

// Rollback rolls a deploymentConfig back to a previous configuration
func (c *deploymentConfigs) Rollback(config *deployapi.DeploymentConfigRollback) (result *deployapi.DeploymentConfig, err error) {
result = &deployapi.DeploymentConfig{}
Expand Down
9 changes: 0 additions & 9 deletions pkg/client/testclient/fake_deploymentconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ func (c *FakeDeploymentConfigs) Watch(opts metav1.ListOptions) (watch.Interface,
return c.Fake.InvokesWatch(clientgotesting.NewWatchAction(deploymentConfigsResource, c.Namespace, opts))
}

func (c *FakeDeploymentConfigs) Generate(name string) (*deployapi.DeploymentConfig, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewGetAction(deployapi.LegacySchemeGroupVersion.WithResource("generatedeploymentconfigs"), c.Namespace, name), &deployapi.DeploymentConfig{})
if obj == nil {
return nil, err
}

return obj.(*deployapi.DeploymentConfig), err
}

func (c *FakeDeploymentConfigs) Rollback(inObj *deployapi.DeploymentConfigRollback) (result *deployapi.DeploymentConfig, err error) {
obj, err := c.Fake.Invokes(clientgotesting.NewCreateAction(deployapi.LegacySchemeGroupVersion.WithResource("deploymentconfigs/rollback"), c.Namespace, inObj), inObj)
if obj == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/server/bootstrappolicy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func GetOpenshiftBootstrapClusterRoles() []authorizationapi.ClusterRole {
// access to jenkins. multiple values to ensure that covers relationships
authorizationapi.NewRule("admin", "edit", "view").Groups(buildapi.GroupName).Resources("jenkins").RuleOrDie(),

authorizationapi.NewRule(readWrite...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs", "generatedeploymentconfigs", "deploymentconfigs/scale").RuleOrDie(),
authorizationapi.NewRule(readWrite...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs", "deploymentconfigs/scale").RuleOrDie(),
authorizationapi.NewRule("create").Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigrollbacks", "deploymentconfigs/rollback", "deploymentconfigs/instantiate").RuleOrDie(),
authorizationapi.NewRule(read...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs/log", "deploymentconfigs/status").RuleOrDie(),

Expand Down Expand Up @@ -413,7 +413,7 @@ func GetOpenshiftBootstrapClusterRoles() []authorizationapi.ClusterRole {
// access to jenkins. multiple values to ensure that covers relationships
authorizationapi.NewRule("edit", "view").Groups(buildapi.GroupName).Resources("jenkins").RuleOrDie(),

authorizationapi.NewRule(readWrite...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs", "generatedeploymentconfigs", "deploymentconfigs/scale").RuleOrDie(),
authorizationapi.NewRule(readWrite...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs", "deploymentconfigs/scale").RuleOrDie(),
authorizationapi.NewRule("create").Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigrollbacks", "deploymentconfigs/rollback", "deploymentconfigs/instantiate").RuleOrDie(),
authorizationapi.NewRule(read...).Groups(deployGroup, legacyDeployGroup).Resources("deploymentconfigs/log", "deploymentconfigs/status").RuleOrDie(),

Expand Down
2 changes: 0 additions & 2 deletions pkg/cmd/server/kubernetes/master/master_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,6 @@ func DefaultOpenAPIConfig(config configapi.MasterConfig) *openapicommon.Config {
op = "createProcessedTemplateForAllNamespacesV1"
} else if strings.HasPrefix(path, "/apis/template.openshift.io/v1/processedtemplates") {
op = "createProcessedTemplateForAllNamespaces"
} else if strings.HasPrefix(path, "/oapi/v1/namespaces/{namespace}/generatedeploymentconfigs") {
op = "generateNamespacedDeploymentConfig"
}
if op != r.Operation {
return op, []string{}, nil
Expand Down
10 changes: 0 additions & 10 deletions pkg/cmd/server/origin/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
deployconfigregistry "github.com/openshift/origin/pkg/deploy/registry/deployconfig"
deployconfigetcd "github.com/openshift/origin/pkg/deploy/registry/deployconfig/etcd"
deploylogregistry "github.com/openshift/origin/pkg/deploy/registry/deploylog"
deployconfiggenerator "github.com/openshift/origin/pkg/deploy/registry/generator"
deployconfiginstantiate "github.com/openshift/origin/pkg/deploy/registry/instantiate"
deployrollback "github.com/openshift/origin/pkg/deploy/registry/rollback"
"github.com/openshift/origin/pkg/dockerregistry"
Expand Down Expand Up @@ -295,14 +294,6 @@ func (c OpenshiftAPIConfig) GetRestStorage() (map[schema.GroupVersion]map[string
Secrets: c.KubeClientInternal.Core(),
}

// TODO: with sharding, this needs to be changed
deployConfigGenerator := &deployconfiggenerator.DeploymentConfigGenerator{
Client: deployconfiggenerator.Client{
DCFn: deployConfigRegistry.GetDeploymentConfig,
ISFn: imageStreamRegistry.GetImageStream,
LISFn2: imageStreamRegistry.ListImageStreams,
},
}
deployRollbackClient := deployrollback.Client{
DCFn: deployConfigRegistry.GetDeploymentConfig,
RCFn: clientDeploymentInterface{c.KubeClientInternal}.GetDeployment,
Expand Down Expand Up @@ -383,7 +374,6 @@ func (c OpenshiftAPIConfig) GetRestStorage() (map[schema.GroupVersion]map[string
storage := map[schema.GroupVersion]map[string]rest.Storage{
v1.SchemeGroupVersion: {
// TODO: Deprecate these
"generateDeploymentConfigs": deployconfiggenerator.NewREST(deployConfigGenerator, externalVersionCodec),
"deploymentConfigRollbacks": deployrollback.NewDeprecatedREST(deployRollbackClient, externalVersionCodec),
},
}
Expand Down
160 changes: 0 additions & 160 deletions pkg/deploy/registry/generator/config_generator.go

This file was deleted.

Loading